Skip to content

Commit

Permalink
Fix AWS proxy extension not starting because of stale imports (#85)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
RobertLucian authored Nov 14, 2024
1 parent f10102f commit 3a0889a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions aws-replicator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ If you wish to access the deprecated instructions, they can be found [here](http

## Change Log

* `0.1.21`: Fix auth-related imports that prevent the AWS proxy from starting
* `0.1.20`: Fix logic for proxying S3 requests with `*.s3.amazonaws.com` host header
* `0.1.19`: Print human-readable message for invalid regexes in resource configs; fix logic for proxying S3 requests with host-based addressing
* `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)
Expand Down
16 changes: 8 additions & 8 deletions aws-replicator/aws_replicator/client/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
from aws_replicator.shared.models import ProxyConfig, ProxyServiceConfig

try:
from localstack.pro.core.bootstrap.auth import get_auth_headers
from localstack.pro.core.bootstrap.auth import get_platform_auth_headers
from localstack.pro.core.cli.aws import aws
from localstack.pro.core.config import is_api_key_configured
from localstack.pro.core.config import is_auth_token_configured
except ImportError:
# TODO remove once we don't need compatibility with <3.6 anymore
from localstack_ext.bootstrap.auth import get_auth_headers
from localstack_ext.cli.aws import aws
from localstack_ext.config import is_api_key_configured
# Only support anything over version 3.6
from localstack.pro.core.bootstrap.auth import get_auth_headers as get_platform_auth_headers
from localstack.pro.core.cli.aws import aws
from localstack.pro.core.config import is_api_key_configured as is_auth_token_configured


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

def should_load(self) -> bool:
return _is_logged_in() or is_api_key_configured()
return _is_logged_in() or is_auth_token_configured()

def attach(self, cli: LocalstackCli) -> None:
group: click.Group = cli.group
Expand All @@ -37,7 +37,7 @@ def attach(self, cli: LocalstackCli) -> None:
# TODO: remove over time as we're phasing out the `login` command
def _is_logged_in() -> bool:
try:
get_auth_headers()
get_platform_auth_headers()
return True
except Exception:
return False
Expand Down
2 changes: 1 addition & 1 deletion aws-replicator/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = localstack-extension-aws-replicator
version = 0.1.20
version = 0.1.21
summary = LocalStack AWS Proxy Extension
description = Proxy AWS resources into your LocalStack instance
long_description = file: README.md
Expand Down

0 comments on commit 3a0889a

Please sign in to comment.