Repository navigation
Harden OpenID key handling - #32
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The throttle is non-atomic and does not safely handle cache-write failures, allowing issuer call bursts or temporary key-loading outages.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Hardens OpenID JWT verification and adds optional issuer-load throttling.
Changes:
- Enforces JWT/key algorithm matching.
- Refreshes keys only for unknown key IDs.
- Adds configurable key-load throttling and related tests.
| File | Description |
|---|---|
tests/JWT/Algorithms/OpenIdCachingTest.php |
Tests selective refresh behavior. |
tests/JWT/Algorithms/JWKSTest.php |
Tests key and algorithm rejection. |
tests/JWK/Store/OpenIdCachingKeyStoreTest.php |
Tests caching and throttling. |
src/JWT/VerificationFailed.php |
Adds unknown-key failure code. |
src/JWT/Algorithms/OpenIdCaching.php |
Restricts refresh retries. |
src/JWT/Algorithms/JWKS.php |
Enforces key algorithm and classifies missing keys. |
src/JWK/Store/OpenIdCachingKeyStore.php |
Implements minimum load intervals. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ievgeniiskliarenko
marked this pull request as ready for review
October 1, 2026 21:07
evmoroz
approved these changes
Oct 2, 2026
Atomarius
approved these changes
Oct 2, 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.

$minLoadIntervalonOpenIdCachingKeyStorethrottles issuer calls and keeps the cached keys when the issuer is down. Default0keeps the current behaviour.