authorization: specifically identify basic auth
Raise an exception when a request with Basic Auth is received, however do not log the username/password. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
dfb8da6e3e
commit
245053434f
|
@ -533,6 +533,8 @@ class Authorization:
|
||||||
else:
|
else:
|
||||||
if auth_token.startswith("Bearer "):
|
if auth_token.startswith("Bearer "):
|
||||||
auth_token = auth_token[7:]
|
auth_token = auth_token[7:]
|
||||||
|
elif auth_token.startswith("Basic "):
|
||||||
|
raise HTTPError(401, "Basic Auth is not supported")
|
||||||
else:
|
else:
|
||||||
raise HTTPError(
|
raise HTTPError(
|
||||||
401, f"Invalid Authorization Header: {auth_token}")
|
401, f"Invalid Authorization Header: {auth_token}")
|
||||||
|
|
Loading…
Reference in New Issue