Replies: 2 comments 2 replies
-
|
Thanks @ribaraka kicking off the discussion, i went through the proposal and have few questions:
|
Beta Was this translation helpful? Give feedback.
-
|
Now i see what does Roles means in that context. While i don't see this as RBAC, roles here represents more the user's permissions per resource (labels for permissions). It is better to avoid referring to it as RBAC since it usually refers to a different approach. (We can revisit the description of the issue) For session timeout, it make sense to depend the exp of JWT. There is no need for idle time session timeout too, I'm more concerned about what happens for the user when requests starts to get rejected because of expiration of the token. As a user i would expect to that notifies me about the expiration and allows me to get relogin/add a new token. We can have different assumptions how to obtain a new token but user experience is almost the same in all (a page to login & expiration/session timeout). For production setups that automatically injects tokens, we need be able to disable the builtin behaviour. I also lean towards simplifying the approach and have no token → no access. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! Re #6706.
Cadence does not provide built-in access control for its Web. As a result, there is no mechanism for authorized user to interact with UI. While it’s technically possible to modify the code and rebuild the client, this approach is inconvenient and not practical for most users.
Our goal is to deliver out-of-the-box RBAC for the Cadence Web UI, complementing the backend access checks and improving user experience.
As I see it, Cadence handles most access control on the backend. Each API endpoint is associated with a specific permission level (admin, write, read). A domain defines who can read or write by specifying groups in its metadata (e.g., WRITE_GROUPS, READ_GROUPS). This means authorization is enforced server-side. So, it is need to issue a JWT that contains the user’s group memberships. Cadence then checks those groups against the domain’s allowed groups to determine access. For example:
We can have those role respectevly:
• Cadence Admin - Full access to all domains (read and write) - a superuser role with no restrictions. We can have in JWT Claims the Admin:true without adding any group (+ it aligns with backend validation);
• Domain Admin – Full access (read/write) only to specific authorized domain(s) - the Admin value is false, specify name (i.e. group) of domains.
• Domain Viewer- Read-only access to specific authorized domain(s). They can view workflows and histories in those domains but cannot mutate state (no workflow start/terminate, etc.) - the Admin value is false, specify name of domains.
• Public (a user without any authorization other than access to Cadence-web) - here we probably only show domains not restricted by group.
The scope: add UI-layer awareness of Cadence backend auth without inventing new policy surfaces. The Web should only propagate tokens, reflect capabilities in UX (enable/disable/hide). Backend remains the source of truth; every GRPC call is authorized by Cadence.
Cadence-Web doesn’t implement its own auth; it piggybacks on Cadence’s JWT-based authorization:
app/api/auth/token): POST {token} to set an HttpOnly, Secure, SameSite=Lax cadence-authorization cookie; DELETE to clear.UI enforcement:
- Login button to paste jwt token.
- Workflow actions use access to enable/disable with “Not authorized” (for read-only users).
- Domain list hides domains without read access.
- Unauthenticated: show only open domains if no groups are required.
Additional feature:
• Each authenticated user is associated with one or more roles (from the four above). For example, a user could be a Domain Admin for domain X and a Domain Viewer for domain Y.
• Caching: cache user roles in the session to avoid repeated computation. We may also cache the filtered domain list for the user in the session. For example, on login we can compute “allowedDomains” array and store it, so when the UI needs to display domains, it just uses that array (or intersects it with fresh ListDomains results from server). If domains are added/removed, a user might need to relogin to update their view (through the Cookie endpoint).
Beta Was this translation helpful? Give feedback.
All reactions