Skip to content

Ensure JSON Key Path is an Actual File or IO Object#134

Open
cacheflow wants to merge 4 commits intodecision-labs:masterfrom
cacheflow:prevent-opening-json-key-path-unless-valid-io-object
Open

Ensure JSON Key Path is an Actual File or IO Object#134
cacheflow wants to merge 4 commits intodecision-labs:masterfrom
cacheflow:prevent-opening-json-key-path-unless-valid-io-object

Conversation

@cacheflow
Copy link

@cacheflow cacheflow commented Dec 18, 2024

Currently, in the json_key method it assumes that json_key_path will be an IO-like object or filename. This can cause an issue where if someone accidentally passes credentials in plaintext or a non-IO object, the Gem will attempt to open the credentials and display the credentials in plain text.

This PR resolves #133.

@cacheflow cacheflow force-pushed the prevent-opening-json-key-path-unless-valid-io-object branch 2 times, most recently from dcc792e to bb13556 Compare December 18, 2024 07:02
@cacheflow cacheflow changed the title Prevent Opening JSON Key Path unless It's an IO Object Prevent Opening JSON Key Path unless it's an IO Object Dec 18, 2024
@cacheflow cacheflow changed the title Prevent Opening JSON Key Path unless it's an IO Object Ensure JSON Key Path is an Actual File or IO Object Dec 18, 2024
@cacheflow
Copy link
Author

Hey @sabman or @erimicel, do you all think this would be a good addition to the library? On one project, I worked on we encountered an IO error that caused a credential to leak out unintentionally, so I created this PR to ensure the JSON key path is an IO like object. Any feedback would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent Opening JSON Key Path unless It's an IO Object

1 participant