mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add cache abstraction for fetching signing keys (#14777)
- Adds the database implementation for fetching and caching keys used for JWT signing. It's been merged into the `keyrotate` pkg and renamed to `cryptokeys` since they're coupled concepts.
This commit is contained in:
@@ -659,3 +659,17 @@ func Organization(organization database.Organization) codersdk.Organization {
|
||||
IsDefault: organization.IsDefault,
|
||||
}
|
||||
}
|
||||
|
||||
func CryptoKeys(keys []database.CryptoKey) []codersdk.CryptoKey {
|
||||
return List(keys, CryptoKey)
|
||||
}
|
||||
|
||||
func CryptoKey(key database.CryptoKey) codersdk.CryptoKey {
|
||||
return codersdk.CryptoKey{
|
||||
Feature: codersdk.CryptoKeyFeature(key.Feature),
|
||||
Sequence: key.Sequence,
|
||||
StartsAt: key.StartsAt,
|
||||
DeletesAt: key.DeletesAt.Time,
|
||||
Secret: key.Secret.String,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user