Arnaud Dartois
b0cfd50c3f
feat(api-keys): API key management endpoint + admin UI (#149)
## Summary
Adds API key management functionality to Heimdall:
- **CQRS Handlers**: CreateApiKey, ListApiKeys, RevokeApiKey
- **Controller**: ApiKeysController with admin authorization (Admin.ApiKeys policy)
- **UI**: ApiKeysPage.razor admin page with create, list, and revoke
- **Auth**: Updated ApiKeyAuthenticationHandler to reject expired keys
- **Tests**: 10 unit tests for all handlers
## Changes
- `src/Heimdall.Application/ApiKeys/` — New CQRS handlers and DTOs
- `src/Heimdall.Web/Controllers/ApiKeysController.cs` — Admin API endpoints
- `src/Heimdall.Web/Components/Pages/Admin/ApiKeysPage.razor` — Admin UI
- `src/Heimdall.Infrastructure/Security/ApiKeyAuthenticationHandler.cs` — Expiry check
- `src/Heimdall.Web/Services/HeimdallApiClient.cs` — API client methods
- `tests/Heimdall.Application.Tests/Handlers/ApiKeys/` — Unit tests
## Acceptance Criteria
- [x] POST /api/api-keys → key created (plain shown once, hash in DB)
- [x] GET /api/api-keys → prefix only (never the full key)
- [x] DELETE /api/api-keys/{id} → key revoked immediately
- [x] Expired keys rejected by auth handler
- [x] Admin UI with create, list, and revoke functionality
- [x] All tests passing (10 new tests)
Closes #10
Reviewed-on: https://forgejo.tordais.cc/nonobis/Heimdall/pulls/149
2026-08-19 22:47:22 +02:00
..
2026-08-11 11:13:06 +02:00
2026-08-19 22:47:22 +02:00
2026-08-12 12:18:52 +02:00
2026-08-11 11:59:18 +02:00
2026-08-12 10:14:40 +02:00
2026-08-10 23:26:32 +02:00
2026-08-10 15:16:09 +02:00
2026-08-11 11:13:06 +02:00
2026-08-19 22:38:34 +02:00
2026-08-10 22:36:18 +02:00
2026-07-17 07:05:07 +00:00
2026-08-10 15:29:35 +02:00
2026-08-11 11:59:18 +02:00