Skip to content

feat(coder): add authz_querier experiment #5858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
coderdtest: wire up authz_querier
  • Loading branch information
johnstcn committed Jan 25, 2023
commit 2638aa35d355078f119fd0a2ce01d95845368c20
9 changes: 9 additions & 0 deletions coderd/coderdtest/coderdtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"net/http"
"net/http/httptest"
"net/url"
"os"
"regexp"
"strconv"
"strings"
Expand Down Expand Up @@ -54,6 +55,7 @@ import (
"github.com/coder/coder/cli/deployment"
"github.com/coder/coder/coderd"
"github.com/coder/coder/coderd/audit"
"github.com/coder/coder/coderd/authzquery"
"github.com/coder/coder/coderd/autobuild/executor"
"github.com/coder/coder/coderd/awsidentity"
"github.com/coder/coder/coderd/database"
Expand Down Expand Up @@ -176,6 +178,13 @@ func NewOptions(t *testing.T, options *Options) (func(http.Handler), context.Can
if options.Database == nil {
options.Database, options.Pubsub = dbtestutil.NewDB(t)
}
// TODO: remove this once we're ready to enable authz querier by default.
if strings.Contains(os.Getenv("CODER_EXPERIMENTS_TEST"), "authz_querier") {
if options.Authorizer != nil {
options.Authorizer = &RecordingAuthorizer{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original authorizer is needed for some routes like app execution, but we can figure that out in authzquerier branch.

}
options.Database = authzquery.NewAuthzQuerier(options.Database, options.Authorizer)
}
if options.DeploymentConfig == nil {
options.DeploymentConfig = DeploymentConfig(t)
}
Expand Down