navi/backend/services/navi_admin
malice 05b614a22f decouple: add /api/auth/whoami to navi-admin (preparing recon migration)
PR-A of the 2-PR whoami migration. Net-new, additive endpoint in navi-admin
matching recon's existing handler shape exactly. Recon's handler stays live in
this PR; once nginx routes /api/auth/whoami to :8427 (out-of-band) and recon's
handler is removed (PR-B), navi-admin is the sole owner.

- New services/navi_admin/auth_route.py with its own blueprint (navi_admin_auth):
  GET /api/auth/whoami reads X-Authentik-Username, returns {authenticated,
  username}. NOT @require_auth — it's the "am I logged in?" check, must answer
  the unauthenticated case (mirrors recon).
- app.py: register the new blueprint (2 lines).
- test_auth.py: header-present + header-absent cases.

Kept in its own blueprint/file so admin_route.py's "all routes @require_auth"
invariant stays true. recon and nginx untouched (additive only).

Co-authored-by: Matt Johnson <mj@k7zvx.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 13:23:55 -06:00
..
tests decouple: add /api/auth/whoami to navi-admin (preparing recon migration) 2026-05-23 13:23:55 -06:00
__init__.py Add navi-admin service (extraction #7) (#7) 2026-05-22 21:21:00 -06:00
admin_route.py decouple: drop navi-admin → recon /api/health coupling 2026-05-23 13:14:09 -06:00
app.py decouple: add /api/auth/whoami to navi-admin (preparing recon migration) 2026-05-23 13:23:55 -06:00
auth_route.py decouple: add /api/auth/whoami to navi-admin (preparing recon migration) 2026-05-23 13:23:55 -06:00
fleet.py decouple: drop navi-admin → recon /api/health coupling 2026-05-23 13:14:09 -06:00