Commit graph

6 commits

Author SHA1 Message Date
Johan Lundberg
6b6ff29b9a Harden forward-auth redirect and header handling
All checks were successful
publish-latest / docker (push) Successful in 22s
Tighten forward-auth return URL validation to reject unsafe host syntax,
including backslash-based browser/parser mismatches, and normalize
scheme/port matching so bare allowlist entries are HTTPS default-port
only. Support explicit scheme-qualified targets, including IPv6
host:port entries.

Always emit deterministic identity headers with empty values when
attributes are absent, zero unsafe header values, and clear stale
forward-auth return targets when OIDC or registration flows take
precedence.

Add regression coverage for wildcard redirect bypasses, scheme/port
handling, IPv6 allowlist entries, empty identity headers, unsafe header
values, and stale return-target cleanup. Update docs with proxy
header-stripping guidance and the new allowlist semantics.
2026-07-05 00:00:58 +02:00
Johan Lundberg
58da15c825 Implement reverse-proxy forward-auth
Add a /forward-auth endpoint that validates the existing Porchlight
session for reverse proxies and returns identity headers for
authenticated active users. Unauthenticated or inactive sessions
redirect to login, with optional post-login return targets reconstructed
from proxy headers and constrained by an allowed host list.

Also add forward_auth_allowed_redirect_hosts configuration, preserve
validated forward-auth return targets through login/session reset,
exempt the endpoint from CSRF for proxy subrequests, document
configuration, and cover the flow with tests.
2026-07-04 23:29:26 +02:00
Johan Lundberg
cedf2a65e2
fix: add session_https_only to dev config and update README 2026-02-19 15:10:37 +01:00
Johan Lundberg
8c91edf137
docs: add example config file and update README 2026-02-18 12:54:43 +01:00
Johan Lundberg
dee1b1e3bc
docs: update README with CLI commands and fix stale module name 2026-02-18 11:43:56 +01:00
Johan Lundberg
ec1c42b1d5
docs: add README with production and development setup instructions 2026-02-16 15:02:44 +01:00