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 hidden fields option to sanitizing #4914

Closed
wants to merge 5 commits into from
Closed

Add hidden fields option to sanitizing #4914

wants to merge 5 commits into from

Conversation

lambertkevin
Copy link

@lambertkevin lambertkevin commented Jan 6, 2020

Description of what you did:

Added a hiddenFields attribute to the response config in order to sanitize entities globally. It will help preventing default values from appearing on every responses of every entities. (e.g. __v or timestamps when using mongodb).

Fix #4342

My PR is a:

  • 💥 Breaking change
  • 🐛 Bug fix
  • 💅 Enhancement
  • 🚀 New feature

Main update on the:

  • Admin
  • Documentation
  • Framework
  • Plugin

Manual testing done on the following databases:

  • Not applicable
  • MongoDB
  • MySQL
  • Postgres
  • SQLite

derrickmehaffy
derrickmehaffy previously approved these changes Jan 7, 2020
Copy link
Member

@derrickmehaffy derrickmehaffy left a comment

Choose a reason for hiding this comment

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

LGTM this is a nice addition thank you 👍

@derrickmehaffy
Copy link
Member

derrickmehaffy commented Jan 7, 2020

As a side note @lambertkevin because I know the Strapi team will say it, can you please add documentation for this?

https://github.com/strapi/strapi/blob/master/docs/3.0.0-beta.x/concepts/configurations.md

@alexandrebodin
Copy link
Member

THanks for your contribution. I’ll take a look at i later.

@alexandrebodin
Copy link
Member

The hiddenFields param shouldn't be set on the configuration files by default. A good documentation with an example would work just fine.

@alexandrebodin alexandrebodin added pr: 💅 Enhancement source: core:content-manager Source is core/content-manager package labels Jan 9, 2020
@lambertkevin
Copy link
Author

@alexandrebodin Ok removed the default configs and added example to the documentation

@alexandrebodin
Copy link
Member

Thanks for the update. I meant remove the hiddenFields key from the files completly.

@@ -8,5 +8,6 @@
"poweredBy": {
"enabled": true,
"value": "Strapi <strapi.io>"
}
},
"hiddenFields": []
Copy link
Member

Choose a reason for hiding this comment

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

Remove this hiddenFields from the config

@strapi strapi deleted a comment from derrickmehaffy Jan 28, 2020
@alexandrebodin
Copy link
Member

Hi @lambertkevin do you think you will be able to make the last changes ? Thanks !

@alexandrebodin
Copy link
Member

Hi @lambertkevin I'm going to close this PR for now until you can make the changes ;).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source: core:content-manager Source is core/content-manager package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide / make private timestamps, _id, id and __v with MongoDB
4 participants