Add multi-key JWKS rotation for LTI 1.3 signing keys#8056
Open
donny-wong wants to merge 4 commits into
Open
Conversation
donny-wong
force-pushed
the
quercus_integration_lti_jwks_key_rotation
branch
from
July 13, 2026 23:11
0757c80 to
fa67474
Compare
Collaborator
Coverage Report for CI Build 29976878820Coverage increased (+0.04%) to 90.45%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
Naragod
requested changes
Jul 16, 2026
Naragod
left a comment
Contributor
There was a problem hiding this comment.
Hey Donny, this is completely new to me, which took me a while to review with the assistance of Claude. I left a few comments based on my understanding of the code and what we are trying to do.
donny-wong
force-pushed
the
quercus_integration_lti_jwks_key_rotation
branch
from
July 23, 2026 03:23
2dd6d6c to
0cfd0bc
Compare
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.
Proposed Changes
(Describe your changes here. Also describe the motivation for your changes: what problem do they solve, or how do they improve the application or codebase? If this pull request fixes an open issue, use a keyword to link this pull request to the issue.)
Summary
MarkUs signs LTI 1.3
client_credentialsassertions with a single RSA key and publishes exactly one key at/lti_deployments/public_jwk. Rotating it is therefore a hard swap — the outgoing key leaves the published JWKS the moment it stops signing, so assertions already in flight fail verification.This adds multi-key support with an overlap window, so keys can be rotated without disrupting grade passback (AGS) or roster sync (NRPS).
What changed
LtiKeyStore(new) manages a directory of timestamped PEMs:Settings.lti.rotation.current_key).public_jwkspublishes every key present, so a retired key still verifies until pruned.prune!removes keys retired longer ago than the overlap window, and never removes the current signer.LtiClient#get_oauth_tokenandLtiDeploymentsController#public_jwknow both go through the store, so signing and publication share one source of truth.LtiKeyMaintenanceJobruns daily viaresque-schedulerwhen enabled: rotates only if the current key is pastmax_age_days, prunes keys pastoverlap_days. Both are idempotent.Rake tasks remain for manual use, including compromise response:
markus:lti_key,markus:rotate_if_due,markus:prune_keys.Screenshots of your changes (if applicable)
Type of Change
(Write an
Xor a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]into a[x]in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
(Include any questions or comments you have regarding your changes.)