Renamed digest_auth_state to _digest_auth_state as the state stored in the request instance.
This commit is contained in:
parent
4990de085c
commit
84b9c5f62e
@ -355,8 +355,8 @@ class DigestAuth:
|
|||||||
|
|
||||||
:return: None.
|
:return: None.
|
||||||
"""
|
"""
|
||||||
state: AuthState = request.digest_auth_state \
|
state: AuthState = getattr(request, "_digest_auth_state") \
|
||||||
if hasattr(request, "digest_auth_state") \
|
if hasattr(request, "_digest_auth_state") \
|
||||||
else AuthState()
|
else AuthState()
|
||||||
response: Response = Response()
|
response: Response = Response()
|
||||||
response.status = 401
|
response.status = 401
|
||||||
@ -372,7 +372,7 @@ class DigestAuth:
|
|||||||
:return: The authenticated user, or None if the
|
:return: The authenticated user, or None if the
|
||||||
authentication fails
|
authentication fails
|
||||||
"""
|
"""
|
||||||
request.digest_auth_state = AuthState()
|
request._digest_auth_state = AuthState()
|
||||||
authorization: Authorization = req.authorization
|
authorization: Authorization = req.authorization
|
||||||
try:
|
try:
|
||||||
if authorization is None:
|
if authorization is None:
|
||||||
@ -380,7 +380,7 @@ class DigestAuth:
|
|||||||
if authorization.type != "digest":
|
if authorization.type != "digest":
|
||||||
raise UnauthorizedException(
|
raise UnauthorizedException(
|
||||||
"Not an HTTP digest authorization")
|
"Not an HTTP digest authorization")
|
||||||
self.__authenticate(request.digest_auth_state)
|
self.__authenticate(request._digest_auth_state)
|
||||||
user = login_manager.user_callback(
|
user = login_manager.user_callback(
|
||||||
authorization.username)
|
authorization.username)
|
||||||
login_user(user)
|
login_user(user)
|
||||||
|
Loading…
Reference in New Issue
Block a user