|
4 | 4 | from typing import Annotated, Optional
|
5 | 5 | from uuid import UUID
|
6 | 6 |
|
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 |
9 | 8 | from fastapi.responses import ORJSONResponse
|
10 | 9 |
|
11 |
| -from ...authentication.api_keys import get_api_key |
12 | 10 | from ...crud import geostore
|
13 | 11 | from ...errors import (
|
14 | 12 | BadAdminSourceException,
|
@@ -113,7 +111,7 @@ async def get_admin_list(
|
113 | 111 | "3.6", alias="source[version]", description="Version of admin boundaries"
|
114 | 112 | ),
|
115 | 113 | request: Request,
|
116 |
| - _: APIKey = Depends(get_api_key), |
| 114 | + x_api_key: Annotated[str | None, Header()] = None, |
117 | 115 | ):
|
118 | 116 | """Get all national IDs, names and country codes (proxies requests for GADM
|
119 | 117 | 3.6 features to the RW API)"""
|
@@ -152,7 +150,7 @@ async def get_boundary_by_country_id(
|
152 | 150 | "3.6", alias="source[version]", description="Version of admin boundaries"
|
153 | 151 | ),
|
154 | 152 | simplify: Optional[float] = Query(None, description="Simplify tolerance"),
|
155 |
| - _: APIKey = Depends(get_api_key), |
| 153 | + x_api_key: Annotated[str | None, Header()] = None, |
156 | 154 | ):
|
157 | 155 | """Get an administrative boundary by country ID (proxies requests for GADM
|
158 | 156 | 3.6 boundaries to the RW API)"""
|
@@ -198,7 +196,7 @@ async def rw_get_boundary_by_region_id(
|
198 | 196 | "3.6", alias="source[version]", description="Version of admin boundaries"
|
199 | 197 | ),
|
200 | 198 | simplify: Optional[float] = Query(None, description="Simplify tolerance"),
|
201 |
| - _: APIKey = Depends(get_api_key), |
| 199 | + x_api_key: Annotated[str | None, Header()] = None, |
202 | 200 | ):
|
203 | 201 | """Get an administrative boundary by country and region IDs (proxies requests for GADM
|
204 | 202 | 3.6 boundaries to the RW API)"""
|
@@ -245,7 +243,7 @@ async def rw_get_boundary_by_subregion_id(
|
245 | 243 | "3.6", alias="source[version]", description="Version of admin boundaries"
|
246 | 244 | ),
|
247 | 245 | simplify: Optional[float] = Query(None, description="Simplify tolerance"),
|
248 |
| - _: APIKey = Depends(get_api_key), |
| 246 | + x_api_key: Annotated[str | None, Header()] = None, |
249 | 247 | ):
|
250 | 248 | """Get an administrative boundary by country, region, and subregion IDs
|
251 | 249 | (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(
|
290 | 288 | land_use_type: str = Path(..., title="land_use_type"),
|
291 | 289 | index: str = Path(..., title="index"),
|
292 | 290 | request: Request,
|
293 |
| - _: APIKey = Depends(get_api_key), |
| 291 | + x_api_key: Annotated[str | None, Header()] = None, |
294 | 292 | ):
|
295 | 293 | """Get a geostore object by land use type name and id.
|
296 | 294 |
|
|
0 commit comments