Produce fixed-sized EC JWKs in tests#7940
Merged
maxtropets merged 1 commit intoJun 15, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Python JWT issuer test utilities to emit ES256 JWK x/y coordinates as fixed-width (32-byte) base64url values, and adds a regression assertion to ensure leading-zero coordinates are preserved. This aligns the test-generated JWKS with the stricter constitution validation introduced in #7924 (which rejects truncated coordinates).
Changes:
- Pad ES256 JWK
x/ycoordinates to a fixed 32-byte width before base64url encoding. - Add a targeted test assertion using fixed EC public numbers to verify leading-zero preservation and fixed-width output.
Custom instructions used:
.github/copilot-instructions.md.github/instructions/reviewing.instructions.md
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/js-custom-authorization/custom_authorization.py |
Adds a regression assertion ensuring ES256 raw-key JWKS coordinates are emitted at fixed width (including leading-zero cases). |
tests/infra/jwt_issuer.py |
Updates JWK numeric encoding helper usage so ES256 x/y are encoded as fixed 32-byte values. |
achamayou
approved these changes
Jun 15, 2026
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.
Failure in https://github.com/microsoft/CCF/actions/runs/27386294910/job/80933917383
In #7924, a constitution hardening took place, after which truncated keys are no longer accepted, but we sometimes emit them in tests.
This PR makes key encoding deterministic, as well as adds a quick test-check.