From 9ffd9c404afe6b29349f63c7509600df8799d952 Mon Sep 17 00:00:00 2001 From: Felix Delattre Date: Fri, 13 Dec 2024 13:07:25 +0100 Subject: [PATCH] Removed auth from runtime. --- runtimes/eoapi/stac/eoapi/stac/app.py | 17 ----------------- runtimes/eoapi/stac/pyproject.toml | 1 - 2 files changed, 18 deletions(-) diff --git a/runtimes/eoapi/stac/eoapi/stac/app.py b/runtimes/eoapi/stac/eoapi/stac/app.py index df5fc59..854ecba 100644 --- a/runtimes/eoapi/stac/eoapi/stac/app.py +++ b/runtimes/eoapi/stac/eoapi/stac/app.py @@ -3,7 +3,6 @@ import logging from contextlib import asynccontextmanager -from eoapi.auth_utils import OpenIdConnectAuth, OpenIdConnectSettings from fastapi import FastAPI from fastapi.responses import ORJSONResponse from stac_fastapi.api.app import StacApi @@ -49,7 +48,6 @@ templates = Jinja2Templates(directory=str(resources_files(__package__) / "templates")) # type: ignore api_settings = ApiSettings() -auth_settings = OpenIdConnectSettings() settings = Settings(enable_response_models=True) # Logs @@ -133,10 +131,6 @@ async def lifespan(app: FastAPI): openapi_url="/api", docs_url="/api.html", redoc_url=None, - swagger_ui_init_oauth={ - "clientId": auth_settings.client_id, - "usePkceWithAuthorizationCodeGrant": auth_settings.use_pkce, - }, ), title=api_settings.name, description=api_settings.name, @@ -167,14 +161,3 @@ async def viewer_page(request: Request): @app.get("/healthz", response_class=JSONResponse) async def healthz_page(request: Request): return JSONResponse({'ping': 'pong!'}) - -if auth_settings.openid_configuration_url: - oidc_auth = OpenIdConnectAuth.from_settings(auth_settings) - - restricted_prefixes = ["/collections", "/search"] - for route in app.routes: - if any( - route.path.startswith(f"{app.root_path}{prefix}") - for prefix in restricted_prefixes - ): - oidc_auth.apply_auth_dependencies(route, required_token_scopes=[]) diff --git a/runtimes/eoapi/stac/pyproject.toml b/runtimes/eoapi/stac/pyproject.toml index 4fa1b52..45e5c74 100644 --- a/runtimes/eoapi/stac/pyproject.toml +++ b/runtimes/eoapi/stac/pyproject.toml @@ -24,7 +24,6 @@ dependencies = [ "starlette-cramjam>=0.3,<0.4", "importlib_resources>=1.1.0;python_version<'3.9'", "psycopg_pool", - "eoapi.auth-utils>=0.2.0", "uvicorn>=0.32.1", ]