Skip to content

feat(security): add token auth to admin/debug endpoints - #8

Open
capy-ai[bot] wants to merge 1 commit into
mainfrom
capy/admin-token-auth
Open

feat(security): add token auth to admin/debug endpoints#8
capy-ai[bot] wants to merge 1 commit into
mainfrom
capy/admin-token-auth

Conversation

@capy-ai

@capy-ai capy-ai Bot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

This PR secures admin and debug endpoints by requiring a token read from NITTER_ADMIN_TOKEN instead of only checking enableAdmin. Routes exposing sensitive session internals now return 401/403 without valid authentication.

Authentication

  • Add constantTimeEqual for timing-safe token comparison
  • Add requireAdminAuth template validating Authorization: Bearer <token> or ?token= param
  • Routes require token: /.sessions, /api/private/sessions, /api/private/meta

Exposure reduction

  • /.health and /api/private/health return minimal {"status":"ok","sessions":<count>} instead of full session pool details

Open in Capy SCO-6 · 5.4

@capy-ai capy-ai Bot added the capy Generated by capy.ai label Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant