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

[PLATFORM-864]: Add Redactable trait to Veil, for manually redacting structured data #63

Conversation

WilliamVenner
Copy link
Contributor

https://prima-assicurazioni-spa.myjetbrains.com/youtrack/issue/PLATFORM-864

This PR introduces the Redactable trait, one method of manually redacting data.

This allows users to explicitly call .redact() or .redact_into() on a type to get redacted data back from it.

The trait can be derived using the newly introduced derive macro, or manually implemented for a type by hand.

@WilliamVenner WilliamVenner requested a review from a team as a code owner December 15, 2022 14:23
@cpiemontese cpiemontese requested a review from Fs00 December 15, 2022 15:23
@WilliamVenner WilliamVenner force-pushed the PLATFORM-864/user-story/add-redactable-trait-to-veil-for-manually-redacting-structured-data branch from 9389e1e to 7401cb2 Compare December 20, 2022 10:53
@MaeIsBad
Copy link
Member

Rerequest review so I know when you're done 🙏

Copy link
Member

@MaeIsBad MaeIsBad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems mostly fine for me, Your call on if you'd like to have another person review this before merging

src/util.rs Outdated
@@ -1,38 +1,26 @@
/// HACK! To reduce code duplication in the generated binary, this macro is used to generate a
/// HACK! To reduce code duplication in the generated binary, this function is used to generate a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code duplication in the generated binary

I don't think this reduces code duplication in the binary, right? Since the struct is a generic this does reduce the amount of source code written, but I don't think it has any impact on the generated code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I clarified the meaning of the comment. If we made the functions in the private module generic, it would lead to code duplication, is what I meant

@WilliamVenner WilliamVenner merged commit 05336d4 into master Dec 20, 2022
@WilliamVenner WilliamVenner deleted the PLATFORM-864/user-story/add-redactable-trait-to-veil-for-manually-redacting-structured-data branch December 20, 2022 14:53
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.

2 participants