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

feat: Automatic masking of sensitive data in the output by default #1842

Merged
merged 11 commits into from
Oct 18, 2023

Conversation

Stranger6667
Copy link
Member

@Stranger6667 Stranger6667 commented Oct 15, 2023

Resolves #1794

TODO:

  • Write more unit tests for masking logic
  • Document that response payloads are not masked (the reason is that I think we need to keep the format of the original response - key sorting, indentation, etc)
  • Apply to the pytest integration
  • Write top-level test cases specifically for output masking
  • Tests for masking data in cassettes
  • Check if any "masking" function could be removed
  • More unit tests
  • Bikeshed naming more
  • More reliable test for cassettes - it could have weird chars there
  • Document MaskingConfig as a public API

@Stranger6667 Stranger6667 changed the title feat: Automatic output sanitization to obscure sensitive data by default feat: Automatic masking of sensitive data in the output by default Oct 16, 2023
@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

Merging #1842 (b0197c9) into master (8ea9833) will increase coverage by 0.01%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1842      +/-   ##
==========================================
+ Coverage   98.94%   98.96%   +0.01%     
==========================================
  Files         103      105       +2     
  Lines        8655     8792     +137     
  Branches     1786     1824      +38     
==========================================
+ Hits         8564     8701     +137     
  Misses         52       52              
  Partials       39       39              
Files Coverage Δ
src/schemathesis/cli/__init__.py 99.26% <100.00%> (+<0.01%) ⬆️
src/schemathesis/cli/sanitization.py 100.00% <100.00%> (ø)
src/schemathesis/lazy.py 91.81% <100.00%> (+0.04%) ⬆️
src/schemathesis/models.py 98.44% <100.00%> (+0.01%) ⬆️
src/schemathesis/runner/impl/core.py 97.21% <100.00%> (+0.01%) ⬆️
src/schemathesis/sanitization.py 100.00% <100.00%> (ø)
src/schemathesis/schemas.py 99.45% <100.00%> (+<0.01%) ⬆️
src/schemathesis/specs/graphql/loaders.py 98.88% <ø> (ø)
src/schemathesis/specs/openapi/loaders.py 98.84% <ø> (ø)

@Stranger6667 Stranger6667 force-pushed the dd/sanitization-hook branch 3 times, most recently from 17b5caa to 2321f6e Compare October 16, 2023 23:14
@Stranger6667 Stranger6667 merged commit bde2ec7 into master Oct 18, 2023
20 checks passed
@Stranger6667 Stranger6667 deleted the dd/sanitization-hook branch October 18, 2023 15:03
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.

[FEATURE] Provide a way to hide some sensitive headers when displaying error message
1 participant