iii-worker-rbac
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWorker RBAC
Worker RBAC
RBAC belongs on listeners. Use it to expose a constrained function surface to a worker or browser client while keeping the private engine worker port internal.
iii-worker-managerRBAC 配置在监听器上。通过它可以向Worker或浏览器客户端暴露受限的函数接口,同时将私有引擎Worker端口保留在内部。
iii-worker-managerCore Concepts
核心概念
- Public or untrusted clients connect to an RBAC-enabled worker-manager listener, not the private worker port.
- receives request connection data and returns an
auth_function_id.AuthResult - Discovery is filtered: callers only see functions and trigger types they are allowed to use.
- override allowed lists and exposure filters.
forbidden_functions - Denied invocation returns .
FORBIDDEN - A missing function and a forbidden function are different: missing means the engine has no callable registration; forbidden means policy denied access.
- 公共或不可信客户端连接到启用RBAC的worker-manager监听器,而非私有Worker端口。
- 接收请求连接数据并返回
auth_function_id。AuthResult - 发现功能会被过滤:调用者只能看到被允许使用的函数和触发器类型。
- 会覆盖允许列表和暴露过滤器。
forbidden_functions - 被拒绝的调用会返回。
FORBIDDEN - 函数不存在与函数被禁止是两种不同情况:不存在表示引擎没有可调用的注册;被禁止表示策略拒绝了访问。
AuthInput
AuthInput
Auth functions receive:
headersquery_paramsip_address
Browsers cannot reliably send custom WebSocket headers, so browser auth usually comes from query params, cookies, or upstream session context.
认证函数会接收以下参数:
headersquery_paramsip_address
浏览器无法可靠地发送自定义WebSocket头,因此浏览器认证通常来自查询参数、Cookie或上游会话上下文。
AuthResult
AuthResult
Return:
allowed_functions: string[]forbidden_functions: string[]allowed_trigger_types?: string[]allow_trigger_type_registration: booleanallow_function_registration?: booleanfunction_registration_prefix?: stringcontext: Record<string, unknown>
返回内容包括:
allowed_functions: string[]forbidden_functions: string[]allowed_trigger_types?: string[]allow_trigger_type_registration: booleanallow_function_registration?: booleanfunction_registration_prefix?: stringcontext: Record<string, unknown>
Access Resolution
访问决议流程
- If a function matches , deny.
forbidden_functions - If it matches , allow.
allowed_functions - Allow so channels can be created on RBAC listeners.
engine::channels::create - If it matches configured , allow.
expose_functions - Otherwise deny.
- 如果函数匹配,则拒绝访问。
forbidden_functions - 如果函数匹配,则允许访问。
allowed_functions - 允许,以便在RBAC监听器上创建通道。
engine::channels::create - 如果函数匹配已配置的,则允许访问。
expose_functions - 否则拒绝访问。
Registration Hooks
注册钩子
RBAC can affect registration as well as invocation:
on_trigger_registration_function_idon_trigger_type_registration_function_idon_function_registration_function_id
Use hooks to approve, deny, rewrite metadata, or enforce naming/prefix policy for registrations made through the listener.
function_registration_prefixRBAC不仅会影响调用,还会影响注册:
on_trigger_registration_function_idon_trigger_type_registration_function_idon_function_registration_function_id
使用钩子来批准、拒绝、重写元数据,或对通过监听器进行的注册实施命名/前缀策略。
function_registration_prefixCommon Config Shape
常见配置格式
yaml
workers:
- name: iii-worker-manager
config:
listeners:
- host: 127.0.0.1
port: 49135
rbac:
auth_function_id: auth::browser-session
expose_functions:
- match("public::*")
on_function_registration_function_id: policy::function-registrationyaml
workers:
- name: iii-worker-manager
config:
listeners:
- host: 127.0.0.1
port: 49135
rbac:
auth_function_id: auth::browser-session
expose_functions:
- match("public::*")
on_function_registration_function_id: policy::function-registrationAgent Behavior
Agent行为规范
- Call discovery functions through the same listener the target client uses.
- Treat as policy denial, not a retryable missing-worker problem.
FORBIDDEN - Do not suggest installing a worker when the function exists but is forbidden.
- When registration is denied, inspect registration hook results and policy config.
- Use exposed metadata and allowed lists to choose callable functions.
- 通过目标客户端使用的同一监听器调用发现函数。
- 将视为策略拒绝,而非可重试的Worker缺失问题。
FORBIDDEN - 当函数存在但被禁止时,不要建议安装Worker。
- 当注册被拒绝时,检查注册钩子结果和策略配置。
- 使用暴露的元数据和允许列表来选择可调用的函数。
Pattern Boundaries
模式边界
- For SDK error types, prefer .
iii-error-handling - For browser connection behavior, prefer .
iii-browser-sdk - For engine config layout, prefer .
iii-engine-config
- 对于SDK错误类型,优先使用。
iii-error-handling - 对于浏览器连接行为,优先使用。
iii-browser-sdk - 对于引擎配置布局,优先使用。
iii-engine-config
When to Use
使用场景
- Use this skill when the task mentions RBAC, permissions, auth functions, filtered discovery, , exposed functions, registration hooks, browser-safe worker access, or tenant-isolated function surfaces.
FORBIDDEN
- 当任务涉及RBAC、权限、认证函数、过滤发现、、暴露函数、注册钩子、浏览器安全的Worker访问或租户隔离的函数接口时,使用此技能。
FORBIDDEN
Boundaries
边界限制
- Do not expose the private worker WebSocket port to untrusted clients.
- Do not hide policy denial by treating every failure as .
function_not_found - Do not generate removed service APIs or adapter-extension APIs.
- 不要向不可信客户端暴露私有Worker WebSocket端口。
- 不要将所有失败都视为,从而隐藏策略拒绝的情况。
function_not_found - 不要生成已移除的服务API或适配器扩展API。