Skip to content

Commit f924578

Browse files
committed
Include workspace agent token example in rbac readme
1 parent 4d66a03 commit f924578

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

coderd/rbac/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,19 @@ an unbounded set of resource IDs that be added to an "allow_list", as the number
8787

8888
The use case for specifying this type of permission in a role is limited, and does not justify the extra cost. To solve this for the remaining cases (eg. workspace agent tokens), we can apply an `allow_list` on a scope. For most cases, the `allow_list` will just be `["*"]` which means the scope is allowed to be applied to any resource. This adds negligible cost to the role evaluation logic and 0 cost to partial evaluations.
8989

90+
Example of a scope for a workspace agent token, using an `allow_list` containing a single resource id.
91+
```javascript
92+
"scope": {
93+
"name": "workspace_agent",
94+
"display_name": "Workspace_Agent",
95+
// The ID of the given workspace the agent token corrolates to.
96+
"allow_list": ["10d03e62-7703-4df5-a358-4f76577d4e2f"],
97+
"site": [/* ... perms ... */],
98+
"org": {/* ... perms ... */},
99+
"user": [/* ... perms ... */]
100+
}
101+
```
102+
90103
# Testing
91104

92105
You can test outside of golang by using the `opa` cli.

0 commit comments

Comments
 (0)