mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
feat: Add initial AuthzQuerier implementation (#5919)
feat: Add initial AuthzQuerier implementation - Adds package database/dbauthz that adds a database.Store implementation where each method goes through AuthZ checks - Implements all database.Store methods on AuthzQuerier - Updates and fixes unit tests where required - Updates coderd initialization to use AuthzQuerier if codersdk.ExperimentAuthzQuerier is enabled
This commit is contained in:
@ -12,6 +12,7 @@ import (
|
||||
"cdr.dev/slog"
|
||||
"github.com/coder/coder/coderd/autobuild/schedule"
|
||||
"github.com/coder/coder/coderd/database"
|
||||
"github.com/coder/coder/coderd/database/dbauthz"
|
||||
)
|
||||
|
||||
// Executor automatically starts or stops workspaces.
|
||||
@ -33,7 +34,8 @@ type Stats struct {
|
||||
// New returns a new autobuild executor.
|
||||
func New(ctx context.Context, db database.Store, log slog.Logger, tick <-chan time.Time) *Executor {
|
||||
le := &Executor{
|
||||
ctx: ctx,
|
||||
//nolint:gocritic // TODO: make an autostart role instead of using System
|
||||
ctx: dbauthz.AsSystem(ctx),
|
||||
db: db,
|
||||
tick: tick,
|
||||
log: log,
|
||||
|
Reference in New Issue
Block a user