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.
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.
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.
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.
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.
Concrete Return Type for _check - FastAPIRestRateLimitHandler._check now returns int instead of the removed
RedisResponseType alias and the TYPE_CHECKING import is dropped.
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.