mirror of
https://github.com/grafana/grafana.git
synced 2025-01-10 08:03:58 -06:00
SigningKeys: Add added_at when creating new signing key (#85060)
This commit is contained in:
parent
2f5be54252
commit
c33bc819bc
@ -177,12 +177,14 @@ func (s *Service) addPrivateKey(ctx context.Context, keyID string, alg jose.Sign
|
||||
return nil, err
|
||||
}
|
||||
|
||||
expiry := time.Now().Add(30 * 24 * time.Hour)
|
||||
now := time.Now()
|
||||
expiry := now.Add(30 * 24 * time.Hour)
|
||||
key, err := s.store.Add(ctx, &signingkeys.SigningKey{
|
||||
KeyID: keyID,
|
||||
PrivateKey: encoded,
|
||||
ExpiresAt: &expiry,
|
||||
Alg: alg,
|
||||
AddedAt: now,
|
||||
}, force)
|
||||
|
||||
if err != nil && !errors.Is(err, signingkeys.ErrSigningKeyAlreadyExists) {
|
||||
|
Loading…
Reference in New Issue
Block a user