Skip to content

Commit fa090f9

Browse files
committed
Make API keys optional for RW geostore endpoints (revert later)
1 parent 00f6421 commit fa090f9

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

app/routes/geostore/geostore.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
from typing import Annotated, Optional
55
from uuid import UUID
66

7-
from fastapi import APIRouter, Depends, Header, HTTPException, Path, Query, Request
8-
from fastapi.openapi.models import APIKey
7+
from fastapi import APIRouter, Header, HTTPException, Path, Query, Request
98
from fastapi.responses import ORJSONResponse
109

11-
from ...authentication.api_keys import get_api_key
1210
from ...crud import geostore
1311
from ...errors import (
1412
BadAdminSourceException,
@@ -113,7 +111,7 @@ async def get_admin_list(
113111
"3.6", alias="source[version]", description="Version of admin boundaries"
114112
),
115113
request: Request,
116-
_: APIKey = Depends(get_api_key),
114+
x_api_key: Annotated[str | None, Header()] = None,
117115
):
118116
"""Get all national IDs, names and country codes (proxies requests for GADM
119117
3.6 features to the RW API)"""
@@ -152,7 +150,7 @@ async def get_boundary_by_country_id(
152150
"3.6", alias="source[version]", description="Version of admin boundaries"
153151
),
154152
simplify: Optional[float] = Query(None, description="Simplify tolerance"),
155-
_: APIKey = Depends(get_api_key),
153+
x_api_key: Annotated[str | None, Header()] = None,
156154
):
157155
"""Get an administrative boundary by country ID (proxies requests for GADM
158156
3.6 boundaries to the RW API)"""
@@ -198,7 +196,7 @@ async def rw_get_boundary_by_region_id(
198196
"3.6", alias="source[version]", description="Version of admin boundaries"
199197
),
200198
simplify: Optional[float] = Query(None, description="Simplify tolerance"),
201-
_: APIKey = Depends(get_api_key),
199+
x_api_key: Annotated[str | None, Header()] = None,
202200
):
203201
"""Get an administrative boundary by country and region IDs (proxies requests for GADM
204202
3.6 boundaries to the RW API)"""
@@ -245,7 +243,7 @@ async def rw_get_boundary_by_subregion_id(
245243
"3.6", alias="source[version]", description="Version of admin boundaries"
246244
),
247245
simplify: Optional[float] = Query(None, description="Simplify tolerance"),
248-
_: APIKey = Depends(get_api_key),
246+
x_api_key: Annotated[str | None, Header()] = None,
249247
):
250248
"""Get an administrative boundary by country, region, and subregion IDs
251249
(proxies requests for GADM 3.6 boundaries to the RW API)"""
@@ -290,7 +288,7 @@ async def rw_get_geostore_by_land_use_and_index(
290288
land_use_type: str = Path(..., title="land_use_type"),
291289
index: str = Path(..., title="index"),
292290
request: Request,
293-
_: APIKey = Depends(get_api_key),
291+
x_api_key: Annotated[str | None, Header()] = None,
294292
):
295293
"""Get a geostore object by land use type name and id.
296294

0 commit comments

Comments
 (0)