Skip to content

Commit 1da1f60

Browse files
committed
Merge branch 'main' of github.com:stac-utils/stac-fastapi-elasticsearch into patch_endpoints
2 parents 6394c18 + 4dafa28 commit 1da1f60

File tree

18 files changed

+51
-63
lines changed

18 files changed

+51
-63
lines changed

CHANGELOG.md

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
88

99
## [Unreleased]
1010

11-
### Added
12-
13-
- Added support for enum queryables [#390](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/390)
14-
15-
### Changed
16-
17-
- Improved datetime query handling to only check start and end datetime values when datetime is None [#396](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/396)
18-
- Optimize data_loader.py script [#395](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/395)
19-
- Refactored test configuration to use shared app config pattern [#399](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/399)
20-
21-
### Removed
22-
23-
- Removed `requests` dev dependency [#395](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/395)
24-
25-
## [v5.0.0a1] - 2025-05-30
26-
27-
### Changed
28-
29-
- Updated mkdocs/ sfeos doucmentation page [#386](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/386)
30-
31-
### Fixed
32-
33-
- Added the ability to authenticate with OpenSearch/ElasticSearch with SSL disabled [#388](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/388)
34-
35-
## [v5.0.0a0] - 2025-05-29
11+
## [v5.0.0] - 2025-06-11
3612

3713
### Added
3814

3915
- Created new `sfeos_helpers` package to improve code organization and maintainability [#376](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/376)
4016
- Added introduction section - What is stac-fastapi-elasticsearch-opensearch? - to README [#384](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/384)
17+
- Added support for enum queryables [#390](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/390)
4118

4219
### Changed
4320

@@ -46,16 +23,28 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
4623
- Created `aggregation` package for Elasticsearch/OpenSearch-specific aggregation functionality
4724
- Moved shared logic from core module to helper functions for better code reuse
4825
- Separated utility functions from constant mappings for clearer code organization
49-
- Updated documentation to reflect recent code refactoring [#376](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/376)
26+
- Updated documentation to reflect recent code refactoring [#376](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/376)
5027
- Improved README documentation with consistent formatting and enhanced sections [#381](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/381):
5128
- Added sfeos logo and banner
5229
- Added a comprehensive Quick Start guide
5330
- Reorganized sections for better navigation
5431
- Reformatted content with bullet points for improved readability
5532
- Added more detailed examples for API interaction
56-
33+
- Updated mkdocs/ sfeos doucmentation page [#386](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/386)
34+
- Improved datetime query handling to only check start and end datetime values when datetime is None [#396](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/396)
35+
- Optimize data_loader.py script [#395](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/395)
36+
- Refactored test configuration to use shared app config pattern [#399](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/399)
37+
- Make `orjson` usage more consistent [#402](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/402)
38+
5739
### Fixed
5840

41+
- Added the ability to authenticate with OpenSearch/ElasticSearch with SSL disabled [#388](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/388)
42+
43+
### Removed
44+
45+
- Removed `requests` dev dependency [#395](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/395)
46+
47+
5948
## [v4.2.0] - 2025-05-15
6049

6150
### Added
@@ -430,9 +419,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
430419
- Use genexp in execute_search and get_all_collections to return results.
431420
- Added db_to_stac serializer to item_collection method in core.py.
432421

433-
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v5.0.0a1...main
434-
[v5.0.0a1]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v5.0.0a0...v5.0.0a1
435-
[v5.0.0a0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v4.2.0...v5.0.0a0
422+
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v5.0.0...main
423+
[v5.0.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v4.2.0...v5.0.0
436424
[v4.2.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v4.1.0...v4.2.0
437425
[v4.1.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v4.0.0...v4.1.0
438426
[v4.0.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v3.2.5...v4.0.0

compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=5.0.0a1
12+
- STAC_FASTAPI_VERSION=5.0.0
1313
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1414
- APP_HOST=0.0.0.0
1515
- APP_PORT=8080
@@ -42,7 +42,7 @@ services:
4242
environment:
4343
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4444
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
45-
- STAC_FASTAPI_VERSION=5.0.0a1
45+
- STAC_FASTAPI_VERSION=5.0.0
4646
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-opensearch
4747
- APP_HOST=0.0.0.0
4848
- APP_PORT=8082

examples/auth/compose.basic_auth.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=5.0.0a1
12+
- STAC_FASTAPI_VERSION=5.0.0
1313
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1414
- APP_HOST=0.0.0.0
1515
- APP_PORT=8080
@@ -43,7 +43,7 @@ services:
4343
environment:
4444
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4545
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
46-
- STAC_FASTAPI_VERSION=5.0.0a1
46+
- STAC_FASTAPI_VERSION=5.0.0
4747
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-opensearch
4848
- APP_HOST=0.0.0.0
4949
- APP_PORT=8082

examples/auth/compose.oauth2.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=5.0.0a1
12+
- STAC_FASTAPI_VERSION=5.0.0
1313
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1414
- APP_HOST=0.0.0.0
1515
- APP_PORT=8080
@@ -44,7 +44,7 @@ services:
4444
environment:
4545
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4646
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
47-
- STAC_FASTAPI_VERSION=5.0.0a1
47+
- STAC_FASTAPI_VERSION=5.0.0
4848
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-opensearch
4949
- APP_HOST=0.0.0.0
5050
- APP_PORT=8082

examples/auth/compose.route_dependencies.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=5.0.0a1
12+
- STAC_FASTAPI_VERSION=5.0.0
1313
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1414
- APP_HOST=0.0.0.0
1515
- APP_PORT=8080
@@ -43,7 +43,7 @@ services:
4343
environment:
4444
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4545
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
46-
- STAC_FASTAPI_VERSION=5.0.0a1
46+
- STAC_FASTAPI_VERSION=5.0.0
4747
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-opensearch
4848
- APP_HOST=0.0.0.0
4949
- APP_PORT=8082

examples/rate_limit/compose.rate_limit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=5.0.0a1
12+
- STAC_FASTAPI_VERSION=5.0.0
1313
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-elasticsearch
1414
- APP_HOST=0.0.0.0
1515
- APP_PORT=8080
@@ -43,7 +43,7 @@ services:
4343
environment:
4444
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4545
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
46-
- STAC_FASTAPI_VERSION=5.0.0a1
46+
- STAC_FASTAPI_VERSION=5.0.0
4747
- STAC_FASTAPI_LANDING_PAGE_ID=stac-fastapi-opensearch
4848
- APP_HOST=0.0.0.0
4949
- APP_PORT=8082

stac_fastapi/core/stac_fastapi/core/route_dependencies.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
import importlib
44
import inspect
5-
import json
65
import logging
76
import os
87
from typing import List
98

9+
import orjson
1010
from fastapi import Depends
1111
from jsonschema import validate
1212

@@ -84,14 +84,14 @@
8484

8585
def get_route_dependencies_conf(route_dependencies_env: str) -> list:
8686
"""Get Route dependencies configuration from file or environment variable."""
87-
if os.path.exists(route_dependencies_env):
88-
with open(route_dependencies_env, encoding="utf-8") as route_dependencies_file:
89-
route_dependencies_conf = json.load(route_dependencies_file)
87+
if os.path.isfile(route_dependencies_env):
88+
with open(route_dependencies_env, "rb") as f:
89+
route_dependencies_conf = orjson.loads(f.read())
9090

9191
else:
9292
try:
93-
route_dependencies_conf = json.loads(route_dependencies_env)
94-
except json.JSONDecodeError as exception:
93+
route_dependencies_conf = orjson.loads(route_dependencies_env)
94+
except orjson.JSONDecodeError as exception:
9595
_LOGGER.error("Invalid JSON format for route dependencies. %s", exception)
9696
raise
9797

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "5.0.0a1"
2+
__version__ = "5.0.0"

stac_fastapi/elasticsearch/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
desc = f.read()
77

88
install_requires = [
9-
"stac-fastapi-core==5.0.0a1",
10-
"sfeos-helpers==5.0.0a1",
9+
"stac-fastapi-core==5.0.0",
10+
"sfeos-helpers==5.0.0",
1111
"elasticsearch[async]~=8.18.0",
1212
"uvicorn~=0.23.0",
1313
"starlette>=0.35.0,<0.36.0",

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
app_config = {
108108
"title": os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi-elasticsearch"),
109109
"description": os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi-elasticsearch"),
110-
"api_version": os.getenv("STAC_FASTAPI_VERSION", "5.0.0a1"),
110+
"api_version": os.getenv("STAC_FASTAPI_VERSION", "5.0.0"),
111111
"settings": settings,
112112
"extensions": extensions,
113113
"client": CoreClient(

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/database_logic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"""Database logic."""
22

33
import asyncio
4-
import json
54
import logging
65
from base64 import urlsafe_b64decode, urlsafe_b64encode
76
from copy import deepcopy
87
from typing import Any, Dict, Iterable, List, Optional, Tuple, Type, Union
98

109
import attr
1110
import elasticsearch.helpers as helpers
11+
import orjson
1212
from elasticsearch.dsl import Q, Search
1313
from elasticsearch.exceptions import BadRequestError
1414
from elasticsearch.exceptions import NotFoundError as ESNotFoundError
@@ -517,7 +517,7 @@ async def execute_search(
517517
search_after = None
518518

519519
if token:
520-
search_after = json.loads(urlsafe_b64decode(token).decode())
520+
search_after = orjson.loads(urlsafe_b64decode(token))
521521

522522
query = search.query.to_dict() if search.query else None
523523

@@ -557,7 +557,7 @@ async def execute_search(
557557
next_token = None
558558
if len(hits) > limit and limit < max_result_window:
559559
if hits and (sort_array := hits[limit - 1].get("sort")):
560-
next_token = urlsafe_b64encode(json.dumps(sort_array).encode()).decode()
560+
next_token = urlsafe_b64encode(orjson.dumps(sort_array)).decode()
561561

562562
matched = (
563563
es_response["hits"]["total"]["value"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "5.0.0a1"
2+
__version__ = "5.0.0"

stac_fastapi/opensearch/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
desc = f.read()
77

88
install_requires = [
9-
"stac-fastapi-core==5.0.0a1",
10-
"sfeos-helpers==5.0.0a1",
9+
"stac-fastapi-core==5.0.0",
10+
"sfeos-helpers==5.0.0",
1111
"opensearch-py~=2.8.0",
1212
"opensearch-py[async]~=2.8.0",
1313
"uvicorn~=0.23.0",

stac_fastapi/opensearch/stac_fastapi/opensearch/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
app_config = {
109109
"title": os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi-opensearch"),
110110
"description": os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi-opensearch"),
111-
"api_version": os.getenv("STAC_FASTAPI_VERSION", "5.0.0a1"),
111+
"api_version": os.getenv("STAC_FASTAPI_VERSION", "5.0.0"),
112112
"settings": settings,
113113
"extensions": extensions,
114114
"client": CoreClient(

stac_fastapi/opensearch/stac_fastapi/opensearch/database_logic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""Database logic."""
22

33
import asyncio
4-
import json
54
import logging
65
from base64 import urlsafe_b64decode, urlsafe_b64encode
76
from copy import deepcopy
87
from typing import Any, Dict, Iterable, List, Optional, Tuple, Type, Union
98

109
import attr
10+
import orjson
1111
from fastapi import HTTPException
1212
from opensearchpy import exceptions, helpers
1313
from opensearchpy.helpers.query import Q
@@ -540,7 +540,7 @@ async def execute_search(
540540
search_after = None
541541

542542
if token:
543-
search_after = json.loads(urlsafe_b64decode(token).decode())
543+
search_after = orjson.loads(urlsafe_b64decode(token))
544544
if search_after:
545545
search_body["search_after"] = search_after
546546

@@ -580,7 +580,7 @@ async def execute_search(
580580
next_token = None
581581
if len(hits) > limit and limit < max_result_window:
582582
if hits and (sort_array := hits[limit - 1].get("sort")):
583-
next_token = urlsafe_b64encode(json.dumps(sort_array).encode()).decode()
583+
next_token = urlsafe_b64encode(orjson.dumps(sort_array)).decode()
584584

585585
matched = (
586586
es_response["hits"]["total"]["value"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "5.0.0a1"
2+
__version__ = "5.0.0"

stac_fastapi/sfeos_helpers/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
desc = f.read()
77

88
install_requires = [
9-
"stac-fastapi.core==5.0.0a1",
9+
"stac-fastapi.core==5.0.0",
1010
]
1111

1212
setup(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "5.0.0a1"
2+
__version__ = "5.0.0"

0 commit comments

Comments
 (0)