Skip to content

Commit 0eea2bc

Browse files
author
EhteshamSid
committed
chore(integration): bump cryptography to 46.0.6
1 parent aaad3ea commit 0eea2bc

File tree

13 files changed

+39
-33
lines changed

13 files changed

+39
-33
lines changed

samcli/lib/sync/infra_sync_executor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class InfraSyncResult:
7272
_infra_sync_executed: bool
7373
_code_sync_resources: Set[ResourceIdentifier]
7474

75-
def __init__(self, executed: bool, code_sync_resources: Set[ResourceIdentifier] = set()) -> None:
75+
def __init__(self, executed: bool, code_sync_resources: Set[ResourceIdentifier] = None) -> None:
7676
"""
7777
Constructor
7878
@@ -83,6 +83,8 @@ def __init__(self, executed: bool, code_sync_resources: Set[ResourceIdentifier]
8383
code_sync_resources: Set[ResourceIdentifier]
8484
Resources that needs a code sync
8585
"""
86+
if code_sync_resources is None:
87+
code_sync_resources = set()
8688
self._infra_sync_executed = executed
8789
self._code_sync_resources = code_sync_resources
8890

samcli/local/lambdafn/remote_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def unzip_from_uri(uri, layer_zip_path, unzip_output_dir, progressbar_label, mou
3131
Label to use in the Progressbar
3232
"""
3333
try:
34-
get_request = requests.get(uri, stream=True, verify=os.environ.get("AWS_CA_BUNDLE") or True)
34+
get_request = requests.get(uri, stream=True, verify=os.environ.get("AWS_CA_BUNDLE") or True, timeout=10.0)
3535

3636
with open(layer_zip_path, "wb") as local_layer_file:
3737
file_length = int(get_request.headers["Content-length"])

tests/integration/durable_integ_base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,13 @@ def log_output():
143143
def assert_invoke_output(
144144
self,
145145
stdout: str,
146-
input_data: Dict[str, Any] = {},
146+
input_data: Dict[str, Any] = None,
147147
execution_name: Optional[str] = None,
148148
expected_status: str = "SUCCEEDED",
149149
) -> str:
150150
"""Assert invoke output contains expected fields and return execution ARN."""
151+
if input_data is None:
152+
input_data = {}
151153
stdout_str = stdout.strip()
152154

153155
self.assertIn("Execution Summary:", stdout_str, f"Expected execution summary in output: {stdout_str}")

tests/integration/local/start_api/test_start_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,7 +1626,7 @@ def test_cors_swagger_options(self, origin):
16261626
"""
16271627
This tests that the Cors headers are added to OPTIONS responses
16281628
"""
1629-
response = requests.options(self.url + "/echobase64eventbody", **_create_request_params(origin))
1629+
response = requests.options(self.url + "/echobase64eventbody", **_create_request_params(origin), timeout=10.0)
16301630
self.assert_cors(response)
16311631

16321632
@parameterized.expand(["https://abc", None])
@@ -1636,7 +1636,7 @@ def test_cors_swagger_get(self, origin):
16361636
"""
16371637
This tests that the Cors headers are added to _other_ method responses
16381638
"""
1639-
response = requests.get(self.url + "/echobase64eventbody", **_create_request_params(origin))
1639+
response = requests.get(self.url + "/echobase64eventbody", **_create_request_params(origin), timeout=10.0)
16401640
self.assert_cors(response)
16411641

16421642

@@ -1762,7 +1762,7 @@ def test_cors_global(self, origin):
17621762
"""
17631763
This tests that the Cors headers are added to OPTIONS response when the global property is set
17641764
"""
1765-
response = requests.options(self.url + "/echobase64eventbody", **_create_request_params(origin))
1765+
response = requests.options(self.url + "/echobase64eventbody", **_create_request_params(origin), timeout=10.0)
17661766

17671767
self.assertEqual(response.status_code, 200)
17681768
self.assertEqual(response.headers.get("Access-Control-Allow-Origin"), "*")

tests/integration/logs/test_logs_command.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def _test_apigw_logs(self, apigw_name, path):
121121
apigw_url = f"{self._get_output_value(apigw_name_from_output)}{path}"
122122
# make couple of requests to warm-up APIGW to write its logs to CW
123123
for i in range(APIGW_REQUESTS_TO_WARM_UP):
124-
apigw_result = requests.get(apigw_url)
124+
apigw_result = requests.get(apigw_url, timeout=10.0)
125125
LOG.info("APIGW result %s", apigw_result)
126126
cmd_list = self.get_logs_command_list(self.stack_name, name=apigw_name)
127127
self._check_logs(cmd_list, [f"HTTP Method: GET, Resource Path: /{path}"])
@@ -138,7 +138,7 @@ def _test_end_to_end_apigw(self, apigw_name, path):
138138
# apigw name in output section doesn't have forward slashes
139139
apigw_name_from_output = apigw_name.replace("/", "")
140140
apigw_url = f"{self._get_output_value(apigw_name_from_output)}{path}"
141-
apigw_result = requests.get(apigw_url)
141+
apigw_result = requests.get(apigw_url, timeout=10.0)
142142
LOG.info("APIGW result %s", apigw_result)
143143
cmd_list = self.get_logs_command_list(self.stack_name)
144144
self._check_logs(
@@ -154,7 +154,7 @@ def _test_end_to_end_sfn(self, apigw_name, path):
154154
# apigw name in output section doesn't have forward slashes
155155
apigw_name_from_output = apigw_name.replace("/", "")
156156
apigw_url = f"{self._get_output_value(apigw_name_from_output)}{path}"
157-
apigw_result = requests.get(apigw_url)
157+
apigw_result = requests.get(apigw_url, timeout=10.0)
158158
LOG.info("APIGW result %s", apigw_result)
159159
cmd_list = self.get_logs_command_list(self.stack_name)
160160
self._check_logs(

tests/integration/sync/sync_integ_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def _extract_contents_from_layer_zip(dep_dir, zipped_layer):
204204
def get_layer_contents(self, arn, dep_dir):
205205
layer = self.lambda_client.get_layer_version_by_arn(Arn=arn)
206206
layer_location = layer.get("Content", {}).get("Location", "")
207-
zipped_layer = requests.get(layer_location)
207+
zipped_layer = requests.get(layer_location, timeout=10.0)
208208
return SyncIntegBase._extract_contents_from_layer_zip(dep_dir, zipped_layer)
209209

210210
def get_dependency_layer_contents_from_arn(self, stack_resources, dep_dir, version):
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
numpy<1.20.3; python_version < '3.10'
22
numpy==1.26.4; python_version >= '3.10'
3-
cryptography==3.3.2
3+
cryptography==46.0.6

tests/integration/testdata/sync/nested/after/root_function/root_function.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
import requests
55

6+
67
def lambda_handler(event, context):
78
"""Sample pure Lambda function that returns a message and a location"""
89

910
try:
10-
ip = requests.get("http://checkip.amazonaws.com/")
11+
ip = requests.get("http://checkip.amazonaws.com/", timeout=10.0)
1112
except requests.RequestException as e:
1213
# Send some context about this error to Lambda Logs
1314
print(e)
@@ -16,8 +17,5 @@ def lambda_handler(event, context):
1617

1718
return {
1819
"statusCode": 200,
19-
"body": json.dumps({
20-
"message": f"{layer_method()+6}",
21-
"location": ip.text.replace("\n", "")
22-
}),
23-
}
20+
"body": json.dumps({"message": f"{layer_method()+6}", "location": ip.text.replace("\n", "")}),
21+
}

tests/integration/testdata/sync/nested/before/root_function/root_function.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
import requests
55

6+
67
def lambda_handler(event, context):
78
"""Sample pure Lambda function that returns a message and a location"""
89

910
try:
10-
ip = requests.get("http://checkip.amazonaws.com/")
11+
ip = requests.get("http://checkip.amazonaws.com/", timeout=10.0)
1112
except requests.RequestException as e:
1213
# Send some context about this error to Lambda Logs
1314
print(e)
@@ -16,8 +17,5 @@ def lambda_handler(event, context):
1617

1718
return {
1819
"statusCode": 200,
19-
"body": json.dumps({
20-
"message": f"{layer_method()+6}",
21-
"location": ip.text.replace("\n", "")
22-
}),
23-
}
20+
"body": json.dumps({"message": f"{layer_method()+6}", "location": ip.text.replace("\n", "")}),
21+
}

tests/integration/testdata/sync/nested_intrinsics/before/child_stack/child_function/function/function.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
# import numpy as np
55
import requests
66

7+
78
def lambda_handler(event, context):
89
"""Sample pure Lambda function that returns a message and a location"""
910

1011
try:
11-
ip = requests.get("http://checkip.amazonaws.com/")
12+
ip = requests.get("http://checkip.amazonaws.com/", timeout=10.0)
1213
except requests.RequestException as e:
1314
# Send some context about this error to Lambda Logs
1415
print(e)
@@ -17,9 +18,11 @@ def lambda_handler(event, context):
1718

1819
return {
1920
"statusCode": 200,
20-
"body": json.dumps({
21-
"message": f"{layer_method()+1}",
22-
"location": ip.text.replace("\n", "")
23-
# "extra_message": np.array([1, 2, 3, 4, 5, 6]).tolist() # checking external library call will succeed
24-
}),
25-
}
21+
"body": json.dumps(
22+
{
23+
"message": f"{layer_method()+1}",
24+
"location": ip.text.replace("\n", ""),
25+
# "extra_message": np.array([1, 2, 3, 4, 5, 6]).tolist() # checking external library call will succeed
26+
}
27+
),
28+
}

0 commit comments

Comments
 (0)