diff --git a/ingest_api/runtime/src/dependencies.py b/ingest_api/runtime/src/dependencies.py index f1276859..5c772c1f 100644 --- a/ingest_api/runtime/src/dependencies.py +++ b/ingest_api/runtime/src/dependencies.py @@ -2,11 +2,10 @@ import boto3 import src.services as services +from src.config import auth, settings from fastapi import Depends, HTTPException, security -from src.config import auth, settings - logger = logging.getLogger(__name__) token_scheme = security.HTTPBearer() diff --git a/ingest_api/runtime/src/main.py b/ingest_api/runtime/src/main.py index 2af6df6b..8074c860 100644 --- a/ingest_api/runtime/src/main.py +++ b/ingest_api/runtime/src/main.py @@ -1,12 +1,11 @@ from typing import Dict - import src.dependencies as dependencies import src.schemas as schemas import src.services as services from aws_lambda_powertools.metrics import MetricUnit from src.collection_publisher import CollectionPublisher, ItemPublisher -from src.config import settings, auth +from src.config import auth, settings from src.doc import DESCRIPTION from src.monitoring import LoggerRouteHandler, logger, metrics, tracer @@ -16,7 +15,6 @@ from fastapi.security import OAuth2PasswordRequestForm from starlette.requests import Request - app = FastAPI( title="VEDA Ingestion API", description=DESCRIPTION, diff --git a/stac_api/runtime/handler.py b/stac_api/runtime/handler.py index 26dfe4ea..176be13b 100644 --- a/stac_api/runtime/handler.py +++ b/stac_api/runtime/handler.py @@ -6,7 +6,6 @@ from src.app import app from src.monitoring import logger, metrics, tracer - logging.getLogger("mangum.lifespan").setLevel(logging.ERROR) logging.getLogger("mangum.http").setLevel(logging.ERROR) diff --git a/stac_api/runtime/src/app.py b/stac_api/runtime/src/app.py index 5aed1979..816fd5ee 100644 --- a/stac_api/runtime/src/app.py +++ b/stac_api/runtime/src/app.py @@ -9,6 +9,7 @@ from src.config import post_request_model as POSTModel from src.extension import TiTilerExtension +from common.auth import Auth from fastapi import APIRouter, FastAPI from fastapi.params import Depends from fastapi.responses import ORJSONResponse @@ -19,7 +20,6 @@ from starlette.templating import Jinja2Templates from starlette_cramjam.middleware import CompressionMiddleware -from common.auth import Auth from .api import VedaStacApi from .core import VedaCrudClient from .monitoring import LoggerRouteHandler, logger, metrics, tracer diff --git a/stac_api/runtime/src/routes.py b/stac_api/runtime/src/routes.py index 94e28351..ae0bae08 100644 --- a/stac_api/runtime/src/routes.py +++ b/stac_api/runtime/src/routes.py @@ -1,8 +1,9 @@ """Dependency injection in to fastapi routes""" from typing import List -from fastapi.params import Depends + from fastapi.dependencies.utils import get_parameterless_sub_dependant +from fastapi.params import Depends from fastapi.routing import APIRoute from starlette.routing import Match from starlette.types import Scope diff --git a/stac_api/runtime/src/validation.py b/stac_api/runtime/src/validation.py index f717e5fe..2c823603 100644 --- a/stac_api/runtime/src/validation.py +++ b/stac_api/runtime/src/validation.py @@ -4,15 +4,14 @@ import re from typing import Dict +from pydantic import BaseModel, Field, ValidationError +from src.config import ApiSettings +from stac_pydantic import Collection, Item + from fastapi import Request from fastapi.responses import JSONResponse -from pydantic import ValidationError, BaseModel, Field -from stac_pydantic import Item, Collection from starlette.middleware.base import BaseHTTPMiddleware -from src.config import ApiSettings - - api_settings = ApiSettings() prepend_path = api_settings.root_path or ""