feat: per-application signing algorithm + multi-algorithm VS support#272
Merged
feat: per-application signing algorithm + multi-algorithm VS support#272
Conversation
Each virtual server now has a primary signing algorithm (used to sign new tokens) and an optional list of additional algorithms. All configured algorithms get keys generated, are served via JWKS, and are listed in the discovery document. Key changes: - DB migration: replace signing_algorithm with primary_signing_algorithm and additional_signing_algorithms columns - VirtualServer domain model: new fields + AllSigningAlgorithms() helper - KeyCache keyed by (vsName, algorithm) to avoid cross-algorithm hits - KeyService.GetAllKeys returns all key pairs for a VS - KeyStore.RemoveAllForAlgorithm for bulk cleanup - JWKS handler filters by configured algorithms (DB is authoritative) - PatchVirtualServer generates keys for newly added algorithms immediately - Key rotation job seeds keys for new algorithms and purges orphan keys for algorithms removed from the VS config - E2e tests covering add/remove/change-primary scenarios Signed-off-by: karo <karolinkostial@gmail.com>
Allow each application to declare a signingAlgorithm field that overrides the virtual server's primary algorithm for all tokens issued to that app. Falls back to VS primary when unset. Validation rejects algorithms not configured on the VS, and removing an algorithm from a VS is rejected if any application still references it. Signed-off-by: karo <karolinkostial@gmail.com>
Cover signingAlgorithm on application create/patch/get and primarySigningAlgorithm/additionalSigningAlgorithms on virtual server patch/get. No code changes — fields were already exposed via DTO pass-through. Signed-off-by: karo <karolinkostial@gmail.com>
Signed-off-by: karo <karolinkostial@gmail.com>
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.
Summary
primarySigningAlgorithmandadditionalSigningAlgorithms. Keys are generated for all configured algorithms, served via JWKS (filtered by VS config), and orphaned keys are cleaned up by the rotation job.signingAlgorithmfield. When set, all tokens issued to that app are signed with that algorithm instead of the VS primary. Removing an algorithm from a VS is rejected if any application still references it.Test plan
just cipasses (unit + integration + e2e — verified locally)