Add ChatGPT token stdin authentication to exec-server (#59569)

## What changed

- Add `--chatgpt-token-stdin` for remote HTTPS registration and optional `--chatgpt-account-id`, which must match the token's account claim when present. Read a bounded, newline-terminated token from a pipe without persisting it to `auth.json`.
- Load managed configuration using the supplied account, enforce account restrictions, and preserve configured policy-server authentication. Skip ChatGPT policy lookup only for known plans that do not require managed configuration.
- Allow `--exit-on-stdin-close` to cancel pending policy loading, and redact the registration bearer from registry diagnostics.
- Reject incompatible stdin credential options, including flags placed on opposite sides of `forward`, and disallow ChatGPT token stdin authentication with `forward`.

## Testing

Add coverage for account-claim validation, policy selection, policy-server sign-in requirements, shutdown during policy loading, credential flag conflicts, and bearer redaction.

GitOrigin-RevId: b6b50565e1f150b96edf3cee796909a991f1b47f
This commit is contained in:
aagrawal-oai
2026-11-05 04:25:19 +00:00
committed by copyberry
parent 5c0b1ac71f
commit 529d965d80
17 changed files with 523 additions and 89 deletions
@@ -106,6 +106,12 @@ Options:
Read rotating executor credentials from stdin; exit when the pipe
closes
--chatgpt-token-stdin
Read a ChatGPT access token from stdin for HTTPS registration
--chatgpt-account-id <ID>
ChatGPT account ID. Must match the token's account claim when present
--aws-sigv4
Sign Direct registration and WebSocket handshake requests with AWS
SigV4