Skip to content

4.10.1 — 2026-05-31

4.10.0 → | ↑ 4.x series

Fixed

Helpers - App Utils

  • FastAPI APM Middleware Ordering - Reordered FastAPI app setup so setup_metric_interceptor runs before setup_elastic_apm.
    • Elastic APM must be the outermost middleware to capture incoming FastAPI requests; the previous order placed the metrics interceptor outside APM, causing handler spans to be missed.

Adapters - Redis

  • Async Cluster Node Import - AsyncRedisAdapter._create_cluster_client now imports ClusterNode from redis.asyncio.cluster instead of the synchronous redis.cluster, matching the async cluster client's expected node type.

Changed

Adapters - Redis

  • Concrete Type Hints in Place of Generic Aliases - Replaced the generic RedisResponseType, RedisKeyType, RedisExpiryType, RedisAbsExpiryType, RedisIntegerResponseType, RedisListResponseType, RedisSetResponseType, RedisPatternType, and RedisSetType aliases with concrete return and parameter types across RedisAdapter, AsyncRedisAdapter, RedisPort, and AsyncRedisPort.
    • Cluster methods now declare specific shapes (e.g., cluster_info() -> dict[str, str] | None, cluster_slots() -> list[Any] | None, cluster_get_keys_in_slot(...) -> list[bytes | str] | None).
    • TTL and counter methods now return int directly (e.g., pttl, incrby).
    • Expiry parameters use int | timedelta and int | datetime for relative and absolute forms respectively.
    • Added from __future__ import annotations to archipy/adapters/redis/adapters.py and archipy/adapters/redis/ports.py and imported datetime / timedelta for the new typing.
    • RedisScoreCastType is retained; all other aliases are removed from archipy.adapters.redis.ports.

Adapters - Redis Mocks

  • Drop Removed Type Alias - AsyncRedisMock._create_async_wrapper now types the wrapped method as Callable[..., Awaitable[Any]] after RedisResponseType was removed from archipy.adapters.redis.ports.

Helpers - Rate Limit

  • Concrete Return Type for _check - FastAPIRestRateLimitHandler._check now returns int instead of the removed RedisResponseType alias and the TYPE_CHECKING import is dropped.

Tests

Tests - Keycloak

  • Audience Mapper for Token Introspection - Replaced the brittle realm-management:token-introspection role assignment in _step_create_client_and_update_adapter with a new _ensure_introspection_audience_mapper helper that installs an oidc-audience-mapper on freshly created clients.
    • Uses add_mapper_to_client / a_add_mapper_to_client to ensure the introspecting client appears in the access token aud claim, which Keycloak 26.6.2+ requires for successful introspection.
    • Re-initializes the admin adapter against the target realm before mutating the client and skips creation when a mapper with the same name already exists.

Chore

Test Containers

  • Image Bumps - Updated the test container images used by BDD scenarios in .env.test.
    • REDIS__IMAGE: redis:8.6.2-alpineredis:8.6.3-alpine
    • POSTGRES__IMAGE: postgres:18.3-alpinepostgres:18.4-alpine
    • KEYCLOAK__IMAGE: keycloak/keycloak:26.6.1keycloak/keycloak:26.6.2
    • KAFKA__IMAGE: apache/kafka:4.2.0apache/kafka:4.3.0

Dependencies

  • Runtime dependencies - Updated version pins for production dependencies.
    • requests: >=2.34.0>=2.34.2
    • jdatetime: >=5.2.0>=5.3.0
  • Optional extras - Updated optional adapter extras.
    • cache: cachetools>=7.1.1cachetools>=7.1.4
    • elastic-apm: elastic-apm>=6.25.0elastic-apm>=6.26.1
    • fastapi: fastapi[all]>=0.136.1fastapi[all]>=0.136.3
    • jwt: pyjwt>=2.12.1pyjwt>=2.13.0
    • keycloak: cachetools>=7.1.1cachetools>=7.1.4
    • minio: boto3>=1.43.6boto3>=1.43.14, cachetools>=7.1.1cachetools>=7.1.4
    • scylladb: cachetools>=7.1.1cachetools>=7.1.4
    • sqlalchemy / sqlalchemy-async: sqlalchemy>=2.0.49sqlalchemy>=2.0.50
    • starrocks: pymysql>=1.1.3pymysql>=1.2.0
  • Dev dependencies - Updated development tooling and typing stubs.
    • boto3-stubs: >=1.43.6>=1.43.14
    • ruff: >=0.15.12>=0.15.14
    • ty: >=0.0.35>=0.0.39
    • types-cachetools: >=7.0.0.20260503>=7.0.0.20260518
    • types-grpcio: >=1.0.0.20260508>=1.0.0.20260518
    • types-protobuf: >=7.34.1.20260508>=7.34.1.20260518
    • types-pymysql: >=1.1.0.20260508>=1.1.0.20260518
    • types-regex: >=2026.5.9.20260510>=2026.5.9.20260518
    • types-requests: >=2.33.0.20260513>=2.33.0.20260518