Make sensitive keys set configurable #494
Merged
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.
Currently the masking logic has hard coded set of sensitive keys under RequestModelFactory to mask the body value. There are times where I need to add values into the existing keys. It is hard with the current implementation.
Since the masking logic is already implemented, it would be nice to have the sensitive keys configurable from Django settings. This will make the masking more flexible for many users.
For this I create a new key in config
SILKY_SENSITIVE_KEYS
with default value
{'username', 'api', 'token', 'key', 'secret', 'password', 'signature'}
so it does not affect any previous users.
Let me know if this is a good addition