feat(broker): add iron-token-broker for race-free OAuth refresh coordination#141
Merged
Conversation
…ination iron-token-broker is a separate process that owns OAuth refresh-token state for one or more credentials. iron-proxy instances fetch current access tokens from it over HTTP, so the refresh family is never touched concurrently by multiple proxies. This solves the strict refresh-token reuse-detection trap for IdPs like OpenAI Codex and Anthropic Claude Code OAuth. The broker manages credentials via a pluggable store interface (file, 1Password SDK, 1Password Connect, AWS Secrets Manager, AWS SSM Parameter Store), runs a per-credential refresh loop with backoff, single-flights concurrent in-band refreshes with a detached context, and exposes a bearer-auth HTTP API plus Prometheus metrics. Exports OPRef / ParseOPRef / SelectConnectField from internal/transform/ secrets so the broker's 1Password backends can reuse the parser and field selector without duplication.
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.
Adds
iron-token-broker, a separate process that owns OAuth refresh-token state for one or more credentials. iron-proxy instances fetch current access tokens from it over HTTP so the refresh family is never touched concurrently by multiple proxies. This addresses the strict refresh-token reuse-detection trap with IdPs like OpenAI Codex and Anthropic Claude Code OAuth.The broker manages credentials via a pluggable store interface (file, 1Password SDK, 1Password Connect, AWS Secrets Manager, AWS SSM Parameter Store), runs a per-credential refresh loop with backoff, single-flights concurrent in-band refreshes with a detached context so a leader cancellation doesn't poison waiters, and exposes a bearer-auth HTTP API plus Prometheus metrics. Treats any OAuth
errorcode as terminal (no retries against reuse-detecting IdPs). SeeREADME.iron-token-broker.mdfor the bootstrap procedure, deployment patterns, and per-backend config.Also exports
OPRef/ParseOPRef/SelectConnectFieldfrominternal/transform/secretsso the broker's 1Password backends reuse the parser and field selector without duplication.