Skip to content

feat(auth): optional operator API token and proxy headers - #10

Merged
ArianAr merged 1 commit into
mainfrom
feat/operator-auth
Jul 16, 2026
Merged

feat(auth): optional operator API token and proxy headers#10
ArianAr merged 1 commit into
mainfrom
feat/operator-auth

Conversation

@ArianAr

@ArianAr ArianAr commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

First M5 roadmap item: optional operator authentication.

  • GANTRY_API_TOKEN / -api-token — Bearer / X-API-Key / access_token query
  • -trust-proxy-headers — Remote-User / X-Remote-User / X-Forwarded-User
  • /healthz always open
  • Dashboard token gate + sessionStorage + SSE query param
  • Docs: README, SECURITY, ROADMAP M5, CHANGELOG

Test plan

  • go test ./... (auth unit tests)
  • go vet ./...
  • Frontend production build
  • Smoke: no token → 401 API; health 200; Bearer token → 200

Review focus

  • Constant-time token compare
  • SSE EventSource cannot set headers (query param path)
  • Proxy header trust only when explicitly enabled

@ArianAr ArianAr added enhancement New feature or request security Security related frontend React dashboard backend Go server and API labels Jul 16, 2026

@ArianAr ArianAr left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Review

Scope

Optional shared-token + proxy-header auth; UI token prompt; docs.

Checks

  • Constant-time compare for token
  • /healthz exempt
  • SSE uses query token (EventSource limitation) — documented
  • Proxy headers only when TrustProxyHeaders true
  • Tests cover open / token / proxy paths
  • Local smoke: 401 without token, 200 with Bearer, health 200

Decision

Looks good to merge after CI green.

@ArianAr
ArianAr enabled auto-merge (squash) July 16, 2026 17:52
Comment thread frontend/src/App.jsx Dismissed
Add shared-token and proxy-header auth middleware, dashboard token prompt,
SSE access_token query support, and docs for secure deployments.
@ArianAr
ArianAr force-pushed the feat/operator-auth branch from 0c3d8da to cf2bfb9 Compare July 16, 2026 17:57
@ArianAr
ArianAr merged commit 6c20dd9 into main Jul 16, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Go server and API enhancement New feature or request frontend React dashboard security Security related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants