fix: handle first key rotation on newly created instance (#3118)

This commit is contained in:
Livio Amstutz
2022-01-28 09:24:34 +01:00
committed by GitHub
parent e99b7f4972
commit 990be687c0
2 changed files with 11 additions and 4 deletions

View File

@@ -219,7 +219,10 @@ func (q *Queries) ActivePrivateSigningKey(ctx context.Context, t time.Time) (*Pr
return nil, err
}
keys.LatestSequence, err = q.latestSequence(ctx, keyTable)
return keys, err
if !errors.IsNotFound(err) {
return keys, err
}
return keys, nil
}
func preparePublicKeysQuery() (sq.SelectBuilder, func(*sql.Rows) (*PublicKeys, error)) {