Skip to content

feat: skip device-identity for operators when private-ingress no-auth is on#3

Open
shivammittal274 wants to merge 1 commit intobrowserosfrom
feat/private-ingress-no-auth-pairing-bypass
Open

feat: skip device-identity for operators when private-ingress no-auth is on#3
shivammittal274 wants to merge 1 commit intobrowserosfrom
feat/private-ingress-no-auth-pairing-bypass

Conversation

@shivammittal274
Copy link
Copy Markdown

Follow-up to #1. With auth.mode=none and OPENCLAW_GATEWAY_PRIVATE_INGRESS_NO_AUTH=1, HTTP works without a token but WS connect still fails with DEVICE_IDENTITY_REQUIRED because evaluateMissingDeviceIdentity only allows device-less operators when sharedAuthOk=true, which auth.mode=none never makes true. This patch extends the same env-gated bypass to the device-identity decision: when gateway is running with auth.mode=none, an operator-role WS connect without a paired device is allowed. Scope is operator-only — node-role registrations must still satisfy device identity. authMode is added as a new optional parameter on evaluateMissingDeviceIdentity; existing callers fall through unchanged. Tests: 8/8 pass in connect-policy.test.ts including the new test covering operator+none allow, missing-authMode regression, operator+token unchanged, and node+none still rejected. Empirically verified the PoC failure against 2026.4.28-browseros.2-arm64.

…end operators

Follow-up to #1. PR #1 added gateway.auth.mode=none + the
OPENCLAW_GATEWAY_PRIVATE_INGRESS_NO_AUTH env opt-in so HTTP clients can
talk to the gateway without a token. WebSocket clients still hit the
device-identity gate during connect handshake — `evaluateMissingDeviceIdentity`
only allows device-less operators when `sharedAuthOk=true`, which auth.mode=none
never makes true. Result: the BrowserOS backend can hit /v1/* over HTTP but
its WS observer connection is rejected with DEVICE_IDENTITY_REQUIRED, which
defeats the unified-transport goal of #1 (PoC verified empirically against
2026.4.28-browseros.2-arm64).

This patch extends the same env-gated bypass to the device-identity
decision. When the gateway is running with auth.mode=none, an operator-role
WS connect without a paired device is allowed. The runtime startup gate in
server-runtime-config.ts already required the env var for any non-loopback
bind to boot with auth.mode=none, so reaching this branch means the embedding
runtime explicitly opted into "I own the network boundary, skip auth entirely".
Pairing-as-hygiene adds no security in that configuration: any client reaching
the bind already needs no credentials.

Scope to operator role only — node-role registrations must still satisfy
device identity, matching the controlUiAuthPolicy.allowBypass shape directly
above this branch.

Threading: `authMode` is a new optional parameter on
`evaluateMissingDeviceIdentity`. The single call site in `message-handler.ts`
passes `resolvedAuth.mode` through; existing callers without the parameter
fall through to the previous behavior unchanged.

Test plan
- bun test src/gateway/server/ws-connection/connect-policy.test.ts
  (8/8 pass — new test "auth.mode=none skips device identity for operator
  role only" covers: operator allow, missing-authMode regression, non-"none"
  authMode regression, node-role still rejected)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant