fix(sdjwt): require terminal aud and nonce claims - #342
Open
Silentpartnercoding wants to merge 4 commits into
Open
fix(sdjwt): require terminal aud and nonce claims#342Silentpartnercoding wants to merge 4 commits into
Silentpartnercoding wants to merge 4 commits into
Conversation
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.
Description
Terminal KB-SD-JWT verification now rejects an absent, empty, or non-string
audornonceclaim even when the caller does not supply an expected value.The existing exact-match checks remain unchanged when expectations are given.
RFC 9901 section 4.3 requires
audas a single string andnonceas astring. Delegate SD-JWT section 5.1.4 requires KB-SD-JWTs to conform to the
KB-JWT requirements except for its listed changes, none of which relax these
claims. This also matches
kb_sd_jwt.create(), which already rejects emptyvalues.
This is a structural-conformance check only. When no expectations are given,
presence does not establish that the audience is the correct receiver or that
the nonce is fresh; callers still need to provide expectations for those
semantic checks.
This change also:
audandmissing
noncewith both expectations left at their defaults, covers bothaccepted terminal
typspellings, and rejects present-but-empty values;terminal claims as optional;
modified files.
Validation
17 passed—kb_sd_jwt_tests.py192 passed, 2 deselected— full Python SDK suite excluding two failuresreproduced unchanged on upstream
main:kb_sd_jwt_intermediate_tests.py::test_verify_rejects_aud_mismatchandkb_sd_jwt_intermediate_tests.py::test_verify_rejects_nonce_mismatchgit diff --checkpasses.Baseline CI note
The repository-wide
Lint Code Basejob currently fails in unchangedcode/web-client/**anddocs/assets/**files (75 existing Biome errors pluswarnings). The same required job is red on related PRs #313 and #326. This PR
does not change the lint policy or those unrelated files; its changed-file
Ruff and Markdown checks pass, and the separate repository spellcheck job is
green.
CONTRIBUTINGguide.Fixes #319 🦕