Skip to content

feat(broker): add iron-token-broker for race-free OAuth refresh coordination#141

Merged
mslipper merged 3 commits into
mainfrom
mslipper/iron-token-broker-spec
May 25, 2026
Merged

feat(broker): add iron-token-broker for race-free OAuth refresh coordination#141
mslipper merged 3 commits into
mainfrom
mslipper/iron-token-broker-spec

Conversation

@mslipper

Copy link
Copy Markdown
Contributor

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 error code as terminal (no retries against reuse-detecting IdPs). See README.iron-token-broker.md for the bootstrap procedure, deployment patterns, and per-backend config.

Also exports OPRef / ParseOPRef / SelectConnectField from internal/transform/secrets so the broker's 1Password backends reuse the parser and field selector without duplication.

mslipper added 3 commits May 24, 2026 21:19
…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.
@mslipper mslipper merged commit 57a2cc3 into main May 25, 2026
6 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.

1 participant