Skip to content

chore: Optimize rego policy input allocations #6135

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 8 commits into from
Feb 9, 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
Remove duplicated code
  • Loading branch information
Emyrk committed Feb 9, 2023
commit eb5903daa9420cad5bea6cb98eca7fd7bb89622b
11 changes: 0 additions & 11 deletions coderd/rbac/authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,17 +263,6 @@ func (a RegoAuthorizer) authorize(ctx context.Context, subject Subject, action A
return xerrors.Errorf("subject must have a scope")
}

subjRoles, err := subject.Roles.Expand()
if err != nil {
return xerrors.Errorf("expand roles: %w", err)
}

subjScope, err := subject.Scope.Expand()
if err != nil {
return xerrors.Errorf("expand scope: %w", err)
}
var _, _ = subjRoles, subjScope

astV, err := regoInputValue(subject, action, object)
if err != nil {
return xerrors.Errorf("convert input to value: %w", err)
Expand Down