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
Linting
  • Loading branch information
Emyrk committed Feb 9, 2023
commit 22629e6b313e151f52b24f79e7f106cb3e5fedda
5 changes: 4 additions & 1 deletion coderd/rbac/astvalue.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ func (role Role) regoValue() ast.Value {
}

func (s Scope) regoValue() ast.Value {
r := s.Role.regoValue().(ast.Object)
r, ok := s.Role.regoValue().(ast.Object)
if !ok {
panic("developer error: role is not an object")
}
r.Insert(
ast.StringTerm("allow_list"),
ast.NewTerm(regoSliceString(s.AllowIDList...)),
Expand Down