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

Add redaction support to encoder and change SkunkException to use it #900

Merged
merged 16 commits into from
Jul 14, 2023

Conversation

mpilquist
Copy link
Member

@mpilquist mpilquist commented Jun 13, 2023

Adds support for both encoder level redaction (e.g., int4.redacted ~ int4) as well as session level overrides (via redactionStrategy = RedactionStrategy.All or RedactionStrategy.None).

Some libraries default to redacting all encoded values but in this PR, we default to respecting individual encoder redaction.

This PR also updates the test infrastructure to trace all database tests (using a new top level span per test).

@codecov-commenter
Copy link

codecov-commenter commented Jun 13, 2023

Codecov Report

Merging #900 (10cf3d6) into main (9ac10b7) will decrease coverage by 0.22%.
The diff coverage is 82.35%.

@@            Coverage Diff             @@
##             main     #900      +/-   ##
==========================================
- Coverage   83.90%   83.68%   -0.22%     
==========================================
  Files         125      127       +2     
  Lines        1758     1790      +32     
  Branches      212      171      -41     
==========================================
+ Hits         1475     1498      +23     
- Misses        283      292       +9     
Impacted Files Coverage Δ
...les/core/shared/src/main/scala/PreparedQuery.scala 32.07% <0.00%> (ø)
...red/src/main/scala/exception/DecodeException.scala 100.00% <ø> (ø)
.../main/scala/exception/PostgresErrorException.scala 97.05% <ø> (ø)
...re/shared/src/main/scala/net/BitVectorSocket.scala 100.00% <ø> (ø)
...core/shared/src/main/scala/net/protocol/Bind.scala 100.00% <ø> (ø)
...e/shared/src/main/scala/net/protocol/Execute.scala 100.00% <ø> (ø)
...ore/shared/src/main/scala/net/protocol/Query.scala 100.00% <ø> (ø)
...core/shared/src/main/scala/RedactionStrategy.scala 33.33% <33.33%> (ø)
...ared/src/main/scala/exception/SkunkException.scala 72.50% <33.33%> (ø)
modules/core/shared/src/main/scala/Encoder.scala 84.21% <76.47%> (-9.13%) ⬇️
... and 7 more

@tpolecat
Copy link
Member

I think this is going to work well. Thanks!

@mpilquist mpilquist marked this pull request as ready for review July 7, 2023 02:03
@mpilquist
Copy link
Member Author

This one is ready for review.

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.

3 participants