Skip to content

Commit 49b5a01

Browse files
committed
fix recent config change
1 parent 43452a3 commit 49b5a01

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

Diff for: aws-replicator/aws_replicator/client/auth_proxy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def register_in_instance(self):
145145
if not port:
146146
raise Exception("Proxy currently not running")
147147
url = f"{external_service_url()}{HANDLER_PATH_PROXIES}"
148-
data = AddProxyRequest(port=port, config=self.config)
148+
data = AddProxyRequest(port=port, config=self.config, env_vars={})
149149
LOG.debug("Registering new proxy in main container via: %s", url)
150150
try:
151151
response = requests.post(url, json=data)

Diff for: aws-replicator/aws_replicator/server/aws_request_forwarder.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
import requests
77
from localstack.aws.api import RequestContext
88
from localstack.aws.chain import Handler, HandlerChain
9-
from localstack.constants import (
10-
APPLICATION_JSON,
11-
LOCALHOST,
12-
LOCALHOST_HOSTNAME,
13-
TEST_AWS_ACCESS_KEY_ID,
14-
)
9+
from localstack.constants import APPLICATION_JSON, LOCALHOST, LOCALHOST_HOSTNAME
1510
from localstack.http import Response
11+
12+
try:
13+
from localstack.constants import TEST_AWS_ACCOUNT_ID
14+
except ImportError:
15+
# compatibility with localstack 3.5
16+
from localstack.testing.config import TEST_AWS_ACCOUNT_ID
1617
from localstack.utils.aws import arns
1718
from localstack.utils.aws.arns import sqs_queue_arn
1819
from localstack.utils.aws.aws_stack import get_valid_regions
@@ -192,6 +193,7 @@ def _extract_region_from_domain(self, context: RequestContext):
192193
context.request.headers["Authorization"] = mock_aws_request_headers(
193194
context.service.service_name,
194195
region_name=part,
196+
# FIXME: TEST_AWS_ACCESS_KEY_ID should only be used in testing
195197
aws_access_key_id=TEST_AWS_ACCESS_KEY_ID,
196198
)
197199
return

Diff for: aws-replicator/tests/test_proxy_requests.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
import pytest
77
from botocore.exceptions import ClientError
88
from localstack.aws.connect import connect_to
9-
from localstack.constants import TEST_AWS_ACCOUNT_ID
9+
10+
try:
11+
from localstack.constants import TEST_AWS_ACCOUNT_ID
12+
except ImportError:
13+
# compatibility with localstack 3.5
14+
from localstack.testing.config import TEST_AWS_ACCOUNT_ID
15+
1016
from localstack.utils.aws.arns import sqs_queue_arn, sqs_queue_url_for_arn
1117
from localstack.utils.sync import retry
1218

@@ -23,7 +29,8 @@ def start_aws_proxy():
2329

2430
def _start(config: dict = None):
2531
proxy = start_aws_auth_proxy(config)
26-
proxy.wait_is_up()
32+
if not proxy.wait_is_up(timeout=10):
33+
raise TimeoutError(f"Gave up waiting for proxy to start on {proxy.url}")
2734
proxies.append(proxy)
2835
return proxy
2936

0 commit comments

Comments
 (0)