From e01d2e6fbd552740b3b6e0d8fb2a719133f5681b Mon Sep 17 00:00:00 2001 From: Arnaud Dartois Date: Fri, 13 Nov 2026 11:11:23 +0100 Subject: [PATCH] docs: replace stale auth UI examples (#387) --- docs/auth-roles.md | 37 ++++++++----------------------- skills/heimdall-identity/SKILL.md | 2 ++ 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/docs/auth-roles.md b/docs/auth-roles.md index ff63446..09af229 100644 --- a/docs/auth-roles.md +++ b/docs/auth-roles.md @@ -217,36 +217,17 @@ policy appliquée à ces deux endpoints dans le contrôleur actuel. } } -// Page Events — filtrer par site si User non-Admin -@code { - protected override async Task OnInitializedAsync() - { - if (await AuthorizeService.IsAdminAsync()) - { - _sites = await SiteService.GetAllAsync(); - } - else - { - _sites = await SiteService.GetMySitesAsync(); - } - } -} ``` -### AuthorizeView - -```razor - - - - - - - - - - -``` +Les pages authentifiées sont enveloppées par `AuthorizeRouteView` dans +[`Routes.razor`](../src/Heimdall.Web/Components/Routes.razor); par exemple, +[`EventsPage.razor`](../src/Heimdall.Web/Components/Pages/EventsPage.razor) +déclare `[Authorize]` et charge les données via `HeimdallApiClient`. Les listes +et détails site/caméra ne filtrent pas les ressources selon un `IsAdminAsync` +local : les endpoints et queries appliquent les permissions puis +[`ResourceAccess`](../src/Heimdall.Web/Security/ResourceAccess.cs) et les +services d’accès aux ressources. Les endpoints de session live et la distinction +`Camera.Read`/`Camera.Live` sont décrits ci-dessus. --- diff --git a/skills/heimdall-identity/SKILL.md b/skills/heimdall-identity/SKILL.md index c3cc402..ba81822 100644 --- a/skills/heimdall-identity/SKILL.md +++ b/skills/heimdall-identity/SKILL.md @@ -11,6 +11,8 @@ When maintaining `docs/auth-roles.md`, verify its role names and default permiss Verify identity model examples against `Infrastructure/Identity/IdentityAppUser.cs`, `Domain/Entities/UserSite.cs`, and `Infrastructure/Data/Configurations/UserSiteConfiguration.cs`. Keep ASP.NET Identity in Infrastructure; `UserSite` stores the user ID without an Identity navigation, and Infrastructure maps that foreign key. +Before documenting UI/API authorization examples in `docs/auth-roles.md`, verify referenced pages, methods, policies, and routes against `Components/Routes.razor`, the page components, controllers, and `ResourceAccess`. Do not preserve generic authorization snippets that reference services or callbacks absent from the application; distinguish page authentication from API resource filtering. + - Identity owns password hashing, normalized account lookup, role membership, lockout, authenticator tokens, and email/password tokens. Do not duplicate password or token cryptography in Heimdall. - Keep ASP.NET Core Identity packages and types inside Infrastructure. Domain must not reference Identity; Application uses `IIdentityAccountService` and `IdentityAccount` only. Put Identity EF entities (`IdentityAppUser`, `IdentityAppRole`) and `UserManager`/`RoleManager` adapters in Infrastructure. Keep user-related Domain relationships keyed by `Guid UserId`; configure their foreign keys to the Infrastructure user entity. - When creating an Identity user, copy the generated `SecurityStamp` back into the application account before building the first session/JWT. Cover bootstrap and regular user creation with a relational session validation test. -- 2.54.1