Skip to content

feat(api): add credential-free Google API relays - #1226

Merged
steipete merged 11 commits into
openclaw:mainfrom
km-tr:feat/google-api-base-url
Oct 19, 2026
Merged

steipete merged 11 commits into
openclaw:mainfrom
km-tr:feat/google-api-base-url

Conversation

@km-tr

@km-tr km-tr commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1225.

Add GOG_GOOGLE_API_BASE_URL for local mocks, emulators, and relays that attach credentials outside gog. Requests keep their path and query and identify the original Google host with X-Forwarded-Host.

The relay client has no OAuth, ADC, service-account, or API-key credential provider. It rejects cross-origin redirects and preserves read-only enforcement and Discovery URL validation. Account labels do not select per-account MCP grants in this mode; the global policy still applies.

Scope excludes token endpoints, gRPC, Maps/Places, and unauthenticated non-Google-API downloads. README and MCP docs explain these boundaries. Thanks @km-tr.

Validation: focused transport tests pass, including credential isolation and cross-origin redirects. Independent Codex review found no actionable P0–P2 issues. The full Linux make ci gate passed on Node 26 and Go 1.27.2. govulncheck ./... found no reachable vulnerabilities. A built-CLI check against a synthetic relay succeeded without an Authorization header; a cross-origin redirect was refused and the target received zero requests.

km-tr and others added 2 commits October 18, 2026 20:51
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review blocked

Automated review did not run, so no review verdict was produced.

Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here.

Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update.

Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it.

View the workflow run.

@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 18, 2026
km-tr and others added 2 commits October 18, 2026 22:59
…cross-origin redirects

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DUrLxHVpdzbQGkSefPpGr7
…G_GOOGLE_API_BASE_URL

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DUrLxHVpdzbQGkSefPpGr7
@km-tr km-tr changed the title feat(api): add GOG_GOOGLE_API_BASE_URL to redirect googleapis.com requests feat(api): add GOG_GOOGLE_API_BASE_URL for credential-free relays Oct 18, 2026
km-tr and others added 6 commits October 19, 2026 00:44
Keep and YouTube no longer require local credentials while the base URL is
set, invalid values are not echoed in errors, and redirects to the relay's
own origin are followed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DUrLxHVpdzbQGkSefPpGr7
…URL host

Absolute redirects to the base URL keep the original Google host, api call
lets the transport enforce redirects while the base URL is set, and values
with an empty host name are rejected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DUrLxHVpdzbQGkSefPpGr7
Redirect Locations on the base URL's origin are rewritten to the original
Google origin, so redirected requests are rewritten again with
X-Forwarded-Host and --readonly and Discovery redirect checks keep seeing
Google URLs. This replaces the relay-origin exceptions added earlier.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DUrLxHVpdzbQGkSefPpGr7
@km-tr
km-tr marked this pull request as ready for review October 18, 2026 16:53
Route explicitly configured Google API traffic through a plain transport without resolving or attaching local credentials. Preserve path/query and original host routing, reject cross-origin redirects, and retain command/read-only policy checks.

Closes openclaw#1225

Co-authored-by: km-tr <kumagai@bear.tokyo>
@steipete steipete changed the title feat(api): add GOG_GOOGLE_API_BASE_URL for credential-free relays feat(api): add credential-free Google API relays Oct 19, 2026
@steipete
steipete merged commit d891746 into openclaw:main Oct 19, 2026
8 checks passed
@steipete

Copy link
Copy Markdown
Collaborator

Landed as d891746. Thanks @km-tr; your contribution is credited in the changelog and squash commit.

The full Linux make ci gate and independent review passed. A built-CLI check reached a synthetic relay without Authorization and rejected a cross-origin redirect; the redirect target received zero requests. Exact-head Linux, Windows, macOS, minimum-Go, worker, and Docker CI are green: https://github.com/openclaw/gogcli/actions/runs/39304062510

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:feature Preliminary submission classification; full source review pending.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support a base URL override for Google API requests (GOG_GOOGLE_API_BASE_URL)

2 participants