mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: More complete tracing for RBAC functions (#5690)
* chore: More complete tracing for RBAC functions * Add input.json as example rbac input for rego cli The input.json is required to play with the rego cli and debug the policy without golang. It is good to have an example to run the commands in the readme.md * Add span events to capture authorize and prepared results * chore: Add prometheus metrics to rbac authorizer
This commit is contained in:
@@ -71,3 +71,17 @@ Y indicates that the role provides positive permissions, N indicates the role pr
|
||||
| user | \_ | \_ | Y | Y |
|
||||
| | \_ | \_ | N | N |
|
||||
| unauthenticated | \_ | \_ | \_ | N |
|
||||
|
||||
# Testing
|
||||
|
||||
You can test outside of golang by using the `opa` cli.
|
||||
|
||||
**Evaluation**
|
||||
|
||||
opa eval --format=pretty 'false' -d policy.rego -i input.json
|
||||
|
||||
**Partial Evaluation**
|
||||
|
||||
```bash
|
||||
opa eval --partial --format=pretty 'data.authz.allow' -d policy.rego --unknowns input.object.owner --unknowns input.object.org_owner --unknowns input.object.acl_user_list --unknowns input.object.acl_group_list -i input.json
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user