Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 201347f

Browse files
committed
Refactor key verification with db2sdk conversion
1 parent 3e723ce commit 201347f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

coderd/cryptokeys/dbkeycache.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ func (d *DBCache) Latest(ctx context.Context) (codersdk.CryptoKey, error) {
113113

114114
now := d.clock.Now().UTC()
115115
if latest.CanSign(now) {
116-
return checkKey(latest, now)
116+
return db2sdk.CryptoKey(latest), nil
117117
}
118118

119119
d.cacheMu.Lock()
120120
defer d.cacheMu.Unlock()
121121

122122
if latest.CanSign(now) {
123-
return checkKey(latest, now)
123+
return db2sdk.CryptoKey(latest), nil
124124
}
125125

126126
// Refetch all keys for this feature so we can find the latest valid key.
@@ -139,7 +139,7 @@ func (d *DBCache) Latest(ctx context.Context) (codersdk.CryptoKey, error) {
139139

140140
d.cache, d.latestKey = cache, latest
141141

142-
return checkKey(latest, now)
142+
return db2sdk.CryptoKey(latest), nil
143143
}
144144

145145
func (d *DBCache) refresh(ctx context.Context) {

0 commit comments

Comments
 (0)