feat(signer): support EdDSA for the local token signer#4831
Draft
somaz94 wants to merge 1 commit into
Draft
Conversation
Signed-off-by: somaz <genius5711@gmail.com>
somaz94
added a commit
to somaz94/somaz94
that referenced
this pull request
Jun 12, 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.
Overview
Adds EdDSA (Ed25519) as a signing algorithm for the local token signer, completing #4442. The local signer already supported RS256 and ES256, so this fills in the remaining algorithm requested in the issue.
What this PR does / why we need it
EdDSA produces much smaller signatures than RS256, which matters for setups with a tight token-size budget — the issue describes Argo CD storing tokens as cookies under a 4 KB limit.
server/signer/rotation.go: generate an Ed25519 key when the configured algorithm isEdDSA.server/signer/utils.goalready maps Ed25519 keys tojose.EdDSAandsignPayloadis algorithm-generic, so signing, JWKS publication, and the discoveryid_token_signing_alg_values_supportedvalue already work once a key is generated.server/signer/local.goandcmd/dex/config.go: acceptEdDSAin the local-signer config validation.server/oauth2.go: addEdDSA → SHA-512tohashForSigAlgsoat_hash/c_hashcan be computed for EdDSA id_tokens (Ed25519 uses SHA-512 internally).It also fixes a verifier gap that EdDSA exposes: the
id_token_hint,/userinfo, and/token/introspectverifiers buildoidc.NewVerifierwith anoidc.Configthat does not setSupportedSigningAlgs. go-oidc then defaults toRS256only and rejects ES256/EdDSA Dex-issued tokens withmalformed jwtbeforesignerKeySet.VerifySignatureever runs. These three sites now pass the same algorithm listsignerKeySetalready uses, extracted into a sharedsupportedSigningAlgs.Closes #4442
Special notes for your reviewer
TestRotationStrategyForAlgorithm.TestAccessTokenHashEdDSAfor theat_hashmapping.TestSignerKeySetWithEdDSALocalSignerand an end-to-endTestValidateIDTokenHintEdDSAthat drives the real verifier path. The latter fails against the unpatched verifier withoidc: malformed jwt: unexpected signature algorithm "EdDSA"; expected ["RS256"].go test ./server/... ./cmd/...,golangci-lint run, andgofmt -lare all clean. No new dependencies (Ed25519 is stdlib).