MCPcopy Index your code
hub / github.com/coder/coder / shouldRotateKey

Function shouldRotateKey

coderd/cryptokeys/rotate.go:272–279  ·  view source on GitHub ↗
(key database.CryptoKey, keyDuration time.Duration, now time.Time)

Source from the content-addressed store, hash-verified

270}
271
272func shouldRotateKey(key database.CryptoKey, keyDuration time.Duration, now time.Time) bool {
273 // If deletes_at is set, we've already inserted a key.
274 if key.DeletesAt.Valid {
275 return false
276 }
277 expirationTime := key.ExpiresAt(keyDuration)
278 return !now.Add(time.Hour).UTC().Before(expirationTime)
279}
280
281func keysByFeature(keys []database.CryptoKey, features []database.CryptoKeyFeature) (map[database.CryptoKeyFeature][]database.CryptoKey, error) {
282 m := map[database.CryptoKeyFeature][]database.CryptoKey{}

Callers 1

rotateKeysMethod · 0.85

Calls 2

AddMethod · 0.65
ExpiresAtMethod · 0.45

Tested by

no test coverage detected