summaryrefslogtreecommitdiff
path: root/kvmd/plugins/auth
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-03-16 02:46:53 +0300
committerDevaev Maxim <[email protected]>2020-03-16 02:46:53 +0300
commitab6264bd5e65497121139eab6deae353e06d592f (patch)
tree890952bea2d2886e68d782f1a856452443604d49 /kvmd/plugins/auth
parent966267ebb9a89e1898c6009c7e85e5f837109aef (diff)
auth only on 200
Diffstat (limited to 'kvmd/plugins/auth')
-rw-r--r--kvmd/plugins/auth/http.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/kvmd/plugins/auth/http.py b/kvmd/plugins/auth/http.py
index 7e8d6c1e..66e23ea1 100644
--- a/kvmd/plugins/auth/http.py
+++ b/kvmd/plugins/auth/http.py
@@ -88,8 +88,9 @@ class Plugin(BaseAuthService):
},
) as response:
response.raise_for_status()
- assert response.status == 200
- return True
+ if response.status == 200:
+ return True
+ raise RuntimeError(f"Invalid OK response: {response.status} {await response.text()}; expected 200")
except Exception:
get_logger().exception("Failed HTTP auth request for user %r", user)
return False