mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-02 13:15:17 +09:00
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.
12 lines
424 B
Python
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'
|