-
Notifications
You must be signed in to change notification settings - Fork 109
Description
Describe the bug
When migrating from a manual MAS deployment to the ESS Helm chart, there is no way to configure custom kid (Key ID) values for the signing keys. The KIDs are hardcoded in config-overrides.yaml.tpl to static values (rsa, prime256v1, secp256k1, secp384r1):
- kid: rsa
key_file: /secrets/...
- kid: prime256v1
key_file: /secrets/...While the key material itself can be provided via matrixAuthenticationService.privateKeys.rsa.secretKey (or .value), the KID cannot be overridden. This breaks migration from existing MAS deployments where keys were registered with different KIDs, as existing tokens/sessions become invalid when the KID changes.
The MAS documentation states:
A JWK Key ID is automatically derived from each key. To override this default, set
kidto a custom value. Thekidcan be any case-sensitive string value as long as it is unique to this list; a key'skidvalue must be stable across restarts.
To Reproduce
- Have an existing manual MAS deployment with signing keys using auto-derived or custom KIDs
- Migrate to the ESS Helm chart, providing the same key material via
matrixAuthenticationService.privateKeys.rsa - MAS starts with hardcoded
kid: rsainstead of the original KID - Previously issued tokens/sessions fail validation because the KID in the JWT header no longer matches any known key
Expected behavior
The Helm chart should allow configuring custom kid values for each signing key, e.g.:
matrixAuthenticationService:
privateKeys:
rsa:
kid: "my-existing-kid" # optional, defaults to "rsa" for backwards compatibility
secret: existing-secret
secretKey: key-in-secretThis would enable seamless migration from manual deployments by preserving the original KID values.
Additional context
- This is a migration blocker for anyone moving from a manual MAS deployment to the ESS Helm chart with pre-existing signing keys.
- The
values.yamlprivateKeyssection currently only supportsvalue,secret, andsecretKey— there is nokidfield. - A simple fix would be to allow an optional
kidoverride per key invalues.yamland use it in the template with a fallback to the current hardcoded values.