diff --git a/stac_api/runtime/src/app.py b/stac_api/runtime/src/app.py index 26b8667d..34cb2ef4 100644 --- a/stac_api/runtime/src/app.py +++ b/stac_api/runtime/src/app.py @@ -37,8 +37,6 @@ tiles_settings = TilesApiSettings() -auth = VedaAuth(api_settings) - api = VedaStacApi( app=FastAPI( title=f"{api_settings.project_name} STAC API", @@ -49,7 +47,7 @@ "appName": "Cognito", "clientId": api_settings.client_id, "usePkceWithAuthorizationCodeGrant": True, - }, + } if api_settings.client_id else {}, ), title=f"{api_settings.project_name} STAC API", description=api_settings.project_description, @@ -78,6 +76,7 @@ ) if api_settings.enable_transactions: + auth = VedaAuth(api_settings) # Require auth for all endpoints that create, modify or delete data. add_route_dependencies( app.router.routes, diff --git a/stac_api/runtime/src/config.py b/stac_api/runtime/src/config.py index 46ecfbcb..89f5d338 100644 --- a/stac_api/runtime/src/config.py +++ b/stac_api/runtime/src/config.py @@ -64,7 +64,7 @@ class _ApiSettings(BaseSettings): pgstac_secret_arn: Optional[str] stage: Optional[str] = None - userpool_id: Optional[str] = Field(description="The Cognito Userpool used for authentication") + userpool_id: Optional[str] = Field("", description="The Cognito Userpool used for authentication") cognito_domain: Optional[AnyHttpUrl] = Field( description="The base url of the Cognito domain for authorization and token urls" ) diff --git a/stac_api/runtime/src/validation.py b/stac_api/runtime/src/validation.py index ce292870..f38ee30c 100644 --- a/stac_api/runtime/src/validation.py +++ b/stac_api/runtime/src/validation.py @@ -49,7 +49,7 @@ async def dispatch(self, request: Request, call_next): request.url.path, ): bulk_items = BulkItems(**request_data) - for item_data in bulk_items.items.items.values(): + for item_data in bulk_items.items.values(): validate_dict(item_data, STACObjectType.ITEM) except STACValidationError as e: return JSONResponse(