5.7.0 — 2026-10-03¶
← 5.7.1 | 5.6.0 → | ↑ 5.x series
Added¶
Models - DTOs¶
AuthenticatedUserDTOandActorDTO- Added Keycloak DTOs describing the authenticated caller and the acting parties behind a token.ActorDTOcarries an actoridandtype(ActorType.USERorActorType.CLIENT)AuthenticatedUserDTOexposesactor_chain,current_actor,is_impersonated, andpropagation_headers()- The bearer token is stored as a
SecretStrand masked inreprand logs AuthContextinkeycloak_utilsremains as an alias ofAuthenticatedUserDTO
Models - Types¶
ActorType- AddedActorTypeenum (USER,CLIENT) for RFC 8693actclaim entries.
Helpers - Keycloak¶
- Impersonation tracking - Request authentication now parses the RFC 8693
actclaim emitted by Keycloak 26.8.- Nested
actclaims are flattened into an actor chain, outermost (current) actor first, capped at 8 entries - gRPC auth decorators set the actor chain on the auth context; FastAPI dependencies set
request.state.actor_chain - Impersonated requests are logged at
INFOwith the subject and the full actor chain propagation_headers()forwards the same bearer token so downstream services see the sameactclaim
- Nested
Adapters - Keycloak¶
- Token exchange - Added
exchange_tokento the sync and async Keycloak adapters and ports.- Pass
requested_subjectto impersonate a user via RFC 8693 token exchange
- Pass
Changed¶
Models - DTOs¶
- Constrained Pydantic types - DTO numeric fields now use
PositiveInt,NonNegativeInt, andNonNegativeFloatinstead of bare numbers with manual bounds.- Applies to Parsian and Saman IPG, pagination, rate-limit window, Vault lease, email attachment, and Redis Search DTOs
- Redis
KnnQueryDTO.kand the vector fielddimmust be positive;SearchQueryDTO.offsetandlimitmust be non-negative
SortDTOandSearchInputDTObase class - Both now extendBaseDTO, so they are frozen and supportfrom_attributeslike other DTOs.
Dependencies¶
pydantic-extra-types- Addedpydantic-extra-types>=2.11.1as a direct dependency.