Skip to content
Sign in

rbac-proxy

v1.1.11

RBAC boundary proxy for the iii worker protocol — auth, gating, namespacing, middleware, and engine:: result filtering on its own port.

license: Apache-2.0authorizationmiddlewareproxyrbacsecurity

Install

bash
iii call compose::add worker=rbac-proxy

Run in your project with the iii engine running. Exact versions are immutable and digest-pinned.

Functions3

rbac-proxy::on-config-change

Function

Internal: hot-reload rbac-proxy from the authoritative configuration — rebinds the public listener on a host/port change (last-good on failure), else swaps the per-connection snapshot.

Request
  • idstring
Response
  • applied_configobjectrequired
    • engine_urlstring

      The trusted internal engine listener the data plane proxies to. When unset: the engine the worker was started against (`III_URL` / `--url`), else `ws://127.0.0.1:49134`. New connections dial this; existing connections finish on their captured upstream (no forced cutover).

    • expose_worker_internalsboolean

      Strip operational identity (`pid`, `ip_address`, `isolation`, `internal`, `latest_metrics`) from `engine::workers::*` results. `false` (strip) is the multi-tenant-safe default.

    • hoststring

      Host the public RBAC listener binds. Structural (rebind on change).

    • middleware_function_idstring

      When set, every allowed, non-`engine::` invocation is routed to this function instead of the target; its return value becomes the result.

    • portinteger· uint16min 0

      The public RBAC port. Structural (rebind on change).

    • rbacall of

      The RBAC contract (auth function, expose filters, the function and observer registration hooks).

      all of (1)
      Variant 1
      • auth_function_idstring

        Engine function id invoked once per upgrade to authenticate the worker (`/`) or telemetry (`/otel`) connection. Unset ⇒ every such upgrade is refused, except a loopback peer's when `loopback_auth` is set.

      • expose_endpointsany of[]

        Endpoints of the engine's worker port the proxy serves (`/`, `/otel`, `/ws/channels/*`); one is served if **any** rule matches it. Unset serves `/` only, as earlier versions did (minus channels), so an upgrade keeps workers connected; an empty list serves nothing.

        Show 2 nested
        any of (2)
        Variant 1
        valuestring
        Variant 2
        • matchstringrequired
      • expose_functionsany of[]

        Filters exposing functions for invocation/discovery; a function is exposed if **any** filter matches.

        Show 3 nested
        any of (3)
        Variant 1
        valuestring
        Variant 2
        • matchstringrequired
        • namespacestring
        Variant 3
        • metadataobjectrequired
        • namespacestring
      • loopback_authany of

        Built-in authentication for local projects, used only when `auth_function_id` is not set. Like the auth function it governs the worker endpoint `/` and telemetry `/otel` only (`/ws/channels/*` sockets are checked by the engine's channel access keys): a connection whose peer address is loopback (exactly 127.0.0.1, ::1 or ::ffff:127.0.0.1) and whose upgrade shows no sign of a non-local client (see `allowed_origins`, `allow_forwarded`) gets these grants, as if an auth function had returned them; any other is refused. Only safe where every local process is trusted: a tunnel, a reverse proxy or a sandbox gateway on the same machine makes remote clients look local. `auth_function_id` wins when both are set.

        Show 2 nested
        any of (2)
        Variant 1
        • allow_forwardedboolean

          Whether an upgrade carrying a proxy's forwarding headers (`Forwarded`, `X-Forwarded-For`, `X-Forwarded-Host`, `X-Forwarded-Proto`, `X-Real-IP` or `Via`) still gets the loopback grant. Default `false`: such an upgrade came through a proxy, so its client is not known to be local, and it is refused as a non-loopback peer.

        • allow_function_registrationboolean

          Whether the connection may register functions (event sources included). Default `false`, unlike an auth function's result; when `true`, a non-empty `function_registration_prefix` is required.

        • allowed_functionsstring[]

          Function ids the connection may call in the `default` namespace (exact ids; a pattern goes in `namespaces`).

        • allowed_originsstring[]

          `Origin` values whose upgrades still get the loopback grant (exact, scheme and host compared case-insensitively, e.g. `http://localhost:3000`). An upgrade carrying any other `Origin`, a browser page's, is refused as a non-loopback peer; one with no `Origin` (SDK workers) is unaffected. Default `[]`: every upgrade that carries an `Origin` is refused.

        • contextunknown

          Passed to the middleware and the registration hooks.

        • forbidden_functionsstring[]

          Function ids the connection may never call, in any namespace; wins over every other rule.

        • function_registration_prefixstring

          Private prefix for the connection's own registrations and worker names. Non-empty and required when `allow_function_registration` is `true`.

        • namespacesobject

          Grants scoped to one namespace each (`{ orders: ["svc::*"] }`); the keys are then the only namespaces the connection may declare.

        • worker_namesstring[]

          Worker names the connection may declare unchanged (exact, never an `rbac-proxy:` name; one live session at a time holds each).

        Variant 2
        valuenull
      • on_function_registration_function_idstring

        Called before a function is registered, with its `function_id`, `description`, `metadata`, `namespace`, `private`, `observable`, `args_format` (when set) and the session's `context`. An object answer may rewrite `function_id`, `description`, `metadata`, `private`, `observable` and `args_format`; anything else denies (the registration is dropped).

      • on_observer_registration_function_idstring

        Called before an observer is created, with `observer_id`, `function_id`, `namespace`, `args`, `filters`, `target_function_id`, `target_namespace`, `metadata` and the session's `context`. An object answer may rewrite `function_id`, `target_function_id`, `args`, `filters` and `metadata`; anything else denies (`FORBIDDEN`).

  • bound_hoststringrequired
  • bound_portinteger· uint16requiredmin 0
  • errorstring
  • okbooleanrequired
  • registration_namespacebooleanrequired

    This build pins a session to the auth result's `registration_namespace`. A caller that needs the pin refuses a proxy whose answer lacks it.

rbac-proxy::on-functions-changed

Function

Internal: invalidate the discovery catalog cache when the engine's function set changes.

Request
  • invocation_idstring
Response
  • okbooleanrequired

rbac-proxy::status

Function

Check proxy health: bound host/port, the upstream engine scheme and port, which authentication admits worker and telemetry connections (auth function, loopback grant, or none; channel sockets are checked by the engine), which endpoints are exposed, and the live downstream connection count.

Request
Empty object
Response
  • active_connectionsinteger· uint32requiredmin 0

    Live downstream connections.

  • authall ofrequired

    The authentication in force for new worker (`/`) and telemetry (`/otel`) connections: `function` (the `auth_function_id`), `loopback` (no auth function; `loopback_auth` admits loopback peers) or `none` (every worker and telemetry connection is refused). `/ws/channels/*` sockets are not authenticated by the proxy in any mode: the engine checks their channel access keys.

    all of (1)
    Variant 1
    one of (3)
    Variant 1
    valuestringenum function
    Variant 2
    valuestringenum loopback
    Variant 3
    valuestringenum none
  • engine_urlstringrequired

    Upstream engine scheme and port, e.g. `ws, port 49134`: the URL itself can carry a credential, so nothing else is reported.

  • expose_endpointsstring[]required

    The `rbac.expose_endpoints` patterns: the paths the proxy serves. Empty: every connection is refused.

  • hoststringrequired

    Bound public host.

  • portinteger· uint16requiredmin 0

    Bound public RBAC port.

  • rbac_enabledbooleanrequired

    Whether an `auth_function_id` is configured.

  • versionstringrequired

    Worker version (matches `Cargo.toml`).

Search the registry

Find workers, kits and executables, or jump to a page.