8000 migrate to LOCALSTACK_AUTH_TOKEN (#11767) · localstack/localstack@37b129f · GitHub
[go: up one dir, main page]

Skip to content

Commit 37b129f

Browse files
authored
migrate to LOCALSTACK_AUTH_TOKEN (#11767)
1 parent 0896c3c commit 37b129f

File tree

7 files changed

+13
-11
lines changed

7 files changed

+13
-11
lines changed

.github/workflows/tests-pro-integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ jobs:
309309
env:
310310
DEBUG: 1
311311
DNS_ADDRESS: 0
312-
LOCALSTACK_API_KEY: "test"
312+
LOCALSTACK_AUTH_TOKEN: "test"
313313
working-directory: localstack-ext
314314
run: |
315315
source .venv/bin/activate
@@ -338,7 +338,7 @@ jobs:
338338
DISABLE_BOTO_RETRIES: 1
339339
DNS_ADDRESS: 0
340340
LAMBDA_EXECUTOR: "local"
341-
LOCALSTACK_API_KEY: "test"
341+
LOCALSTACK_AUTH_TOKEN: "test"
342342
AWS_SECRET_ACCESS_KEY: "test"
343343
AWS_ACCESS_KEY_ID: "test"
344344
AWS_DEFAULT_REGION: "us-east-1"

localstack-core/localstack/dev/kubernetes/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def generate_k8s_cluster_overrides(
122122
if pro:
123123
extra_env_vars.append(
124124
{
125-
"name": "LOCALSTACK_API_KEY",
125+
"name": "LOCALSTACK_AUTH_TOKEN",
126126
"value": "test",
127127
}
128128
)

localstack-core/localstack/dev/run/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def run(
139139
140140
\b
141141
python -m localstack.dev.run
142-
python -m localstack.dev.run -e DEBUG=1 -e LOCALSTACK_API_KEY=test
142+
python -m localstack.dev.run -e DEBUG=1 -e LOCALSTACK_AUTH_TOKEN=test
143143
python -m localstack.dev.run -- bash -c 'echo "hello"'
144144
145145
Explanations and more examples:
@@ -151,7 +151,7 @@ def run(
151151
152152
If you start localstack-pro, you might also want to add the API KEY as environment variable::
153153
154-
python -m localstack.dev.run -e DEBUG=1 -e LOCALSTACK_API_KEY=test
154+
python -m localstack.dev.run -e DEBUG=1 -e LOCALSTACK_AUTH_TOKEN=test
155155
156156
If your local changes are making modifications to plux plugins (e.g., adding new providers or hooks),
157157
then you also want to mount the newly generated entry_point.txt files into the container::

localstack-core/localstack/testing/pytest/container.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ def __call__(
6161
# handle the convenience options
6262
if pro:
6363
container_configuration.env_vars["GATEWAY_LISTEN"] = "0.0.0.0:4566,0.0.0.0:443"
64-
container_configuration.env_vars["LOCALSTACK_API_KEY"] = os.environ.get(
65-
"LOCALSTACK_API_KEY", "test"
64+
container_configuration.env_vars["LOCALSTACK_AUTH_TOKEN"] = os.environ.get(
65+
"LOCALSTACK_AUTH_TOKEN", "test"
6666
)
6767

6868
# override values from kwargs

localstack-core/localstack/utils/bootstrap.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def get_docker_image_to_start():
455455
image_name = os.environ.get("IMAGE_NAME")
456456
if not image_name:
457457
image_name = constants.DOCKER_IMAGE_NAME
458-
if is_api_key_configured():
458+
if is_auth_token_configured():
459459
image_name = constants.DOCKER_IMAGE_NAME_PRO
460460
return image_name
461461

@@ -1358,10 +1358,11 @@ def in_ci():
13581358
return False
13591359

13601360

1361-
def is_api_key_configured() -> bool:
1361+
def is_auth_token_configured() -> bool:
13621362
"""Whether an API key is set in the environment."""
13631363
return (
13641364
True
1365-
if os.environ.get("LOCALSTACK_API_KEY") and os.environ.get("LOCALSTACK_API_KEY").strip()
1365+
if os.environ.get("LOCALSTACK_AUTH_TOKEN", "").strip()
1366+
or os.environ.get("LOCALSTACK_API_KEY", "").strip()
13661367
else False
13671368
)

tests/bootstrap/test_container_configurators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def test_default_localstack_container_configurator(
116116
from localstack import config
117117

118118
monkeypatch.setenv("DEBUG", "1")
119+
monkeypatch.setenv("LOCALSTACK_AUTH_TOKEN", "")
119120
monkeypatch.setenv("LOCALSTACK_API_KEY", "")
120121
monkeypatch.setenv("ACTIVATE_PRO", "0")
121122
monkeypatch.setattr(config, "DEBUG", True)

tests/unit/cli/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_validate_config(runner, monkeypatch, tmp_path):
168168
- SERVICES=${SERVICES- }
169169
- DEBUG=${DEBUG- }
170170
- DATA_DIR=${DATA_DIR- }
171-
- LOCALSTACK_API_KEY=${LOCALSTACK_API_KEY- }
171+
- LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN- }
172172
- KINESIS_ERROR_PROBABILITY=${KINESIS_ERROR_PROBABILITY- }
173173
- DOCKER_HOST=unix:///var/run/docker.sock
174174
volumes:

0 commit comments

Comments
 (0)
0