feat(auth): ADMIN_COOKIE_SECURE forces the session cookie Secure #51

Merged
sirius merged 1 commit from wt/t_e5a0c384 into master 2026-11-14 02:16:58 +00:00

2026-11-13

Hermes Backend
feat(auth): ADMIN_COOKIE_SECURE forces the session cookie Secure
Behind the cluster's HTTP origin listener Envoy normalizes
X-Forwarded-Proto to http, so _is_https() never fires and the session
cookie was issued without Secure. Add an explicit deploy-time flag:
set_session_cookie() now marks the cookie Secure when the env var is
1/true/yes (case-insensitive, stripped) or the header inference says
https. clear_session_cookie() is unchanged, SameSite stays Lax.

Tests cover flag-over-http, header-without-flag, and the local-dev path;
docs/auth.md and .env.example document the variable.
2026-11-13 21:15:05 -05:00