Skip to content

Commit 3a0889a

Browse files
authored
Fix AWS proxy extension not starting because of stale imports (#85)
* Attempt to fix refactored imports * Format and lint * Temporarily change pip package * Revert "Temporarily change pip package" This reverts commit 7f5dbc9. * Create 0.1.21 release
1 parent f10102f commit 3a0889a

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

aws-replicator/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ If you wish to access the deprecated instructions, they can be found [here](http
126126

127127
## Change Log
128128

129+
* `0.1.21`: Fix auth-related imports that prevent the AWS proxy from starting
129130
* `0.1.20`: Fix logic for proxying S3 requests with `*.s3.amazonaws.com` host header
130131
* `0.1.19`: Print human-readable message for invalid regexes in resource configs; fix logic for proxying S3 requests with host-based addressing
131132
* `0.1.18`: Update environment check to use SDK Docker client and enable starting the proxy from within Docker (e.g., from the LS main container as part of an init script)

aws-replicator/aws_replicator/client/cli.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@
1010
from aws_replicator.shared.models import ProxyConfig, ProxyServiceConfig
1111

1212
try:
13-
from localstack.pro.core.bootstrap.auth import get_auth_headers
13+
from localstack.pro.core.bootstrap.auth import get_platform_auth_headers
1414
from localstack.pro.core.cli.aws import aws
15-
from localstack.pro.core.config import is_api_key_configured
15+
from localstack.pro.core.config import is_auth_token_configured
1616
except ImportError:
17-
# TODO remove once we don't need compatibility with <3.6 anymore
18-
from localstack_ext.bootstrap.auth import get_auth_headers
19-
from localstack_ext.cli.aws import aws
20-
from localstack_ext.config import is_api_key_configured
17+
# Only support anything over version 3.6
18+
from localstack.pro.core.bootstrap.auth import get_auth_headers as get_platform_auth_headers
19+
from localstack.pro.core.cli.aws import aws
20+
from localstack.pro.core.config import is_api_key_configured as is_auth_token_configured
2121

2222

2323
class AwsReplicatorPlugin(LocalstackCliPlugin):
2424
name = "aws-replicator"
2525

2626
def should_load(self) -> bool:
27-
return _is_logged_in() or is_api_key_configured()
27+
return _is_logged_in() or is_auth_token_configured()
2828

2929
def attach(self, cli: LocalstackCli) -> None:
3030
group: click.Group = cli.group
@@ -37,7 +37,7 @@ def attach(self, cli: LocalstackCli) -> None:
3737
# TODO: remove over time as we're phasing out the `login` command
3838
def _is_logged_in() -> bool:
3939
try:
40-
get_auth_headers()
40+
get_platform_auth_headers()
4141
return True
4242
except Exception:
4343
return False

aws-replicator/setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = localstack-extension-aws-replicator
3-
version = 0.1.20
3+
version = 0.1.21
44
summary = LocalStack AWS Proxy Extension
55
description = Proxy AWS resources into your LocalStack instance
66
long_description = file: README.md

0 commit comments

Comments
 (0)