feat: flag session cookies Secure behind HTTPS proxies - #5
Merged
Conversation
The server now marks its session cookie Secure automatically when a login arrives with X-Forwarded-Proto: https — the standard reverse-proxy setup. Behavior is pinable via OMP_WEB_SECURE_COOKIE=true|false (or the config.json key secureCookie) for setups where forwarded headers cannot be trusted; the default remains "auto". Logout clears the cookie with the same flag. Tests cover auto-detection on/off, both override directions, and resolution precedence (env > config file). README documents the new env var and drops the manual "no Secure flag" caveat from the auth notes; roadmap item checked off.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Delivers roadmap item 1 (see #4 for the plan).
Behavior
Secureautomatically when a login arriveswith
X-Forwarded-Proto: https— the standard reverse-proxy setup. Logout'sclearing cookie carries the same flag.
OMP_WEB_SECURE_COOKIE=true|false(config.jsonkeysecureCookiealso works) for setups where forwarded headers cannot betrusted. Default stays
auto; plain HTTP keeps working as before.Resolution order
loadConfigoverride → env → config file →"auto".Tests
…; Secure, plainrequest does not; logout clear-cookie mirrors it
secureCookie: trueforces Secure without any header;secureCookie: falseignores the headerDocs: README auth bullet rewritten, env table gains
OMP_WEB_SECURE_COOKIE, roadmap item checked off.