Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sensitive keys set configurable #494

Merged

Conversation

jeffrey-effendy
Copy link
Contributor

@jeffrey-effendy jeffrey-effendy commented Sep 21, 2021

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

@jeffrey-effendy jeffrey-effendy changed the title Add SILKY_SENSITIVE_KEYS to make sensitive keys masking configurable Make sensitive keys set configurable Sep 21, 2021
@codecov
Copy link

codecov bot commented Sep 22, 2021

Codecov Report

Merging #494 (0c237b3) into master (11aa8cd) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #494      +/-   ##
==========================================
+ Coverage   84.61%   84.65%   +0.03%     
==========================================
  Files          50       51       +1     
  Lines        2061     2066       +5     
==========================================
+ Hits         1744     1749       +5     
  Misses        317      317              
Impacted Files Coverage Δ
silk/config.py 90.47% <ø> (ø)
silk/model_factory.py 83.84% <100.00%> (ø)
silk/apps.py 100.00% <0.00%> (ø)
project/project/__init__.py 66.66% <0.00%> (+6.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11aa8cd...0c237b3. Read the comment docs.

silk/config.py Show resolved Hide resolved
@jeffrey-effendy jeffrey-effendy force-pushed the support-configurable-sensitive-keys branch 2 times, most recently from 3cc3632 to 515e170 Compare September 23, 2021 02:57
@auvipy auvipy merged commit 0c554bc into jazzband:master Sep 27, 2021
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.

None yet

2 participants