Skip to content

Syk/only one jwk at a time - #102

Merged
itsoyou merged 1 commit into
mainfrom
syk/only-one-jwk-at-a-time
Sep 4, 2026
Merged

itsoyou merged 1 commit into
mainfrom
syk/only-one-jwk-at-a-time

Conversation

@itsoyou

@itsoyou itsoyou commented Sep 1, 2026

Copy link
Copy Markdown
Member

SYN-117

rendered


Note

Medium Risk
Stricter config validation can break deployments that previously set multiple JWK options; behavior is clearer but may require config cleanup on upgrade.

Overview
Enforces mutually exclusive JWK configuration so deployers cannot specify overlapping key sources that were previously ambiguous.

Runtime validation in EPaConfig and JwtValidationConfig now requires exactly one of: inline JWK/JWKSet, PEM file path, or JWKS URL. Setting two or more (e.g. jwk_set plus jwks_endpoint, or enc_jwk plus enc_jwk_file) raises a ValidationError at startup instead of silently picking one path.

Documentation in README.md is reorganized (JWT/OIDC/ePA sections, shared “Types” for validators/paths/auth) and states these exclusivity rules explicitly, including new JwtConfig / OIDCConfig tables and check_external_id on OAuth.

Tests cover invalid combinations for ePA encryption keys and signing/JWKS sources.

Reviewed by Cursor Bugbot for commit 95c433a. Bugbot is set up for automated code reviews on this repo. Configure here.

@itsoyou
itsoyou requested a review from a team as a code owner September 1, 2026 13:59
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.75000% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.26%. Comparing base (75ea954) to head (62451f5).

Files with missing lines Patch % Lines
synapse_token_authenticator/config/epa.py 70.00% 2 Missing and 1 partial ⚠️
synapse_token_authenticator/config/oauth.py 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #102      +/-   ##
==========================================
- Coverage   77.71%   77.26%   -0.46%     
==========================================
  Files          13       13              
  Lines         875      884       +9     
  Branches      157      160       +3     
==========================================
+ Hits          680      683       +3     
- Misses        123      126       +3     
- Partials       72       75       +3     
Files with missing lines Coverage Δ
synapse_token_authenticator/config/oauth.py 81.81% <66.66%> (-1.36%) ⬇️
synapse_token_authenticator/config/epa.py 72.41% <70.00%> (-2.90%) ⬇️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75ea954...62451f5. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread tests/test_config/test_epa.py
Comment thread tests/test_config/test_epa.py Outdated
@itsoyou
itsoyou force-pushed the syk/only-one-jwk-at-a-time branch from b77c8e1 to 95c433a Compare September 2, 2026 11:51
@itsoyou

itsoyou commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

I will scope out the Docs change that is unrelated to jwk/enc_jwk topic into separate PR.

Comment thread README.md Outdated

@FrenchGithubUser FrenchGithubUser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good to me, might want to squash before merging :)

@itsoyou
itsoyou force-pushed the syk/refactor-config branch from 8e4cdfd to 12545c3 Compare September 4, 2026 12:36
Base automatically changed from syk/refactor-config to main September 4, 2026 12:50
@itsoyou
itsoyou dismissed FrenchGithubUser’s stale review September 4, 2026 12:50

The base branch was changed.

@itsoyou
itsoyou force-pushed the syk/only-one-jwk-at-a-time branch from 5b536b9 to 62451f5 Compare September 4, 2026 13:14
@itsoyou
itsoyou added this pull request to the merge queue Sep 4, 2026
Merged via the queue into main with commit d65ef91 Sep 4, 2026
5 of 6 checks passed
@itsoyou
itsoyou deleted the syk/only-one-jwk-at-a-time branch September 4, 2026 13:27
@jason-famedly jason-famedly mentioned this pull request Sep 16, 2026
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