|
| 1 | +## Unreleased |
| 2 | + |
| 3 | +### Added |
| 4 | + |
| 5 | +- **Public extension SDK (`litestar_auth.extensions`).** The internal extension kernel is now a stable, |
| 6 | + publicly documented authoring surface. `litestar_auth.extensions` is the only import path an external |
| 7 | + extension needs — it re-exports the `AuthExtension` contract together with its |
| 8 | + `AuthExtensionValidationContext` / `AuthExtensionRegistrationContext` typed contexts (all three are now |
| 9 | + also exported from the root `litestar_auth` package), `EXTENSION_API_VERSION`, |
| 10 | + `EXTENSION_ENTRY_POINT_GROUP`, and the public controller factories authors need (reaching into |
| 11 | + `litestar_auth._plugin.*` is unsupported and guarded by an import-isolation regression test). Register |
| 12 | + extensions explicitly via `LitestarAuthConfig.extensions=(...)`; an extension contributes controllers, |
| 13 | + dependencies, middleware, OpenAPI security schemes, startup/shutdown hooks, and exception handlers |
| 14 | + through the typed contexts. An optional `enabled` flag toggles an extension off without removing it from |
| 15 | + configuration (omitting it is treated as enabled). |
| 16 | + |
| 17 | +- **Versioned extension boundary.** `EXTENSION_API_VERSION` (currently `(1, 0)`) versions the authoring |
| 18 | + contract independently of the rest of the library. An extension may declare a `requires_api` minimum; |
| 19 | + an incompatible requirement fails closed with `ConfigurationError` before any application wiring runs. |
| 20 | + |
| 21 | +- **Opt-in entry-point discovery.** New `LitestarAuthConfig.auto_discover_extensions` (default `False`) |
| 22 | + loads external extensions published under the `litestar_auth.extensions` entry-point group, following |
| 23 | + the `litestar_auth_ext_*` distribution-naming convention. Discovery is fail-closed: an entry point that |
| 24 | + cannot load, cannot instantiate, or does not produce a valid `AuthExtension` raises `ConfigurationError`. |
| 25 | + |
| 26 | +- **CLI and manager-event contribution surfaces.** New optional `AuthCliExtension` lets an extension |
| 27 | + contribute CLI commands; `on_cli_init` now routes through it (the built-in organization administration |
| 28 | + CLI is its first internal consumer). New optional `AuthEventSubscriberExtension` lets an extension |
| 29 | + observe manager lifecycle events through **redacted** payloads — token-bearing values and credential |
| 30 | + fields (passwords, hashed passwords, invitation tokens, and similar) are stripped before delivery. |
| 31 | + |
| 32 | +- **`RoleAdminExtension` first-party extension.** The contrib role-administration controller is now also |
| 33 | + available as a public `RoleAdminExtension` (import from `litestar_auth.contrib.role_admin`) for explicit |
| 34 | + `extensions=(...)` registration — the canonical example of the user-facing authoring API. A runnable |
| 35 | + reference is bundled at `examples/demo_external_extension/`. |
| 36 | + |
| 37 | +### Changed |
| 38 | + |
| 39 | +- **Built-in optional features now wire through the extension pipeline.** OAuth, TOTP, user-owned API |
| 40 | + keys, and organization administration/invitations are auto-materialized into the same extension pipeline |
| 41 | + from their existing configuration flags. Behavior for existing configurations is unchanged. As part of |
| 42 | + this, `LitestarAuthConfig.resolve_extensions()` is memoized, so extension-relevant configuration must be |
| 43 | + set before the plugin first resolves extensions during application init. |
| 44 | + |
| 45 | +- **Extension OpenAPI security scheme names must be globally unique and fail closed on collision.** |
| 46 | + Extension-contributed OpenAPI security scheme names may not collide with each other or with core auth |
| 47 | + scheme names (bearer/cookie backend names, `apiKeyAuth`, and `apiKeyHmacAuth` for signed API keys). A |
| 48 | + collision raises `ConfigurationError` during application initialization, before the app is usable. |
| 49 | + |
1 | 50 | ## 4.2.0 (2026-06-05) |
2 | 51 |
|
3 | 52 | ### Added |
|
0 commit comments