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

Use serde(skip) attribute for sensitive fields #2712

Closed
Nutomic opened this issue Feb 7, 2023 · 1 comment · Fixed by #2767
Closed

Use serde(skip) attribute for sensitive fields #2712

Nutomic opened this issue Feb 7, 2023 · 1 comment · Fixed by #2767
Labels

Comments

@Nutomic
Copy link
Member

Nutomic commented Feb 7, 2023

We currently use separate structs like CommunitySafe in order to avoid that sensitive data like federation private keys are exposed in API responses. In fact this seems completely unnecessary, we can remove these "safe" structs and use serde(skip) instead.

Similarly the trait DeletableOrRemovable can be replaced using serde(skip_serializing_if) and a function which checks if the item was removed/deleted.

@dessalines
Copy link
Member

Makes sense.

dessalines added a commit that referenced this issue Feb 25, 2023
- Also change the ViewToVec, to work with non-vector cases. Might be
  necessary in preparation for #2763
- Fixes #2712
Nutomic added a commit that referenced this issue Mar 1, 2023
* Get rid of Safe Views, use serde_skip

- Also change the ViewToVec, to work with non-vector cases. Might be
  necessary in preparation for #2763
- Fixes #2712

* Forgot one safe

---------

Co-authored-by: Nutomic <me@nutomic.com>
dessalines added a commit that referenced this issue Apr 26, 2023
* Get rid of Safe Views, use serde_skip

- Also change the ViewToVec, to work with non-vector cases. Might be
  necessary in preparation for #2763
- Fixes #2712

* Forgot one safe

---------

Co-authored-by: Nutomic <me@nutomic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants