Repository navigation
Conversation
Reject structured sub values with a claim-specific serde diagnostic instead of a later comma/brace error. Keep scalar and null subject handling unchanged. Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #427.
An object or array in
subis rejected, butTryParsecurrently swallows the type error before serde_json has consumed that value. The resulting error can point at a comma or closing brace instead of identifying the claim.Use a subject-specific visitor so map/sequence values fail immediately with a diagnostic naming the JWT sub claim. This is a diagnostic fix, not support for structured subjects. Scalar/null handling and public JWT decode acceptance stay unchanged; other claims and signature verification are untouched. Plain string subjects can now borrow from the input instead of allocating.
Added regressions for structured subjects in both claim orders, the scalar/null/string cases, and escaped strings. Checked a 432-case signed-token decode matrix against the base: success/rejection categories are unchanged.
Local checks:
rust_cryptoandaws_lc_rs: 114 passed each, including 4 doctests.--all-targets -- -D warnings) with both providers and rustfmt: pass.rust_crypto: 52 passed.Wasm was not tested. The structured-value diagnostic regression fails on the unchanged base.