Skip to content

Commit 109e7d1

Browse files
committed
fix: apply CR feedback
1 parent 74cb809 commit 109e7d1

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

tests/e2e/event_handler/test_header_serializer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from aws_lambda_powertools.shared.cookies import Cookie
77
from tests.e2e.utils import data_fetcher
8-
from tests.e2e.utils.auth import iam_auth
8+
from tests.e2e.utils.auth import build_iam_auth
99

1010

1111
@pytest.fixture
@@ -169,7 +169,7 @@ def test_api_gateway_http_headers_serializer(apigw_http_endpoint):
169169
method="POST",
170170
url=url,
171171
json={"body": body, "status_code": status_code, "headers": headers, "cookies": list(map(str, cookies))},
172-
auth=iam_auth(url, "execute-api"),
172+
auth=build_iam_auth(url=url, aws_service="execute-api"),
173173
)
174174
)
175175

@@ -206,7 +206,7 @@ def test_lambda_function_url_headers_serializer(lambda_function_url_endpoint):
206206
method="POST",
207207
url=url,
208208
json={"body": body, "status_code": status_code, "headers": headers, "cookies": list(map(str, cookies))},
209-
auth=iam_auth(url, "lambda"),
209+
auth=build_iam_auth(url=url, aws_service="lambda"),
210210
)
211211
)
212212

tests/e2e/event_handler/test_paths_ending_with_slash.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from requests import HTTPError, Request
33

44
from tests.e2e.utils import data_fetcher
5-
from tests.e2e.utils.auth import iam_auth
5+
from tests.e2e.utils.auth import build_iam_auth
66

77

88
@pytest.fixture
@@ -46,7 +46,7 @@ def test_api_gateway_rest_trailing_slash(apigw_rest_endpoint):
4646
method="POST",
4747
url=url,
4848
json={"body": body},
49-
auth=iam_auth(url, "lambda"),
49+
auth=build_iam_auth(url=url, aws_service="lambda"),
5050
)
5151
)
5252

@@ -67,7 +67,7 @@ def test_api_gateway_http_trailing_slash(apigw_http_endpoint):
6767
method="POST",
6868
url=url,
6969
json={"body": body},
70-
auth=iam_auth(url, "lambda"),
70+
auth=build_iam_auth(url=url, aws_service="lambda"),
7171
)
7272
)
7373

@@ -85,7 +85,7 @@ def test_lambda_function_url_trailing_slash(lambda_function_url_endpoint):
8585
method="POST",
8686
url=url,
8787
json={"body": body},
88-
auth=iam_auth(url, "lambda"),
88+
auth=build_iam_auth(url=url, aws_service="lambda"),
8989
)
9090
)
9191

@@ -103,6 +103,6 @@ def test_alb_url_trailing_slash(alb_multi_value_header_listener_endpoint):
103103
method="POST",
104104
url=url,
105105
json={"body": body},
106-
auth=iam_auth(url, "lambda"),
106+
auth=build_iam_auth(url=url, aws_service="lambda"),
107107
)
108108
)

tests/e2e/utils/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from aws_requests_auth.boto_utils import BotoAWSRequestsAuth
55

66

7-
def iam_auth(url: str, aws_service: str) -> BotoAWSRequestsAuth:
7+
def build_iam_auth(url: str, aws_service: str) -> BotoAWSRequestsAuth:
88
"""Generates IAM auth keys for a given hostname and service.
99
This can be directly passed on to the requests library to authenticate the request.
1010
"""

0 commit comments

Comments
 (0)