Skip to content

Commit

Permalink
Make auth optional, fix item reference in bulk ingest
Browse files Browse the repository at this point in the history
  • Loading branch information
slesaad committed Jul 24, 2024
1 parent 0563818 commit bdb70f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions stac_api/runtime/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@

tiles_settings = TilesApiSettings()

auth = VedaAuth(api_settings)

api = VedaStacApi(
app=FastAPI(
title=f"{api_settings.project_name} STAC API",
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion stac_api/runtime/src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion stac_api/runtime/src/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit bdb70f3

Please sign in to comment.