From 1e66d4b53ea0e6c414f6c0ef25fbbebba224e70b Mon Sep 17 00:00:00 2001 From: Manish Kumar Gupta Date: Wed, 30 Jul 2025 19:05:25 -0700 Subject: [PATCH 1/3] Remove configuration endpoint and update related test to expect 404 --- pctiler/pctiler/endpoints/configuration.py | 18 ------------------ pctiler/pctiler/main.py | 7 ------- pctiler/tests/endpoints/test_config.py | 4 ++-- 3 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 pctiler/pctiler/endpoints/configuration.py diff --git a/pctiler/pctiler/endpoints/configuration.py b/pctiler/pctiler/endpoints/configuration.py deleted file mode 100644 index 1b4ce74b..00000000 --- a/pctiler/pctiler/endpoints/configuration.py +++ /dev/null @@ -1,18 +0,0 @@ -from fastapi import APIRouter - -from pccommon.credential import PcDefaultAzureCredential -from pctiler.models import AzMapsToken - -tokenProvider = PcDefaultAzureCredential() -configuration_router = APIRouter() - - -@configuration_router.get("/map/token", response_model=AzMapsToken) -def get_azmaps_token() -> AzMapsToken: - """ - Fetch a token for the Azure Maps API service based on the current - service identity. This token is used for the Explorer to authenticate - with the Azure Maps API service. - """ - accessToken = tokenProvider.get_token("https://atlas.microsoft.com/.default") - return AzMapsToken(token=accessToken.token, expires_on=accessToken.expires_on) diff --git a/pctiler/pctiler/main.py b/pctiler/pctiler/main.py index f82ff17d..e09a67cc 100755 --- a/pctiler/pctiler/main.py +++ b/pctiler/pctiler/main.py @@ -26,7 +26,6 @@ from pccommon.redis import connect_to_redis from pctiler.config import get_settings from pctiler.endpoints import ( - configuration, health, item, legend, @@ -114,12 +113,6 @@ async def lifespan(app: FastAPI) -> AsyncGenerator: tags=["Collection vector tile endpoints"], ) -app.include_router( - configuration.configuration_router, - prefix=settings.configuration_endpoint_prefix, - tags=["Map configuration endpoints"], -) - app.include_router(health.health_router, tags=["Liveliness/Readiness"]) add_timeout(app, settings.request_timeout) diff --git a/pctiler/tests/endpoints/test_config.py b/pctiler/tests/endpoints/test_config.py index 22abcaef..7c82d046 100644 --- a/pctiler/tests/endpoints/test_config.py +++ b/pctiler/tests/endpoints/test_config.py @@ -6,5 +6,5 @@ @pytest.mark.integration async def test_config_token_endpoint(client: AsyncClient) -> None: response = await client.get("/config/map/token") - assert response.status_code == 200 - assert response.json()["token"] + # We expect this path to be not found + assert response.status_code == 404 From 2265c91d6ab0bcf6f1c57659b26592d890fc99b0 Mon Sep 17 00:00:00 2001 From: Manish Kumar Gupta Date: Wed, 30 Jul 2025 19:07:59 -0700 Subject: [PATCH 2/3] Linting --- pctiler/pctiler/main.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pctiler/pctiler/main.py b/pctiler/pctiler/main.py index e09a67cc..a8822bdf 100755 --- a/pctiler/pctiler/main.py +++ b/pctiler/pctiler/main.py @@ -25,13 +25,7 @@ from pccommon.openapi import fixup_schema from pccommon.redis import connect_to_redis from pctiler.config import get_settings -from pctiler.endpoints import ( - health, - item, - legend, - pg_mosaic, - vector_tiles, -) +from pctiler.endpoints import health, item, legend, pg_mosaic, vector_tiles from pctiler.middleware import ModifyResponseMiddleware # Get the root path if set in the environment From aea29e8c6008307e9888aa3b0a4b1e64367eff12 Mon Sep 17 00:00:00 2001 From: Gustavo Hidalgo Date: Thu, 31 Jul 2025 13:08:49 -0400 Subject: [PATCH 3/3] correctly specify build order --- deployment/bin/lib | 3 ++- docker-compose.dev.yml | 4 ++++ scripts/bin/test-stac | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/deployment/bin/lib b/deployment/bin/lib index 858ec5c8..8d0ca1a1 100755 --- a/deployment/bin/lib +++ b/deployment/bin/lib @@ -83,7 +83,8 @@ function cluster_login() { echo "Converting kubeconfig..." kubelogin convert-kubeconfig \ -l azurecli \ - --kubeconfig=kubeconfig + --kubeconfig=kubeconfig \ + --yes export KUBECONFIG=kubeconfig } diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index db217ddd..dcd860be 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -5,6 +5,8 @@ services: build: context: . dockerfile: pcstac/Dockerfile.dev + additional_contexts: + pc-apis-stac: "service:stac" environment: - ENVIRONMENT=development - POSTGRES_USER=username @@ -73,6 +75,8 @@ services: build: context: . dockerfile: pctiler/Dockerfile.dev + additional_contexts: + pc-apis-tiler: "service:tiler" environment: - ENVIRONMENT=development - FF_VRT="yes" diff --git a/scripts/bin/test-stac b/scripts/bin/test-stac index 41982cc3..73c1af2b 100755 --- a/scripts/bin/test-stac +++ b/scripts/bin/test-stac @@ -28,6 +28,6 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then flake8 pcstac/pcstac pcstac/tests echo "Running unit tests for stac..." - python3 -m pytest pcstac/tests + python3 -m pytest -vv pcstac/tests fi