You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -100,7 +101,7 @@ The middleware is responsible for calling the target function (e.g. via `trigger
100
101
101
102
## RBAC
102
103
103
-
When the `rbac` block is present in a `WorkerModule` entry, that listener enforces role-based access control: authentication on connect, function-level authorization, and trigger registration controls.
104
+
When the `rbac` block is present in a `WorkerModule` entry, that listener enforces role-based access control: authentication on connect, function invocation authorization, and gated function/trigger registration.
104
105
105
106
<Info title="How-to guidance">
106
107
For step-by-step instructions on enabling RBAC, writing auth and middleware functions, and connecting workers, see [Worker RBAC](../how-to/worker-rbac).
@@ -142,6 +143,10 @@ On connection to an RBAC port, the optional auth function is called with the req
142
143
Function ID to invoke when a worker attempts to register a trigger type. Receives the trigger type details and auth context. Must return `true` to allow the registration.
Function ID to invoke when a worker attempts to register a function. Receives the function details and auth context. Must return `true` to allow the registration. See [Function Registration](#function-registration).
148
+
</ResponseField>
149
+
145
150
### Function Filters
146
151
147
152
#### Wildcard Match
@@ -207,6 +212,9 @@ The auth function must return:
The context from the auth result for this session.
255
+
</ResponseField>
256
+
</Expandable>
257
+
258
+
If either check fails, the registration is silently dropped.
259
+
260
+
#### Trigger Type Registration
261
+
262
+
A worker can register a trigger type if **both** conditions are met:
228
263
1. `allow_trigger_type_registration` is `true` in the auth result
229
264
2. If `on_trigger_type_registration_function_id` is configured, the hook returns `true`
230
265
231
-
**Trigger registration** requires both conditions:
266
+
#### Trigger Registration
267
+
268
+
A worker can register a trigger if **both** conditions are met:
232
269
1. The trigger's `trigger_type` is in `allowed_trigger_types` from the auth result
233
270
2. If `on_trigger_registration_function_id` is configured, the hook returns `true`
234
271
@@ -249,8 +286,8 @@ The Worker module uses the standard iii engine WebSocket protocol. SDK workers c
249
286
| Type | Fields | Description |
250
287
|------|--------|-------------|
251
288
| `registerworker` | `runtime`, `version`, `name`, `os`, `telemetry`, `pid` | Register the worker and send metadata. |
252
-
| `registerfunction` | `function_id`, `metadata` | Register a function. Not allowed on RBAC ports. |
253
-
| `unregisterfunction` | `function_id` | Unregister a function. Not allowed on RBAC ports. |
289
+
| `registerfunction` | `function_id`, `description?`, `metadata?` | Register a function. On RBAC ports, requires `allow_function_registration` and, if `on_function_registration_function_id` is configured, the hook must return `true`; otherwise the registration is silently dropped. |
290
+
| `unregisterfunction` | `function_id` | Unregister a function owned by this worker. |
254
291
| `invokefunction` | `invocation_id`, `function_id`, `data` | Invoke a function. RBAC checks apply on RBAC ports. |
255
292
| `registertriggertype` | `id`, `description` | Register a new trigger type. On RBAC ports, requires `allow_trigger_type_registration`. |
256
293
| `registertrigger` | `id`, `trigger_type`, `function_id`, `config` | Register a trigger. On RBAC ports, requires the type to be in `allowed_trigger_types`. |
0 commit comments