Support key rotation for signing keys
Related issue: Support rotation of the signing keys used for c... (#5417 - closed)
This MR allows specifying multiple signing keys separated by comma to the config.
It is added to prevent the following race condition:
- An old signing key is used to create a signature
- GetCommitSignatures is not yet called to store the values in Rails DB
- An admin configures a new signing key
- GetCommitSignatures is called, tries to verify the signatures using the new signing key, fails, and returns
SIGNER_USER
instead ofSIGNER_SYSTEM
.
Now:
- An admin configures a new signing key and the old signing key(s) in the list (newest first)
- GetCommitSignatures is called and iterates over all configured signing keys, tries to verify the signature using each of them, returns SIGNER_SYSTEM if any of the verifications are successful
Edited by Igor Drozdov