Skip to content

feat(brain): support admin api bearer token#5

Open
king-tero wants to merge 1 commit into
mainfrom
king-tero/security-admin-token
Open

feat(brain): support admin api bearer token#5
king-tero wants to merge 1 commit into
mainfrom
king-tero/security-admin-token

Conversation

@king-tero
Copy link
Copy Markdown
Collaborator

Summary

Adds optional bearer-token authentication for the Brain admin API and Operator TUI.

Changes

  • Adds A2C_ADMIN_TOKEN support to the admin API.
  • Requires Authorization: Bearer <token> when a token is configured.
  • Keeps the current no-token local-lab behavior when A2C_ADMIN_TOKEN is unset.
  • Teaches the Operator TUI admin client to send the bearer token from A2C_ADMIN_TOKEN or --token.
  • Documents token configuration and curl usage.
  • Adds HTTP tests for unauthenticated, unauthorized, and authorized admin requests.

Why

The admin API can list devices and push tasks to connected daemon Bodies. Even though it binds to localhost by default, deployments may expose it intentionally or accidentally. A simple optional bearer token gives operators a low-friction protection mechanism without changing default local development behavior.

Validation

  • .venv/bin/python -m pytest -> 3 passed
  • .venv/bin/python -m compileall -q src tests

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