Skip to content

fix(infra): wire ADMIN_TOKEN placeholder to close issue #684 (PR #729) - #737

Merged
HongmingWang-Rabbit merged 1 commit into
mainfrom
fix/issue-684-admin-token-env
Apr 17, 2026
Merged

fix(infra): wire ADMIN_TOKEN placeholder to close issue #684 (PR #729)#737
HongmingWang-Rabbit merged 1 commit into
mainfrom
fix/issue-684-admin-token-env

Conversation

@molecule-ai

@molecule-ai molecule-ai Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Backend Engineer's PR #729 introduces ADMIN_TOKEN in the platform middleware. When set, only that exact value is accepted on /admin/* and /approvals/* routes, replacing the vulnerable workspace-bearer fallback. Without the env var wired into deployments the code fix is unreachable — every running instance remains on the backward-compat fallback that accepts any workspace token (= still vulnerable to #684).

This PR closes the deployment gap by:

  • docker-compose.yml — adds ADMIN_TOKEN: "${ADMIN_TOKEN:-}" to the platform service env block with a comment explaining the security context, generation command, and storage guidance (never commit the actual value).
  • .env.example — documents ADMIN_TOKEN= with a prominent warning, openssl rand -base64 32 generation line, and a note to inject via fly secrets / deployment env.
  • infra/scripts/setup.sh — prints a visible ⚠ WARNING when ADMIN_TOKEN is unset so operators running ./infra/scripts/setup.sh know the vulnerability is still open in that local deployment.
  • CLAUDE.md — adds ADMIN_TOKEN to the env vars reference section so future agents pick it up.

Note on docker-compose.infra.yml

The task requested adding ADMIN_TOKEN to docker-compose.infra.yml, but that file contains only infrastructure services (Postgres, Redis, Temporal, Langfuse) — there is no platform service in that file. The platform service that consumes ADMIN_TOKEN lives exclusively in docker-compose.yml, which is the file updated here.

No code changes

go build ./... passes clean — this PR is purely env-wiring and documentation.

Test plan

  • go build ./... in platform/ — passes clean ✅
  • Start platform with ADMIN_TOKEN=sometoken: confirm POST /admin/workspaces/:id/test-token requires exactly that token (not any workspace bearer)
  • Start platform without ADMIN_TOKEN: confirm backward-compat fallback still works (unblocks devs on local setups)
  • Run ./infra/scripts/setup.sh without ADMIN_TOKEN set: confirm warning is printed
  • Check .env.example has no committed token value

Part of fix for #684 / PR #729

🤖 Generated with Claude Code

…729)

Backend Engineer's PR #729 introduces ADMIN_TOKEN — when set, only that value
is accepted on /admin/* and /approvals/* routes, replacing the vulnerable
workspace-bearer fallback. Without the env var wired into deployments the fix
is code-only and the vulnerability stays open in every running instance.

Changes:
- `docker-compose.yml`: adds ADMIN_TOKEN env var to the platform service
  (blank default = backward-compat fallback, i.e. still vulnerable until set).
  NOTE: docker-compose.infra.yml has no platform service — the platform lives
  only in the full-stack docker-compose.yml, so that is the correct file.
- `.env.example`: documents ADMIN_TOKEN with generation instructions and a
  clear warning that it must be set to close #684.
- `infra/scripts/setup.sh`: prints a visible warning when ADMIN_TOKEN is unset
  so operators know the vulnerability is still open in that deployment.
- `CLAUDE.md`: adds ADMIN_TOKEN to the env vars reference section.

No Go code changed — go build ./... passes clean.

Part of fix for #684 / PR #729

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@molecule-ai molecule-ai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVED — Exactly right.

  • .env.example: ADMIN_TOKEN= with clear generation instructions and a 'NEVER commit' warning ✅
  • docker-compose.yml: ADMIN_TOKEN: "${ADMIN_TOKEN:-}" in platform env — operators can inject via shell or .env
  • CLAUDE.md: env var table updated with full explanation of the #684 fix and required action ✅
  • infra/scripts/setup.sh: runtime warning if ADMIN_TOKEN is unset — operators get a clear signal before starting the platform ✅

Nothing sensitive committed, no breaking changes. Ready to merge.

@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit ede7cf1 into main Apr 17, 2026
6 checks passed
@HongmingWang-Rabbit
HongmingWang-Rabbit deleted the fix/issue-684-admin-token-env branch April 17, 2026 15:47
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
fix(infra): wire ADMIN_TOKEN placeholder to close issue #684 (PR #729)
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