Connect policy-gated browser review and audit runtime
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a07ff8-19d0-7820-b4d0-1353833cb7fc
This commit is contained in:
parent
2cc32168ac
commit
83849b75d4
35 changed files with 2381 additions and 83 deletions
|
|
@ -274,7 +274,7 @@ def test_issuer_error_and_duplicate_params_do_not_leak_or_exchange(login):
|
|||
|
||||
|
||||
@pytest.mark.parametrize("origin,csrf,expected", [(ORIGIN, "correct", 303), (ORIGIN, "wrong", 403),
|
||||
(None, "correct", 403), ("https://attacker.test", "correct", 403)])
|
||||
(None, "correct", 403), ("null", "correct", 403), ("https://attacker.test", "correct", 403)])
|
||||
def test_logout_requires_origin_and_session_csrf(login, origin, csrf, expected):
|
||||
sid = finish(login)
|
||||
token = login[0].session(sid).csrf if csrf == "correct" else "wrong"
|
||||
|
|
@ -284,6 +284,12 @@ def test_logout_requires_origin_and_session_csrf(login, origin, csrf, expected):
|
|||
assert bool(login[0].session(sid)) == (expected != 303)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("path,policy", [("/", "same-origin"), ("/review", "same-origin"),
|
||||
("/auth/callback", "no-referrer"), ("/presentations/pres-fixture/packet/0", "no-referrer")])
|
||||
def test_browser_referrer_policy_preserves_form_origin_and_protects_auth_urls(login, path, policy):
|
||||
assert dict(call(App(login[0]), path)["headers"])["Referrer-Policy"] == policy
|
||||
|
||||
|
||||
@pytest.mark.parametrize("path,method,expected", [("/healthz", "GET", 200), ("/readyz", "GET", 503),
|
||||
("/approvals/approval-fixture", "GET", 404), ("/approvals/approval-fixture/accept", "POST", 404),
|
||||
("/v1/approvals/approval-fixture/entries", "POST", 404), ("/auth/logout", "GET", 404)])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue