Files
ServerKit/backend/tests/test_saml_metadata_unconfigured.py
T
Juan Denis d134af25ae Drop route try/excepts the 500 handler duplicates
33 routes wrapped their body in try/except Exception only to return
unexpected_response(e), which records the crash and answers the same
body the global 500 handler already does. Every site was directly in a
route function, so the handler sees the same exceptions. SAML metadata
relied on its wrapper for an unconfigured IdP; that is now a typed 404
instead of a logged crash on a public, probed route.
2026-10-10 18:14:28 -04:00

12 lines
424 B
Python

"""SAML metadata on a panel without SAML is a 404, not a recorded crash.
The route is public, so probes against unconfigured panels used to fill
the error log with an "unexpected" OneLogin settings error each time.
"""
def test_unconfigured_saml_metadata_is_404(client):
resp = client.get('/api/v1/sso/saml/metadata')
assert resp.status_code == 404
assert resp.get_json()['code'] == 'sso.saml_not_configured'