fix: allow device-paired clients to retrieve TTS API keys#14613
Conversation
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: src/gateway/server-methods.ts
Line: 141:163
Comment:
**Admin scope blocks fix**
`authorizeGatewayMethod` currently denies *all* `config.*` methods unless the client has `operator.admin` (`src/gateway/server-methods.ts:141-163`). This PR’s new `includeSecrets && client.deviceToken` path in `config.get` (`src/gateway/server-methods/config.ts:95-114`) won’t be reachable for device-paired clients unless they also request/are granted `operator.admin`, so iOS talk mode may still receive a denied RPC rather than an unredacted key.
How can I resolve this? If you propose a fix, please make it concise. |
|
Hi @gumadeiras @thewilloftheshadow @cpojer, Would appreciate a review when you get a chance. This refactors gateway authorization by adding config.get to the READ_METHODS set, allowing device-paired clients to access it without requiring operator.admin. This unblocks the includeSecrets flow for TTS on iOS while keeping default redaction and existing security guarantees intact. Thanks! |
|
possibly duplicates #14645 |
e16eb04 to
cfd03eb
Compare
|
Landed via temp rebase onto main.
Thanks @akramcodez! |
…4613) * refactor: add config.get to READ_METHODS set * refactor(gateway): scope talk secrets via talk.config * fix: resolve rebase conflicts for talk scope refactor --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
…4613) * refactor: add config.get to READ_METHODS set * refactor(gateway): scope talk secrets via talk.config * fix: resolve rebase conflicts for talk scope refactor --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
…4613) * refactor: add config.get to READ_METHODS set * refactor(gateway): scope talk secrets via talk.config * fix: resolve rebase conflicts for talk scope refactor --------- Co-authored-by: Peter Steinberger <steipete@gmail.com> (cherry picked from commit 4c86821) # Conflicts: # apps/android/app/src/main/java/ai/openclaw/android/node/ConnectionManager.kt
…4613) * refactor: add config.get to READ_METHODS set * refactor(gateway): scope talk secrets via talk.config * fix: resolve rebase conflicts for talk scope refactor --------- Co-authored-by: Peter Steinberger <steipete@gmail.com> (cherry picked from commit 4c86821) # Conflicts: # apps/android/app/src/main/java/ai/openclaw/android/node/ConnectionManager.kt # apps/ios/Sources/Model/NodeAppModel.swift # src/gateway/server-methods/talk.ts
…4613) * refactor: add config.get to READ_METHODS set * refactor(gateway): scope talk secrets via talk.config * fix: resolve rebase conflicts for talk scope refactor --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
…4613) * refactor: add config.get to READ_METHODS set * refactor(gateway): scope talk secrets via talk.config * fix: resolve rebase conflicts for talk scope refactor --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
…4613) * refactor: add config.get to READ_METHODS set * refactor(gateway): scope talk secrets via talk.config * fix: resolve rebase conflicts for talk scope refactor --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
Problem
iOS/macOS talk mode fails because ElevenLabs API key is always redacted in
config.getRPC responses. The iOS app receives__OPENCLAW_REDACTED__instead of the actual API key, causing 401 errors from ElevenLabs.Solution
Added optional
includeSecretsparameter toconfig.getRPC with proper authorization:includeSecrets: truewhen requesting configdeviceToken)Security
client.deviceToken- only paired devices get secretsincludeSecrets: trueTesting
tsc --noEmit)redact-snapshot.test.ts)Changes
includeSecretsoptional param toConfigGetParamsSchemadeviceTokentoGatewayClientandGatewayWsClienttypesdeviceTokenthrough WebSocket handshakeconfig.gethandlerfixes #14586
Greptile Overview
Greptile Summary
This PR adds an
includeSecrets?: booleanoption to theconfig.getRPC and plumbs the device-pairing token into the per-connection client object soconfig.getcan return either a redacted snapshot (default) or the full on-disk snapshot for device-paired clients. The iOS TalkModeManager now opts in withincludeSecrets: truewhen reloading talk-mode configuration.The change fits into the gateway’s existing redaction system (
redactConfigSnapshot) by keeping redaction as the default and only bypassing it when an authenticated/paired device is detected via the WebSocket handshake state.Confidence Score: 2/5
includeSecretsbehavior is implemented, butconfig.getremains gated behindoperator.adminfor all clients, which likely prevents device-paired mobile clients from accessing it and makes the intended fix ineffective. No other definite regressions were found in the changed files.