Skip to content

Produce fixed-sized EC JWKs in tests#7940

Merged
maxtropets merged 1 commit into
microsoft:mainfrom
maxtropets:f/fixup-jwk-after-constitution-hardening
Jun 15, 2026
Merged

Produce fixed-sized EC JWKs in tests#7940
maxtropets merged 1 commit into
microsoft:mainfrom
maxtropets:f/fixup-jwk-after-constitution-hardening

Conversation

@maxtropets

@maxtropets maxtropets commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

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.

@maxtropets maxtropets self-assigned this Jun 15, 2026
Copilot AI review requested due to automatic review settings June 15, 2026 11:21
@maxtropets maxtropets requested a review from a team as a code owner June 15, 2026 11:21
@maxtropets maxtropets changed the title Produce fixed-sized x&y Produce fixed-sized EC JWKs in tests Jun 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/y coordinates 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.

Comment thread tests/infra/jwt_issuer.py
@maxtropets maxtropets merged commit b9c7edd into microsoft:main Jun 15, 2026
19 checks passed
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