Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove auth from runtime. #116

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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