Skip to content

Allow API-key auth for remote exec-server registration#24666

Merged
sdcoffey merged 5 commits into
mainfrom
dev/steve/exec-server-api-key-auth
May 27, 2026
Merged

Allow API-key auth for remote exec-server registration#24666
sdcoffey merged 5 commits into
mainfrom
dev/steve/exec-server-api-key-auth

Conversation

@sdcoffey
Copy link
Copy Markdown
Contributor

@sdcoffey sdcoffey commented May 27, 2026

Overview

Allow remote codex exec-server registration to use existing API-key auth while restricting where those credentials can be sent.

  • Accept CodexAuth::ApiKey for the normal --remote registration path.
  • Restrict API-key remote registration to HTTPS openai.com and openai.org hosts and subdomains, with explicit HTTP loopback support for local development.
  • Disable registry registration redirects so credentials cannot be forwarded to an unvalidated destination.
  • Retain --use-agent-identity-auth as the explicit Agent Identity path.
  • Document remote registration using CODEX_API_KEY.

Big picture

Callers can now provide an API key directly to exec-server registration without first establishing ChatGPT login state:

CODEX_API_KEY="$OPENAI_API_KEY" \
codex exec-server \
  --remote "https://<host>.openai.org/api" \
  --environment-id "$ENVIRONMENT_ID"

Validation

  • cargo fmt --all (just fmt is not installed on this host)
  • cargo test -p codex-cli -p codex-exec-server

@sdcoffey sdcoffey force-pushed the dev/steve/exec-server-api-key-auth branch from 4e0de11 to 348a07c Compare May 27, 2026 00:14
Comment thread codex-rs/cli/src/main.rs
Comment thread codex-rs/cli/src/main.rs Outdated
Comment thread codex-rs/cli/src/main.rs
Comment thread codex-rs/cli/src/main.rs
@sdcoffey sdcoffey enabled auto-merge (squash) May 27, 2026 20:59
@sdcoffey sdcoffey merged commit c57dee9 into main May 27, 2026
31 checks passed
@sdcoffey sdcoffey deleted the dev/steve/exec-server-api-key-auth branch May 27, 2026 21:17
@github-actions github-actions Bot locked and limited conversation to collaborators May 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants