Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita8e7140

Browse files
committed
dbauthz
1 parent386c443 commita8e7140

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

‎coderd/cryptokeys/keycache.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"context"
55

66
"golang.org/x/xerrors"
7+
8+
"github.com/coder/coder/v2/coderd/database"
79
)
810

911
varErrKeyNotFound=xerrors.New("key not found")
@@ -12,6 +14,6 @@ var ErrKeyInvalid = xerrors.New("key is invalid for use")
1214

1315
// Keycache provides an abstraction for fetching signing keys.
1416
typeKeycacheinterface {
15-
Latest(ctx context.Context) ([]byte,error)
16-
Version(ctx context.Context,sequenceint32) ([]byte,error)
17+
Latest(ctx context.Context) (database.CryptoKey,error)
18+
Version(ctx context.Context,sequenceint32) (database.CryptoKey,error)
1719
}

‎coderd/database/dbauthz/dbauthz_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2302,6 +2302,10 @@ func (s *MethodTestSuite) TestCryptoKeys() {
23022302
DeletesAt: sql.NullTime{Time:time.Now(),Valid:true},
23032303
}).Asserts(rbac.ResourceCryptoKey,policy.ActionUpdate)
23042304
}))
2305+
s.Run("GetCryptoKeysByFeature",s.Subtest(func(db database.Store,check*expects) {
2306+
check.Args(database.CryptoKeyFeatureWorkspaceApps).
2307+
Asserts(rbac.ResourceCryptoKey,policy.ActionRead)
2308+
}))
23052309
}
23062310

23072311
func (s*MethodTestSuite)TestSystemFunctions() {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp