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

Function minStartsAt

coderd/cryptokeys/rotate.go:298–305  ·  view source on GitHub ↗

minStartsAt ensures the minimum starts_at time we use for a new key is no less than 3*the default rotation interval.

(key database.CryptoKey, now time.Time, keyDuration time.Duration)

Source from the content-addressed store, hash-verified

296// minStartsAt ensures the minimum starts_at time we use for a new
297// key is no less than 3*the default rotation interval.
298func minStartsAt(key database.CryptoKey, now time.Time, keyDuration time.Duration) time.Time {
299 expiresAt := key.ExpiresAt(keyDuration)
300 minStartsAt := now.Add(3 * defaultRotationInterval)
301 if expiresAt.Before(minStartsAt) {
302 return minStartsAt
303 }
304 return expiresAt
305}

Callers 1

rotateKeyMethod · 0.85

Calls 2

AddMethod · 0.65
ExpiresAtMethod · 0.45

Tested by

no test coverage detected