tests for AuthenticationContext
This commit is contained in:
@@ -7,7 +7,9 @@ class AuthenticationContext():
|
||||
|
||||
def __init__(self, crl_validator, auth_status, sdn, cert):
|
||||
if None in locals().values():
|
||||
raise UnauthenticatedError("Missing required authentication context components")
|
||||
raise UnauthenticatedError(
|
||||
"Missing required authentication context components"
|
||||
)
|
||||
|
||||
self.crl_validator = crl_validator
|
||||
self.auth_status = auth_status
|
||||
@@ -15,7 +17,6 @@ class AuthenticationContext():
|
||||
self.cert = cert.encode()
|
||||
self._parsed_sdn = None
|
||||
|
||||
|
||||
def authenticate(self):
|
||||
if not self.auth_status == "SUCCESS":
|
||||
raise UnauthenticatedError("SSL/TLS client authentication failed")
|
||||
@@ -25,7 +26,6 @@ class AuthenticationContext():
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def get_user(self):
|
||||
try:
|
||||
return Users.get_by_dod_id(self.parsed_sdn["dod_id"])
|
||||
|
Reference in New Issue
Block a user