feat(2-Schritt3): nginx-Cutover — App per Token-Link, Admin hinter Authelia
Sicherheits-Architektur umgestellt (live verifiziert): - App-Routen (/, /ws/) ohne Authelia -> Auth via Capability-Token-Cookie (Senioren: Ein-Klick-Link, kein 2FA). Remote-User wird in nginx HART geleert (Anti-Spoofing: App vertraut Remote-User von der Proxy-IP). - /api/admin/* (und /api/admin/log) zusätzlich hinter Authelia (Doppelschutz). - gate_web_ui: statt SSO-Redirect (würde nach Cutover schleifen) eine freundliche "Persönlicher Zugang nötig"-Hinweisseite (401). Endabnahme durch nginx: Link->303+Cookie, /api/me->200 (kein 2FA), Admin->302 Authelia, Header-Spoofing->401. DEPLOYMENT.md 2.8 aktualisiert. Test auf neue Hinweisseite angepasst. 219 passed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
bd55807a1c
commit
6e824d8f9b
3 changed files with 43 additions and 22 deletions
|
|
@ -88,15 +88,15 @@ def test_static_index_gated_without_auth(monkeypatch):
|
|||
assert r.status_code == 401
|
||||
|
||||
|
||||
def test_static_index_redirects_to_sso(monkeypatch):
|
||||
# Auth an, keine Identitaet, Login-URL gesetzt -> Redirect zum SSO-Portal.
|
||||
def test_static_index_shows_no_access_page(monkeypatch):
|
||||
# Auth an, keine Identitaet, kein Zugangslink -> freundliche Hinweisseite (401),
|
||||
# KEIN SSO-Redirect mehr (würde nach dem nginx-Cutover in eine Schleife laufen).
|
||||
monkeypatch.setattr(settings, "auth_enabled", True)
|
||||
monkeypatch.setattr(settings, "trusted_auth_header", "")
|
||||
monkeypatch.setattr(settings, "trusted_auth_cookie", "")
|
||||
monkeypatch.setattr(settings, "sso_login_url", "https://linix.de/yunohost/sso/")
|
||||
r = client.get("/", follow_redirects=False)
|
||||
assert r.status_code == 302
|
||||
assert r.headers["location"].startswith("https://linix.de/yunohost/sso/")
|
||||
assert r.status_code == 401
|
||||
assert "Persönlicher Zugang" in r.text
|
||||
|
||||
|
||||
def test_health_open_without_auth(monkeypatch):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue