Commit 5ed8cdb
committed
RBAC plugin: authenticateAuthorize* accepts array resources
Widen check.resource on the convenience methods to RbacResource |
RbacResource[] so they match RbacAbility.can. Previously the interface
declared only RbacResource on these methods, which left an
inconsistency — anyone wanting to pass an array of resources had to
call authenticateBearer + ability.can manually instead of using the
convenience method.
Surfaced when reviewing the cloud enterprise controller (TRI-8720),
which had unilaterally widened its implementation to RbacResource[]
and would have failed type-check if any caller routed an array
through the typed interface.
Updated:
- packages/plugins/src/rbac.ts — RoleBaseAccessController interface.
- internal-packages/rbac/src/fallback.ts — RoleBaseAccessFallback
matches.
- LazyController already uses Parameters<...> and tracks the
interface, so it picks up the change automatically.
@trigger.dev/plugins gets a minor bump (changeset added).
Verification:
- pnpm run typecheck across @trigger.dev/plugins, @trigger.dev/rbac,
webapp — clean.
- pnpm run test --filter @internal/rbac — 31 unit tests pass.
- e2e suite unaffected (no signature change at runtime — pure type
widening).1 parent a9cb0e7 commit 5ed8cdb
3 files changed
Lines changed: 12 additions & 5 deletions
File tree
- .changeset
- internal-packages/rbac/src
- packages/plugins/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | | - | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | | - | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
0 commit comments