MCPcopy Index your code
hub / github.com/coder/coder / authzSetup

Function authzSetup

enterprise/aiseats/tracker_test.go:28–34  ·  view source on GitHub ↗

authzSetup returns a raw DB for seeding and an RBAC-wrapped DB that enforces real authorization checks.

(t *testing.T)

Source from the content-addressed store, hash-verified

26// authzSetup returns a raw DB for seeding and an RBAC-wrapped DB
27// that enforces real authorization checks.
28func authzSetup(t *testing.T) (rawDB database.Store, authzDB database.Store) {
29 t.Helper()
30 rawDB, _ = dbtestutil.NewDB(t)
31 authz := rbac.NewStrictAuthorizer(prometheus.NewRegistry())
32 authzDB = dbauthz.New(rawDB, authz, slogtest.Make(t, nil), coderdtest.AccessControlStorePointer())
33 return rawDB, authzDB
34}
35
36func TestSeatTrackerDB(t *testing.T) {
37 t.Parallel()

Callers 1

TestSeatTrackerDBFunction · 0.85

Calls 5

NewDBFunction · 0.92
NewStrictAuthorizerFunction · 0.92
NewFunction · 0.92
HelperMethod · 0.65

Tested by

no test coverage detected