Skip to content

fix(bridge): persistent shared OAuth-proxy storage#9

Merged
manana2520 merged 3 commits into
mainfrom
contrib/oauth-proxy-persistent-storage
Jun 14, 2026
Merged

fix(bridge): persistent shared OAuth-proxy storage#9
manana2520 merged 3 commits into
mainfrom
contrib/oauth-proxy-persistent-storage

Conversation

@manana2520

Copy link
Copy Markdown
Contributor

Problem

FastMCP OAuthProxy stores registered DCR clients + refresh tokens in client_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_STORAGE selects a shared AsyncKeyValue backend (firestore | redis | memory) via oauth_storage.build_client_storage, passed to the provider as client_storage. Defaults to disk with a loud startup warning. New bridge-gcp dep py-key-value-aio[firestore] (+ bridge-redis extra).

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.

Comment thread src/odoo_mcp_bridge/oauth_storage.py Fixed
Comment thread src/odoo_mcp_bridge/oauth_storage.py Fixed
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.
@manana2520 manana2520 merged commit a5cbc39 into main Jun 14, 2026
16 checks passed
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.

2 participants