Skip to content

Commit a7f8ec2

Browse files
tyrazieljohn-westcott-iv
authored andcommitted
Change logging level from info to debug when JWT token header is not present in the request.
1 parent 48fd1ec commit a7f8ec2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ansible_base/jwt_consumer/common/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def parse_jwt_token(self, request):
6666

6767
token_from_header = request.headers.get("X-DAB-JW-TOKEN", None)
6868
if not token_from_header:
69-
logger.info("X-DAB-JW-TOKEN header not set for JWT authentication")
69+
logger.debug("X-DAB-JW-TOKEN header not set for JWT authentication")
7070
return
7171
logger.debug(f"Received JWT auth token: {token_from_header}")
7272

test_app/tests/jwt_consumer/common/test_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_parse_jwt_no_request(self):
5555

5656
@pytest.mark.django_db
5757
def test_parse_jwt_no_header(self, caplog, mocked_http, shut_up_logging):
58-
with caplog.at_level(logging.INFO):
58+
with caplog.at_level(logging.DEBUG):
5959
my_auth = JWTCommonAuth()
6060
my_auth.parse_jwt_token(mocked_http.mocked_parse_jwt_token_get_request('without_headers'))
6161
assert "X-DAB-JW-TOKEN header not set for JWT authentication" in caplog.text

0 commit comments

Comments
 (0)