Skip to content

Commit

Permalink
SigningKeys: Add added_at when creating new signing key (#85060)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalleep authored and ashharrison90 committed Mar 26, 2024
1 parent 0eb499a commit b5f8c34
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/services/signingkeys/signingkeysimpl/service.go
Expand Up @@ -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) {
Expand Down

0 comments on commit b5f8c34

Please sign in to comment.