-
-
Notifications
You must be signed in to change notification settings - Fork 378
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(Pydantic): honor hide_input_in_errors in throwing validation exceptions #3843
feat(Pydantic): honor hide_input_in_errors in throwing validation exceptions #3843
Conversation
b348dc7
to
49070fc
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3843 +/- ##
=======================================
Coverage 98.42% 98.42%
=======================================
Files 333 333
Lines 15346 15348 +2
Branches 1694 1694
=======================================
+ Hits 15105 15107 +2
Misses 111 111
Partials 130 130 ☔ View full report in Codecov by Sentry. |
4b6e70a
to
17c0944
Compare
…y that cannot be None
17c0944
to
db892ce
Compare
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3843 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@all-contributors add @charles-dyfis-net for code |
I've put up a pull request to add @charles-dyfis-net! 🎉 |
Description
Pydantic's
BaseModel
supports configuration to hide data values when throwing exceptions, via settinghide_input_in_errors
-- see https://docs.pydantic.dev/2.0/api/config/#pydantic.config.ConfigDict.hide_input_in_errors and https://docs.pydantic.dev/latest/usage/model_config/#hide-input-in-errors (the value is also in 2.0, but not linkable in the non-latest
version of the documentation build).At present, Litestar does not honor this configuration when generating exceptions for validation errors, which can lead to sensitive data leaking into logs.