Skip to content

fix(codex): keep API keys out of rendered install scripts - #1075

Merged
DevelopmentCats merged 5 commits into
coder:mainfrom
Edd88-pixel:eddy/secure-cli-auth-install
Aug 26, 2026
Merged

fix(codex): keep API keys out of rendered install scripts#1075
DevelopmentCats merged 5 commits into
coder:mainfrom
Edd88-pixel:eddy/secure-cli-auth-install

Conversation

@Edd88-pixel

@Edd88-pixel Edd88-pixel commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Why

The Codex module currently duplicates the API key into its rendered installation script and manually creates auth.json. This leaves the secret in generated installation content and bypasses the CLI-supported authentication flow.

Changes

  • Stop rendering the API key into the Terraform-generated install script and stop writing auth.json manually.
  • Authenticate with codex login --with-api-key, passing the key through standard input from the workspace environment.
  • Treat authentication failures, missing pre-installed binaries, invalid downloads, and non-runnable binaries as terminal errors with concise messages.
  • Add bounded download retries, archive validation, regression coverage, documentation, and the 5.3.2 patch version.

Validation

  • terraform test -no-color — 13 passed, 0 failed.
  • bun test main.test.ts — 35 passed, 0 failed.

Description

Secure CLI authentication and make installation failures explicit instead of allowing a partially configured workspace to appear successful.

Type of Change

  • New module
  • New template
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/coder-labs/modules/codex
New version: v5.3.2
Breaking change: [ ] Yes [x] No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted
  • Changes tested locally

Related Issues

None

@Edd88-pixel
Edd88-pixel marked this pull request as ready for review August 24, 2026 16:20
@Edd88-pixel Edd88-pixel changed the title fix(auth): keep API keys out of rendered install scripts fix(codex): keep API keys out of rendered install scripts Aug 24, 2026
@matifali
matifali removed their request for review August 24, 2026 17:06
Comment thread registry/coder-labs/modules/codex/scripts/install.sh.tftpl Outdated
@DevelopmentCats
DevelopmentCats merged commit 702f11f into coder:main Aug 26, 2026
5 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