Skip to content

Commit 47c549f

Browse files
committed
clean up old replicator code
1 parent 8b49a05 commit 47c549f

7 files changed

Lines changed: 12 additions & 592 deletions

File tree

aws-proxy/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This enables one flavor of "hybrid" or "remocal" setups where you can easily bri
77

88
⚠️ Please note that this extension is experimental and still under active development.
99

10-
⚠️ Note: Given that the scope of this extension has recently changed (see [below](#resource-replicator-cli-deprecated)) - it has been recently renamed from `aws-replicator` to `aws-proxy`.
10+
⚠️ Note: Given that the scope of this extension has recently changed (see [below](#resource-replicator-cli-deprecated)) - it has been renamed from `aws-replicator` to `aws-proxy`.
1111

1212
## Prerequisites
1313

@@ -120,13 +120,13 @@ In addition to the proxy services configuration shown above, the following confi
120120
## Resource Replicator CLI (deprecated)
121121

122122
Note: Previous versions of this extension also offered a "replicate" mode to copy/clone (rather than proxy) resources from an AWS account into the local instance.
123-
This functionality has been removed from this extension, and is now being migrated to a new extension (more details following soon).
123+
This functionality has been removed from this extension, and is now available directly in the LocalStack Pro image (see [here](https://docs.localstack.cloud/aws/tooling/aws-replicator)).
124124

125125
If you wish to access the deprecated instructions, they can be found [here](https://github.com/localstack/localstack-extensions/blob/fe0c97e8a9d94f72c80358493e51ce6c1da535dc/aws-replicator/README.md#resource-replicator-cli).
126126

127127
## Change Log
128128

129-
* `0.1.25`: Fix dynamodb proxying for read-only mode.
129+
* `0.1.25`: Fix dynamodb proxying for read-only mode
130130
* `0.1.24`: Fix healthcheck probe for proxy container
131131
* `0.1.23`: Fix unpinned React.js dependencies preventing webui from loading
132132
* `0.1.22`: Fix auth-related imports that prevent the AWS proxy from starting

aws-proxy/aws_proxy/client/auth_proxy.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
from localstack.config import external_service_url
1818
from localstack.constants import AWS_REGION_US_EAST_1, DOCKER_IMAGE_NAME_PRO, LOCALHOST_HOSTNAME
1919
from localstack.http import Request
20+
from localstack.pro.core.bootstrap.licensingv2 import (
21+
ENV_LOCALSTACK_API_KEY,
22+
ENV_LOCALSTACK_AUTH_TOKEN,
23+
)
2024
from localstack.utils.aws.aws_responses import requests_response
2125
from localstack.utils.bootstrap import setup_logging
2226
from localstack.utils.collections import select_attributes
@@ -37,18 +41,6 @@
3741

3842
from .http2_server import run_server
3943

40-
try:
41-
from localstack.pro.core.bootstrap.licensingv2 import (
42-
ENV_LOCALSTACK_API_KEY,
43-
ENV_LOCALSTACK_AUTH_TOKEN,
44-
)
45-
except ImportError:
46-
# TODO remove once we don't need compatibility with <3.6 anymore
47-
from localstack_ext.bootstrap.licensingv2 import (
48-
ENV_LOCALSTACK_API_KEY,
49-
ENV_LOCALSTACK_AUTH_TOKEN,
50-
)
51-
5244
LOG = logging.getLogger(__name__)
5345
LOG.setLevel(logging.INFO)
5446
if localstack_config.DEBUG:

aws-proxy/aws_proxy/client/cli.py

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,18 @@
44
import click
55
import yaml
66
from localstack.cli import LocalstackCli, LocalstackCliPlugin, console
7+
from localstack.pro.core.cli.aws import aws
8+
from localstack.pro.core.config import is_auth_token_configured
79
from localstack.utils.files import load_file
810

911
from aws_proxy.shared.models import ProxyConfig, ProxyServiceConfig
1012

11-
try:
12-
from localstack.pro.core.bootstrap.auth import get_platform_auth_headers
13-
from localstack.pro.core.cli.aws import aws
14-
from localstack.pro.core.config import is_auth_token_configured
15-
except ImportError:
16-
# Only support anything over version 3.6
17-
from localstack.pro.core.bootstrap.auth import get_auth_headers as get_platform_auth_headers
18-
from localstack.pro.core.cli.aws import aws
19-
from localstack.pro.core.config import is_api_key_configured as is_auth_token_configured
20-
2113

2214
class AwsProxyPlugin(LocalstackCliPlugin):
2315
name = "aws-proxy"
2416

2517
def should_load(self) -> bool:
26-
return _is_logged_in() or is_auth_token_configured()
18+
return is_auth_token_configured()
2719

2820
def attach(self, cli: LocalstackCli) -> None:
2921
group: click.Group = cli.group
@@ -32,15 +24,6 @@ def attach(self, cli: LocalstackCli) -> None:
3224
aws.add_command(cmd_aws_proxy)
3325

3426

35-
# TODO: remove over time as we're phasing out the `login` command
36-
def _is_logged_in() -> bool:
37-
try:
38-
get_platform_auth_headers()
39-
return True
40-
except Exception:
41-
return False
42-
43-
4427
@click.command(name="proxy", help="Start up an authentication proxy against real AWS")
4528
@click.option(
4629
"-s",

aws-proxy/aws_proxy/client/replicate.py

Lines changed: 0 additions & 265 deletions
This file was deleted.

0 commit comments

Comments
 (0)