Skip to content

Commit 53a9d7e

Browse files
authored
Update to v4.0.0 (#362)
**Description:** **Changes from 3.2.5:** #### Added - Added support for dynamically-generated queryables based on Elasticsearch/OpenSearch mappings, with extensible metadata augmentation [#351](#351) - Included default queryables configuration for seamless integration. [#351](#351) - Added support for high-performance direct response mode for both Elasticsearch and Opensearch backends, controlled by the `ENABLE_DIRECT_RESPONSE` environment variable. When enabled (`ENABLE_DIRECT_RESPONSE=true`), endpoints return Starlette Response objects directly, bypassing FastAPI's jsonable_encoder and Pydantic serialization for significantly improved performance on large search responses. **Note:** In this mode, all FastAPI dependencies (including authentication, custom status codes, and validation) are disabled for all routes. Default is `false` for safety. A warning is logged at startup if enabled. See [issue #347](#347) and [PR #359](#359). - Added robust tests for the `ENABLE_DIRECT_RESPONSE` environment variable, covering both Elasticsearch and OpenSearch backends. Tests gracefully handle missing backends by attempting to import both configs and skipping if neither is available. [#359](#359) #### Changed - Refactored database logic to reduce duplication [#351](#351) - Replaced `fastapi-slim` with `fastapi` dependency [#351](#351) - Changed minimum Python version to 3.9 [#354](#354) - Updated stac-fastapi api, types, and extensions libraries to 5.1.1 from 3.0.0 and made various associated changes [#354](#354) - Changed makefile commands from 'docker-compose' to 'docker compose' [#354](#354) - Updated package names in setup.py files to use underscores instead of periods for PEP 625 compliance [#358](#358) - Changed `stac_fastapi.opensearch` to `stac_fastapi_opensearch` - Changed `stac_fastapi.elasticsearch` to `stac_fastapi_elasticsearch` - Changed `stac_fastapi.core` to `stac_fastapi_core` - Updated all related dependencies to use the new naming convention - Renamed `docker-compose.yml` to `compose.yml` to align with Docker Compose V2 conventions [#358](#358) - Removed deprecated `version` field from all compose files [#358](#358) - Updated `STAC_FASTAPI_VERSION` environment variables to 4.0.0 in all compose files [#362](#362) - Bumped version from 4.0.0a2 to 4.0.0 for the PEP 625 compliant release [#362](#362) - Updated dependency requirements to use compatible release specifiers (~=) for more controlled updates while allowing for bug fixes and security patches [#358](#358) - Removed elasticsearch-dsl dependency as it's now part of the elasticsearch package since version 8.18.0 [#358](#358) - Updated test suite to use `httpx.ASGITransport(app=...)` for FastAPI app testing (removes deprecation warning). [#359](#359) - Updated stac-fastapi parent libraries to 5.2.0. [#359](#359) - Migrated Elasticsearch index template creation from legacy `put_template` to composable `put_index_template` API in `database_logic.py`. This resolves deprecation warnings and ensures compatibility with Elasticsearch 7.x and 8.x. [#359](#359) - Updated all Pydantic models to use `ConfigDict` instead of class-based `Config` for Pydantic v2 compatibility. This resolves deprecation warnings and prepares for Pydantic v3. [#359](#359) - Migrated all Pydantic `@root_validator` validators to `@model_validator` for Pydantic v2 compatibility. [#359](#359) - Migrated startup event handling from deprecated `@app.on_event("startup")` to FastAPI's recommended lifespan context manager. This removes deprecation warnings and ensures compatibility with future FastAPI versions. [#361](#361) - Refactored all boolean environment variable parsing in both Elasticsearch and OpenSearch backends to use the shared `get_bool_env` utility. This ensures robust and consistent handling of environment variables such as `ES_USE_SSL`, `ES_HTTP_COMPRESS`, and `ES_VERIFY_CERTS` across both backends. [#359](#359) #### Fixed - Improved performance of `mk_actions` and `filter-links` methods [#351](#351) - Fixed inheritance relating to BaseDatabaseSettings and ApiBaseSettings [#355](#355) - Fixed delete_item and delete_collection methods return types [#355](#355) - Fixed inheritance relating to DatabaseLogic and BaseDatabaseLogic, and ApiBaseSettings [#355](#355) **PR Checklist:** - [x] Code is formatted and linted (run `pre-commit run --all-files`) - [x] Tests pass (run `make test`) - [x] Documentation has been updated to reflect changes, if applicable - [x] Changes are added to the changelog
1 parent 8079607 commit 53a9d7e

File tree

13 files changed

+36
-51
lines changed

13 files changed

+36
-51
lines changed

CHANGELOG.md

+19-34
Original file line numberDiff line numberDiff line change
@@ -13,51 +13,38 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1313

1414
### Fixed
1515

16-
## [v4.0.0a2] - 2025-04-20
16+
## [v4.0.0] - 2025-04-23
1717

1818
### Added
19+
- Added support for dynamically-generated queryables based on Elasticsearch/OpenSearch mappings, with extensible metadata augmentation [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351)
20+
- Included default queryables configuration for seamless integration. [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351)
1921
- Added support for high-performance direct response mode for both Elasticsearch and Opensearch backends, controlled by the `ENABLE_DIRECT_RESPONSE` environment variable. When enabled (`ENABLE_DIRECT_RESPONSE=true`), endpoints return Starlette Response objects directly, bypassing FastAPI's jsonable_encoder and Pydantic serialization for significantly improved performance on large search responses. **Note:** In this mode, all FastAPI dependencies (including authentication, custom status codes, and validation) are disabled for all routes. Default is `false` for safety. A warning is logged at startup if enabled. See [issue #347](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/issues/347) and [PR #359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359).
2022
- Added robust tests for the `ENABLE_DIRECT_RESPONSE` environment variable, covering both Elasticsearch and OpenSearch backends. Tests gracefully handle missing backends by attempting to import both configs and skipping if neither is available. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
2123

2224
### Changed
23-
- Updated test suite to use `httpx.ASGITransport(app=...)` for FastAPI app testing (removes deprecation warning). [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
24-
- Updated stac-fastapi parent libraries to 5.2.0. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
25-
- Migrated Elasticsearch index template creation from legacy `put_template` to composable `put_index_template` API in `database_logic.py`. This resolves deprecation warnings and ensures compatibility with Elasticsearch 7.x and 8.x. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
26-
- Updated all Pydantic models to use `ConfigDict` instead of class-based `Config` for Pydantic v2 compatibility. This resolves deprecation warnings and prepares for Pydantic v3. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
27-
- Migrated all Pydantic `@root_validator` validators to `@model_validator` for Pydantic v2 compatibility. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
28-
- Migrated startup event handling from deprecated `@app.on_event("startup")` to FastAPI's recommended lifespan context manager. This removes deprecation warnings and ensures compatibility with future FastAPI versions. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
29-
- Refactored all boolean environment variable parsing in both Elasticsearch and OpenSearch backends to use the shared `get_bool_env` utility. This ensures robust and consistent handling of environment variables such as `ES_USE_SSL`, `ES_HTTP_COMPRESS`, and `ES_VERIFY_CERTS` across both backends. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
30-
31-
32-
### Fixed
33-
34-
## [v4.0.0a1] - 2925-04-17
35-
36-
### Changed
25+
- Refactored database logic to reduce duplication [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351)
26+
- Replaced `fastapi-slim` with `fastapi` dependency [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351)
27+
- Changed minimum Python version to 3.9 [#354](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/354)
28+
- Updated stac-fastapi api, types, and extensions libraries to 5.1.1 from 3.0.0 and made various associated changes [#354](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/354)
29+
- Changed makefile commands from 'docker-compose' to 'docker compose' [#354](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/354)
3730
- Updated package names in setup.py files to use underscores instead of periods for PEP 625 compliance [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/358)
3831
- Changed `stac_fastapi.opensearch` to `stac_fastapi_opensearch`
3932
- Changed `stac_fastapi.elasticsearch` to `stac_fastapi_elasticsearch`
4033
- Changed `stac_fastapi.core` to `stac_fastapi_core`
4134
- Updated all related dependencies to use the new naming convention
4235
- Renamed `docker-compose.yml` to `compose.yml` to align with Docker Compose V2 conventions [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/358)
4336
- Removed deprecated `version` field from all compose files [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/358)
44-
- Updated `STAC_FASTAPI_VERSION` environment variables to 4.0.0a1 in all compose files [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/358)
45-
- Bumped version from 4.0.0a0 to 4.0.0a1 for the PEP 625 compliant release [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/358)
37+
- Updated `STAC_FASTAPI_VERSION` environment variables to 4.0.0 in all compose files [#362](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/362)
38+
- Bumped version from 4.0.0a2 to 4.0.0 for the PEP 625 compliant release [#362](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/362)
4639
- Updated dependency requirements to use compatible release specifiers (~=) for more controlled updates while allowing for bug fixes and security patches [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/issues/358)
4740
- Removed elasticsearch-dsl dependency as it's now part of the elasticsearch package since version 8.18.0 [#358](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/issues/358)
48-
49-
## [v4.0.0a0] - 2025-04-16
50-
51-
### Added
52-
- Added support for dynamically-generated queryables based on Elasticsearch/OpenSearch mappings, with extensible metadata augmentation [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351)
53-
- Included default queryables configuration for seamless integration. [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351)
54-
55-
### Changed
56-
- Refactored database logic to reduce duplication [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351)
57-
- Replaced `fastapi-slim` with `fastapi` dependency [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351)
58-
- Changed minimum Python version to 3.9 [#354](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/354)
59-
- Updated stac-fastapi api, types, and extensions libraries to 5.1.1 from 3.0.0 and made various associated changes [#354](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/354)
60-
- Changed makefile commands from 'docker-compose' to 'docker compose' [#354](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/354)
41+
- Updated test suite to use `httpx.ASGITransport(app=...)` for FastAPI app testing (removes deprecation warning). [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
42+
- Updated stac-fastapi parent libraries to 5.2.0. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
43+
- Migrated Elasticsearch index template creation from legacy `put_template` to composable `put_index_template` API in `database_logic.py`. This resolves deprecation warnings and ensures compatibility with Elasticsearch 7.x and 8.x. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
44+
- Updated all Pydantic models to use `ConfigDict` instead of class-based `Config` for Pydantic v2 compatibility. This resolves deprecation warnings and prepares for Pydantic v3. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
45+
- Migrated all Pydantic `@root_validator` validators to `@model_validator` for Pydantic v2 compatibility. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
46+
- Migrated startup event handling from deprecated `@app.on_event("startup")` to FastAPI's recommended lifespan context manager. This removes deprecation warnings and ensures compatibility with future FastAPI versions. [#361](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/361)
47+
- Refactored all boolean environment variable parsing in both Elasticsearch and OpenSearch backends to use the shared `get_bool_env` utility. This ensures robust and consistent handling of environment variables such as `ES_USE_SSL`, `ES_HTTP_COMPRESS`, and `ES_VERIFY_CERTS` across both backends. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
6148

6249
### Fixed
6350
- Improved performance of `mk_actions` and `filter-links` methods [#351](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/351)
@@ -361,10 +348,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
361348
- Use genexp in execute_search and get_all_collections to return results.
362349
- Added db_to_stac serializer to item_collection method in core.py.
363350

364-
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v4.0.0a2...main
365-
[v4.0.0a2]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v4.0.0a1...v4.0.0a2
366-
[v4.0.0a1]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v4.0.0a0...v4.0.0a1
367-
[v4.0.0a0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v3.2.5...v4.0.0a0
351+
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v4.0.0...main
352+
[v4.0.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v3.2.5...v4.0.0
368353
[v3.2.5]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v3.2.4...v3.2.5
369354
[v3.2.4]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v3.2.3...v3.2.4
370355
[v3.2.3]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v3.2.2...v3.2.3

compose.yml

+2-2
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=4.0.0a2
12+
- STAC_FASTAPI_VERSION=4.0.0
1313
- APP_HOST=0.0.0.0
1414
- APP_PORT=8080
1515
- RELOAD=true
@@ -41,7 +41,7 @@ services:
4141
environment:
4242
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4343
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
44-
- STAC_FASTAPI_VERSION=4.0.0a2
44+
- STAC_FASTAPI_VERSION=4.0.0
4545
- APP_HOST=0.0.0.0
4646
- APP_PORT=8082
4747
- RELOAD=true

examples/auth/compose.basic_auth.yml

+2-2
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=4.0.0a2
12+
- STAC_FASTAPI_VERSION=4.0.0
1313
- APP_HOST=0.0.0.0
1414
- APP_PORT=8080
1515
- RELOAD=true
@@ -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=4.0.0a2
45+
- STAC_FASTAPI_VERSION=4.0.0
4646
- APP_HOST=0.0.0.0
4747
- APP_PORT=8082
4848
- RELOAD=true

examples/auth/compose.oauth2.yml

+2-2
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=4.0.0a2
12+
- STAC_FASTAPI_VERSION=4.0.0
1313
- APP_HOST=0.0.0.0
1414
- APP_PORT=8080
1515
- RELOAD=true
@@ -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=4.0.0a2
46+
- STAC_FASTAPI_VERSION=4.0.0
4747
- APP_HOST=0.0.0.0
4848
- APP_PORT=8082
4949
- RELOAD=true

examples/auth/compose.route_dependencies.yml

+2-2
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=4.0.0a2
12+
- STAC_FASTAPI_VERSION=4.0.0
1313
- APP_HOST=0.0.0.0
1414
- APP_PORT=8080
1515
- RELOAD=true
@@ -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=4.0.0a2
45+
- STAC_FASTAPI_VERSION=4.0.0
4646
- APP_HOST=0.0.0.0
4747
- APP_PORT=8082
4848
- RELOAD=true

examples/rate_limit/compose.rate_limit.yml

+2-2
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=4.0.0a2
12+
- STAC_FASTAPI_VERSION=4.0.0
1313
- APP_HOST=0.0.0.0
1414
- APP_PORT=8080
1515
- RELOAD=true
@@ -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=4.0.0a2
45+
- STAC_FASTAPI_VERSION=4.0.0
4646
- APP_HOST=0.0.0.0
4747
- APP_PORT=8082
4848
- RELOAD=true
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "4.0.0a2"
2+
__version__ = "4.0.0"

stac_fastapi/elasticsearch/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
desc = f.read()
77

88
install_requires = [
9-
"stac-fastapi-core==4.0.0a2",
9+
"stac-fastapi-core==4.0.0",
1010
"elasticsearch[async]~=8.18.0",
1111
"uvicorn~=0.23.0",
1212
"starlette>=0.35.0,<0.36.0",

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
api = StacApi(
9191
title=os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi-elasticsearch"),
9292
description=os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi-elasticsearch"),
93-
api_version=os.getenv("STAC_FASTAPI_VERSION", "4.0.0a2"),
93+
api_version=os.getenv("STAC_FASTAPI_VERSION", "4.0.0"),
9494
settings=settings,
9595
extensions=extensions,
9696
client=CoreClient(
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "4.0.0a2"
2+
__version__ = "4.0.0"

stac_fastapi/opensearch/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
desc = f.read()
77

88
install_requires = [
9-
"stac-fastapi-core==4.0.0a2",
9+
"stac-fastapi-core==4.0.0",
1010
"opensearch-py~=2.8.0",
1111
"opensearch-py[async]~=2.8.0",
1212
"uvicorn~=0.23.0",

stac_fastapi/opensearch/stac_fastapi/opensearch/app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
api = StacApi(
9191
title=os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi-opensearch"),
9292
description=os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi-opensearch"),
93-
api_version=os.getenv("STAC_FASTAPI_VERSION", "4.0.0a2"),
93+
api_version=os.getenv("STAC_FASTAPI_VERSION", "4.0.0"),
9494
settings=settings,
9595
extensions=extensions,
9696
client=CoreClient(
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "4.0.0a2"
2+
__version__ = "4.0.0"

0 commit comments

Comments
 (0)