Skip to content

Commit 93603a2

Browse files
committed
Refactor dbCache to remove feature validation
1 parent 54214e2 commit 93603a2

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

coderd/cryptokeys/dbkeycache.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,33 +77,18 @@ func newDBCache(logger slog.Logger, db database.Store, feature database.CryptoKe
7777
}
7878

7979
func (d *dbCache) EncryptingKey(ctx context.Context) (id string, key interface{}, err error) {
80-
if !isEncryptionKeyFeature(d.feature) {
81-
return "", nil, xerrors.Errorf("invalid feature: %s", d.feature)
82-
}
8380
return d.latest(ctx)
8481
}
8582

8683
func (d *dbCache) DecryptingKey(ctx context.Context, id string) (key interface{}, err error) {
87-
if !isEncryptionKeyFeature(d.feature) {
88-
return nil, xerrors.Errorf("invalid feature: %s", d.feature)
89-
}
90-
9184
return d.sequence(ctx, id)
9285
}
9386

9487
func (d *dbCache) SigningKey(ctx context.Context) (id string, key interface{}, err error) {
95-
if !isSigningKeyFeature(d.feature) {
96-
return "", nil, xerrors.Errorf("invalid feature: %s", d.feature)
97-
}
98-
9988
return d.latest(ctx)
10089
}
10190

10291
func (d *dbCache) VerifyingKey(ctx context.Context, id string) (key interface{}, err error) {
103-
if !isSigningKeyFeature(d.feature) {
104-
return nil, xerrors.Errorf("invalid feature: %s", d.feature)
105-
}
106-
10792
return d.sequence(ctx, id)
10893
}
10994

0 commit comments

Comments
 (0)