Add encrypted oJob file support (.yaml.enc, .json.enc) #1649
+279
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extends oJob to decrypt
.yaml.encand.json.encfiles. Encrypted files are now transparently loaded alongside regular oJob files, both locally and remotely.Implementation
Added 4 decryption handlers in
js/owrap.oJob.js:fnDownEncYAML/fnDownEncJSONfor remote filesfnReadEncYAML/fnReadEncJSONfor local filesUpdated file extension matching to check
.encpatterns before regular.yaml/.jsonextensionsMaintains consistency with existing code patterns (unsafe eval support, error handling via
_loadwrapper)Usage
Files are decrypted using the same mechanism as password fields throughout OpenAF. If decryption fails, the original content is returned (graceful degradation via
decryptIfPossible).Testing
Added test coverage in
tests/autoTestAll.oJob.{js,yaml}verifying both YAML and JSON encrypted file loading.