feat: GCS-backed auth state persistence for Cloud Run#9
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Guard against None bucket in get_storage_backend() - Replace assert with `or ""` fallback for username type narrowing - Skip storage sync when OAuth is enabled (no cookie auth needed) - Add missing delete_remote failure test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
Author
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cloud Run needs both: OAuth protects the MCP endpoint, AND cookie-based auth is needed for LinkedIn scraping. The storage sync must run regardless of OAuth mode. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When AUTH_STORAGE_BACKEND=gcs, only cookies.json and source-state.json are synced — the Chromium profile directory doesn't exist locally. Relax the startup check to only require source state + cookies when remote storage is configured, since Cloud Run always bridges from cookies as a foreign runtime. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
StorageBackendprotocol withLocalBackend(no-op) andGCSBackendimplementationscookies.json+source-state.jsonto GCS so Cloud Run cold starts can restore LinkedIn session state[gcs]optional dependency (pip install linkedin-scraper-mcp[gcs])Configuration
Design
See
docs/design-gcs-auth-storage.mdfor the full design doc with decision log.Only portable artifacts are persisted (~KB), not the full browser profile. Cloud Run always runs as a foreign runtime and bridges from cookies on every cold start.
Test plan
InMemoryBackendandFailingBackendtest doublessync_from_remoteraisesStorageSyncErroron download failuresync_to_remotelogs warning but doesn't crash on upload failuredelete_remotereturns False on failureCloses #7
Generated with Claude Opus 4.6 (1M context).
Prompt:
how to solve https://github.com/5queezer/linkedin-mcp-server/issues/7→ brainstorming → plan → subagent-driven implementation🤖 Generated with Claude Code