stac-fastapi.api 6.6.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: stac-fastapi-api
3
- Version: 6.6.0
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~=6.6
20
+ Requires-Dist: stac-fastapi-types~=7.0
21
21
  Provides-Extra: metrics
22
22
  Requires-Dist: prometheus-fastapi-instrumentator>=8.1.0; extra == 'metrics'
@@ -32,7 +32,7 @@ classifiers = [
32
32
  dynamic = ["version"]
33
33
  dependencies = [
34
34
  "brotli_asgi",
35
- "stac-fastapi.types~=6.6",
35
+ "stac-fastapi.types~=7.0",
36
36
  ]
37
37
 
38
38
  [project.optional-dependencies]
@@ -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 (
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  """Library version."""
2
2
 
3
- __version__ = "6.6.0"
3
+ __version__ = "7.0.0"