Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 2139fd3

Browse files
committed
fix: update test expectations after removing Content-Type header
1 parent 077fd25 commit 2139fd3

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

google/auth/aws.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,11 @@ def _get_metadata_security_credentials(
530530
google.auth.exceptions.RefreshError: If an error occurs while
531531
retrieving the AWS security credentials.
532532
"""
533-
headers = None
534533
if imdsv2_session_token is not None:
535534
headers = {"X-aws-ec2-metadata-token": imdsv2_session_token}
535+
else:
536+
headers = None
537+
536538

537539
response = request(
538540
url="{}/{}".format(self._security_credentials_url, role_name),

tests/test_aws.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,6 @@ def test_retrieve_subject_token_success_temp_creds_no_environment_vars_idmsv2(
14301430
new_request.call_args_list[2][1],
14311431
"{}/{}".format(SECURITY_CREDS_URL, self.AWS_ROLE),
14321432
{
1433-
"Content-Type": "application/json",
14341433
"X-aws-ec2-metadata-token": self.AWS_IMDSV2_SESSION_TOKEN,
14351434
},
14361435
)
@@ -1487,7 +1486,6 @@ def test_retrieve_subject_token_success_temp_creds_environment_vars_missing_secr
14871486
request.call_args_list[2][1],
14881487
"{}/{}".format(SECURITY_CREDS_URL, self.AWS_ROLE),
14891488
{
1490-
"Content-Type": "application/json",
14911489
"X-aws-ec2-metadata-token": self.AWS_IMDSV2_SESSION_TOKEN,
14921490
},
14931491
)
@@ -1544,7 +1542,6 @@ def test_retrieve_subject_token_success_temp_creds_environment_vars_missing_acce
15441542
request.call_args_list[2][1],
15451543
"{}/{}".format(SECURITY_CREDS_URL, self.AWS_ROLE),
15461544
{
1547-
"Content-Type": "application/json",
15481545
"X-aws-ec2-metadata-token": self.AWS_IMDSV2_SESSION_TOKEN,
15491546
},
15501547
)
@@ -1595,7 +1592,6 @@ def test_retrieve_subject_token_success_temp_creds_environment_vars_missing_cred
15951592
request.call_args_list[2][1],
15961593
"{}/{}".format(SECURITY_CREDS_URL, self.AWS_ROLE),
15971594
{
1598-
"Content-Type": "application/json",
15991595
"X-aws-ec2-metadata-token": self.AWS_IMDSV2_SESSION_TOKEN,
16001596
},
16011597
)

0 commit comments

Comments
 (0)