stac-fastapi.api 6.5.0__tar.gz → 7.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/PKG-INFO +4 -4
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/pyproject.toml +2 -2
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/stac_fastapi/api/app.py +1 -1
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/stac_fastapi/api/errors.py +0 -1
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/stac_fastapi/api/middleware.py +0 -47
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/stac_fastapi/api/models.py +1 -6
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/stac_fastapi/api/version.py +1 -1
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/.gitignore +0 -0
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/README.md +0 -0
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/stac_fastapi/api/__init__.py +0 -0
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/stac_fastapi/api/config.py +0 -0
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/stac_fastapi/api/metrics.py +0 -0
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/stac_fastapi/api/openapi.py +0 -0
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/stac_fastapi/api/py.typed +0 -0
- {stac_fastapi_api-6.5.0 → stac_fastapi_api-7.0.0}/stac_fastapi/api/routes.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: stac-fastapi-api
|
|
3
|
-
Version:
|
|
3
|
+
Version: 7.0.0
|
|
4
4
|
Summary: An implementation of STAC API based on the FastAPI framework.
|
|
5
5
|
Project-URL: Homepage, https://github.com/stac-utils/stac-fastapi
|
|
6
6
|
Author-email: ArturoAI <engineering@arturo.ai>
|
|
@@ -17,6 +17,6 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.14
|
|
18
18
|
Requires-Python: >=3.11
|
|
19
19
|
Requires-Dist: brotli-asgi
|
|
20
|
-
Requires-Dist: stac-fastapi-types~=
|
|
20
|
+
Requires-Dist: stac-fastapi-types~=7.0
|
|
21
21
|
Provides-Extra: metrics
|
|
22
|
-
Requires-Dist: prometheus-fastapi-instrumentator>=8; extra == 'metrics'
|
|
22
|
+
Requires-Dist: prometheus-fastapi-instrumentator>=8.1.0; extra == 'metrics'
|
|
@@ -32,12 +32,12 @@ classifiers = [
|
|
|
32
32
|
dynamic = ["version"]
|
|
33
33
|
dependencies = [
|
|
34
34
|
"brotli_asgi",
|
|
35
|
-
"stac-fastapi.types~=
|
|
35
|
+
"stac-fastapi.types~=7.0",
|
|
36
36
|
]
|
|
37
37
|
|
|
38
38
|
[project.optional-dependencies]
|
|
39
39
|
metrics = [
|
|
40
|
-
"prometheus-fastapi-instrumentator>=8",
|
|
40
|
+
"prometheus-fastapi-instrumentator>=8.1.0",
|
|
41
41
|
]
|
|
42
42
|
|
|
43
43
|
[dependency-groups]
|
|
@@ -7,6 +7,7 @@ import attr
|
|
|
7
7
|
from brotli_asgi import BrotliMiddleware
|
|
8
8
|
from fastapi import APIRouter, FastAPI
|
|
9
9
|
from fastapi.params import Depends
|
|
10
|
+
from fastapi.responses import JSONResponse
|
|
10
11
|
from pydantic import BaseModel
|
|
11
12
|
from stac_pydantic import api
|
|
12
13
|
from stac_pydantic.shared import MimeTypes
|
|
@@ -25,7 +26,6 @@ from stac_fastapi.api.models import (
|
|
|
25
26
|
HealthCheck,
|
|
26
27
|
ItemCollectionUri,
|
|
27
28
|
ItemUri,
|
|
28
|
-
JSONResponse,
|
|
29
29
|
)
|
|
30
30
|
from stac_fastapi.api.openapi import update_openapi
|
|
31
31
|
from stac_fastapi.api.routes import (
|
|
@@ -27,7 +27,6 @@ DEFAULT_STATUS_CODES = {
|
|
|
27
27
|
ConflictError: status.HTTP_409_CONFLICT,
|
|
28
28
|
ForeignKeyError: status.HTTP_424_FAILED_DEPENDENCY,
|
|
29
29
|
DatabaseError: status.HTTP_424_FAILED_DEPENDENCY,
|
|
30
|
-
Exception: status.HTTP_500_INTERNAL_SERVER_ERROR,
|
|
31
30
|
InvalidQueryParameter: status.HTTP_400_BAD_REQUEST,
|
|
32
31
|
ResponseValidationError: status.HTTP_500_INTERNAL_SERVER_ERROR,
|
|
33
32
|
}
|
|
@@ -2,57 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import contextlib
|
|
4
4
|
import re
|
|
5
|
-
import typing
|
|
6
|
-
import warnings
|
|
7
5
|
from http.client import HTTP_PORT, HTTPS_PORT
|
|
8
6
|
|
|
9
|
-
from starlette.middleware.cors import CORSMiddleware as _CORSMiddleware
|
|
10
7
|
from starlette.types import ASGIApp, Receive, Scope, Send
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
class CORSMiddleware(_CORSMiddleware):
|
|
14
|
-
"""Subclass of Starlette's standard CORS middleware with default values set to those
|
|
15
|
-
recommended by the STAC API spec.
|
|
16
|
-
|
|
17
|
-
https://github.com/radiantearth/stac-api-spec/blob/914cf8108302e2ec734340080a45aaae4859bb63/implementation.md#cors
|
|
18
|
-
"""
|
|
19
|
-
|
|
20
|
-
def __init__(
|
|
21
|
-
self,
|
|
22
|
-
app: ASGIApp,
|
|
23
|
-
allow_origins: typing.Sequence[str] = ("*",),
|
|
24
|
-
allow_methods: typing.Sequence[str] = (
|
|
25
|
-
"OPTIONS",
|
|
26
|
-
"POST",
|
|
27
|
-
"GET",
|
|
28
|
-
),
|
|
29
|
-
allow_headers: typing.Sequence[str] = ("Content-Type",),
|
|
30
|
-
allow_credentials: bool = False,
|
|
31
|
-
allow_origin_regex: str | None = None,
|
|
32
|
-
expose_headers: typing.Sequence[str] = (),
|
|
33
|
-
max_age: int = 600,
|
|
34
|
-
**kwargs: typing.Any,
|
|
35
|
-
) -> None:
|
|
36
|
-
"""Create CORS middleware."""
|
|
37
|
-
warnings.warn(
|
|
38
|
-
"""stac_fastapi.api.middleware.CORSMiddleware is deprecated and
|
|
39
|
-
will be removed in a future release.
|
|
40
|
-
Please use starlette.middleware.cors.CORSMiddleware instead.""",
|
|
41
|
-
DeprecationWarning,
|
|
42
|
-
)
|
|
43
|
-
super().__init__(
|
|
44
|
-
app,
|
|
45
|
-
allow_origins=allow_origins,
|
|
46
|
-
allow_methods=allow_methods,
|
|
47
|
-
allow_headers=allow_headers,
|
|
48
|
-
allow_credentials=allow_credentials,
|
|
49
|
-
allow_origin_regex=allow_origin_regex,
|
|
50
|
-
expose_headers=expose_headers,
|
|
51
|
-
max_age=max_age,
|
|
52
|
-
**kwargs,
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
|
|
56
9
|
_PROTO_HEADER_REGEX = re.compile(r"proto=(?P<proto>http(s)?)")
|
|
57
10
|
_HOST_HEADER_REGEX = re.compile(r"host=(?P<host>[\w.-]+)(:(?P<port>\d{1,5}))?")
|
|
58
11
|
|
|
@@ -4,6 +4,7 @@ from typing import Annotated, Literal, cast
|
|
|
4
4
|
|
|
5
5
|
import attr
|
|
6
6
|
from fastapi import Path, Query
|
|
7
|
+
from fastapi.responses import JSONResponse
|
|
7
8
|
from pydantic import BaseModel, create_model
|
|
8
9
|
from stac_pydantic.shared import BBox
|
|
9
10
|
|
|
@@ -19,12 +20,6 @@ from stac_fastapi.types.search import (
|
|
|
19
20
|
_validate_datetime,
|
|
20
21
|
)
|
|
21
22
|
|
|
22
|
-
try:
|
|
23
|
-
import orjson # noqa
|
|
24
|
-
from fastapi.responses import ORJSONResponse as JSONResponse
|
|
25
|
-
except ImportError: # pragma: nocover
|
|
26
|
-
from starlette.responses import JSONResponse # type: ignore [assignment]
|
|
27
|
-
|
|
28
23
|
|
|
29
24
|
def create_request_model(
|
|
30
25
|
model_name="SearchGetRequest",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|