fix(bridge): persistent shared OAuth-proxy storage#9
Merged
Conversation
Upstream unit-tests job installs .[dev] (no bridge extras), so key_value isn't present and test_memory_backend ModuleNotFound-ed. importorskip the driver — the routing/fail-fast tests don't need it.
… taint) CodeQL taints the BridgeConfig object (it holds secrets) and flagged logging config-derived values (project/collection — not secrets) as clear-text sensitive logging. Log a constant backend message instead; backend selection is still observable, no config values interpolated.
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.
Problem
FastMCP
OAuthProxystores registered DCR clients + refresh tokens inclient_storage, which defaults to local disk — ephemeral and per-instance on serverless/multi-instance deployments (e.g. Cloud Run with maxScale>1). On restart/redeploy/scale, clients and refresh tokens are lost, so users get logged out intermittently across instances.Fix
OAUTH_CLIENT_STORAGEselects a sharedAsyncKeyValuebackend (firestore|redis|memory) viaoauth_storage.build_client_storage, passed to the provider asclient_storage. Defaults to disk with a loud startup warning. Newbridge-gcpdeppy-key-value-aio[firestore](+bridge-redisextra).Per-deployment isolation holds even on a shared backend: FastMCP derives the JWT signing + storage-encryption keys from the upstream client secret (HKDF), so entries are mutually opaque across deployments.
Verified
Live on a 3-instance Cloud Run deployment: a DCR registration persists to the shared store and survives restarts/scale. +5 unit tests; bridge+unit suite green.