|
| 1 | +## [4.2.0] - 2026-02-21 |
| 2 | +### Features |
| 3 | +- WebAuthn / Passkey support (opt-in, disabled by default) |
| 4 | + - Passwordless authentication via platform authenticators (Touch ID, Face ID, Windows Hello) and roaming security keys (YubiKey) |
| 5 | + - Synced passkey support (iCloud Keychain, Google Password Manager, etc.) |
| 6 | + - Passkey management REST API under `/user/webauthn/*` (auth required): |
| 7 | + - GET `/user/webauthn/credentials` — List user's registered passkeys |
| 8 | + - GET `/user/webauthn/has-credentials` — Check if user has any passkeys |
| 9 | + - PUT `/user/webauthn/credentials/{id}/label` — Rename a passkey (max 64 chars) |
| 10 | + - DELETE `/user/webauthn/credentials/{id}` — Delete a passkey (with last-credential protection) |
| 11 | + - `WebAuthnAuthenticationToken` — Custom authentication token that distinguishes passkey sessions from password-based sessions, enabling downstream code to check how a user authenticated |
| 12 | + - Automatic cleanup of passkey data when a user account is deleted via `WebAuthnPreDeleteEventListener` (listens for `UserPreDeleteEvent`) |
| 13 | + - Configuration properties under `user.webauthn.*` (enabled, rpId, rpName, allowedOrigins) |
| 14 | + - Database schema additions: `user_entities` and `user_credentials` tables with `ON DELETE CASCADE` for referential integrity |
| 15 | + |
| 16 | +### Fixes |
| 17 | +- Safety and input handling |
| 18 | + - Safe-parse `AuthenticatorTransport` enum values to prevent `IllegalArgumentException` on unknown transport types |
| 19 | + - Default passkey label to "Passkey" when no label is provided instead of leaving it blank |
| 20 | + - Trim passkey labels before enforcing the 64-character length limit |
| 21 | + - Fixed TOCTOU race condition in last-credential protection by recounting credentials inside the `@Transactional` boundary |
| 22 | +- Data integrity |
| 23 | + - Added `ON DELETE CASCADE` to WebAuthn foreign keys so credential data is cleaned up at the database level when a user is deleted |
| 24 | + - Added `WebAuthnPreDeleteEventListener` to clean up WebAuthn user entities and credentials via JPA before user deletion, complementing the cascade |
| 25 | +- API quality |
| 26 | + - `transports` field in credential responses is now `List<String>` instead of a single comma-delimited string |
| 27 | + - Added `@NotBlank` validation on path variable parameters in management API endpoints |
| 28 | + - `WebAuthnManagementAPIAdvice` is now `@ConditionalOnProperty(name = "user.webauthn.enabled")` so it is not loaded when WebAuthn is disabled |
| 29 | +- Design improvements |
| 30 | + - `WebAuthnException` now extends `RuntimeException` (was checked `Exception`), simplifying error handling throughout the WebAuthn stack |
| 31 | + - User handle generation uses `SecureRandom` bytes instead of deterministic user ID mapping, improving privacy |
| 32 | + - Credential operations use `@Transactional(propagation = MANDATORY)` to enforce that callers provide a transaction context |
| 33 | + |
| 34 | +### Breaking Changes |
| 35 | +- None. WebAuthn is a new opt-in feature disabled by default. Existing APIs and behavior are unchanged. |
| 36 | + |
| 37 | +### Documentation |
| 38 | +- Added WebAuthn/Passkey sections to README (setup, features, API endpoints) and CONFIG (settings, examples, important notes) |
| 39 | +- Updated CHANGELOG with 4.2.0 entry |
| 40 | + |
| 41 | +### Testing |
| 42 | +- New test suites for all WebAuthn components: |
| 43 | + - `WebAuthnManagementAPITest` — REST endpoint behavior, validation, error handling |
| 44 | + - `WebAuthnCredentialManagementServiceTest` — Service-layer logic, TOCTOU protection, transports parsing |
| 45 | + - `WebAuthnAuthenticationSuccessHandlerTest` — Authentication token creation, user resolution |
| 46 | + - `WebAuthnUserEntityBridgeTest` — User entity bridge and handle generation |
| 47 | + - `WebAuthnPreDeleteEventListenerTest` — Cleanup on user deletion |
| 48 | + |
| 49 | +### Other Changes |
| 50 | +- Version bumped to 4.2.0-SNAPSHOT in gradle.properties |
| 51 | +- Test output noise reduced with context-aware verbosity for expected WebAuthn exceptions |
| 52 | + |
1 | 53 | ## [4.1.0] - 2026-02-02 |
2 | 54 | ### Features |
3 | 55 | - GDPR compliance (opt‑in, disabled by default) |
|
0 commit comments