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

Avoid exposure of type names by QueryRejection #1171

Merged
merged 6 commits into from
Jul 18, 2022

Conversation

simon-amadeus
Copy link
Contributor

Motivation

This is neccessary, to avoid public exposure of implementation details
by the default error message if the extractor fails to deserialize
the query parameters into the target type.

Solution

Removing the type_name field from FailedToDeserializeQueryString.

This is neccessary, to avoid public exposure of implementation details
by the default error message if the extractor fails to deserialize
the query parameters into the target type.
@davidpdrsn
Copy link
Member

Thanks!

Wanna add a note to the changelog as well?

axum/src/extract/query.rs Outdated Show resolved Hide resolved
axum/src/form.rs Outdated Show resolved Hide resolved
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

# Unreleased

- **fixed:** `QueryRejection` response exposes type names through public interface ([#1171])
Copy link
Member

Choose a reason for hiding this comment

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

This almost sounds like the fix was to expose internal types. Maybe this is more clear?

Suggested change
- **fixed:** `QueryRejection` response exposes type names through public interface ([#1171])
- **fixed:** Don't expose internal type names in `QueryRejection` responses ([#1171])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

huh.. I guess you are right.

Copy link
Member

@davidpdrsn davidpdrsn left a comment

Choose a reason for hiding this comment

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

Thanks!

@davidpdrsn davidpdrsn enabled auto-merge (squash) July 18, 2022 13:29
@davidpdrsn davidpdrsn merged commit 73041c8 into tokio-rs:main Jul 18, 2022
@simon-amadeus simon-amadeus deleted the improve-queryrejection-error branch July 18, 2022 13:44
davidpdrsn added a commit that referenced this pull request Jul 25, 2022
Backports these PRs to 0.5.x

- #1192
- #1185
- #1178
- #1171
@davidpdrsn davidpdrsn mentioned this pull request Jul 25, 2022
davidpdrsn added a commit that referenced this pull request Jul 25, 2022
Backports these PRs to 0.5.x

- #1192
- #1185
- #1178
- #1171
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