Skip to content

chore: add x-authz-checks debug header when running in dev mode #16873

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 7 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
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
fixem
  • Loading branch information
aslilac committed Apr 9, 2025
commit d59ecbe8592b950f33ac101fe87974236b54c71c
6 changes: 3 additions & 3 deletions coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ func New(options *Options) *API {

if options.Authorizer == nil {
options.Authorizer = rbac.NewCachingAuthorizer(options.PrometheusRegistry)
}
if buildinfo.IsDev() {
options.Authorizer = rbac.Recorder(options.Authorizer)
if buildinfo.IsDev() {
options.Authorizer = rbac.Recorder(options.Authorizer)
}
Comment on lines +317 to +319
Copy link
Member

Choose a reason for hiding this comment

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

This will actually run on dogfood as well. Is this what we want?

Copy link
Member Author

Choose a reason for hiding this comment

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

yup! makes for a nice quick resource to check

}

if options.AccessControlStore == nil {
Expand Down
3 changes: 3 additions & 0 deletions enterprise/coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
}
if options.Options.Authorizer == nil {
options.Options.Authorizer = rbac.NewCachingAuthorizer(options.PrometheusRegistry)
if buildinfo.IsDev() {
options.Authorizer = rbac.Recorder(options.Authorizer)
}
}
if options.ReplicaErrorGracePeriod == 0 {
// This will prevent the error from being shown for a minute
Expand Down
Loading