mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-18 07:11:48 -05:00
Added a test for the case when there is no secret for the api client.
Fix codestyle
This commit is contained in:
@@ -29,7 +29,6 @@ def requires_auth():
|
||||
if api_client is None:
|
||||
authentication_response("Invalid credentials", 403)
|
||||
|
||||
errors_resp = None
|
||||
for secret in api_client['secret']:
|
||||
try:
|
||||
decode_jwt_token(
|
||||
@@ -50,10 +49,6 @@ def requires_auth():
|
||||
except TokenDecodeError:
|
||||
errors_resp = authentication_response("Invalid token: signature", 403)
|
||||
|
||||
if errors_resp is None:
|
||||
# If we got this far with out any errors then the api client has no secrets
|
||||
errors_resp = authentication_response("Invalid token: api client has no secrets", 403)
|
||||
|
||||
return errors_resp
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user