Skip to content

Commit

Permalink
Removed auth from runtime. (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
pantierra authored Dec 13, 2024
1 parent 557d894 commit 19e84c9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
17 changes: 0 additions & 17 deletions runtimes/eoapi/stac/eoapi/stac/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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=[])
1 change: 0 additions & 1 deletion runtimes/eoapi/stac/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]

Expand Down

0 comments on commit 19e84c9

Please sign in to comment.