docs: replace stale auth UI examples (#388)
Heimdall Gitea / Detect CI scope (push) Successful in 5s
Heimdall Gitea / Build and tests (push) Skipped
Heimdall Gitea / Build and scan server image (push) Skipped
Heimdall Gitea / Build and scan agent image (push) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Skipped
Heimdall Gitea / Publish versioned installer release (push) Skipped
Heimdall Gitea / CI policy (push) Successful in 2s
Heimdall Gitea / Detect CI scope (push) Successful in 5s
Heimdall Gitea / Build and tests (push) Skipped
Heimdall Gitea / Build and scan server image (push) Skipped
Heimdall Gitea / Build and scan agent image (push) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Skipped
Heimdall Gitea / Publish versioned installer release (push) Skipped
Heimdall Gitea / CI policy (push) Successful in 2s
Co-authored-by: Arnaud Dartois <admin@tordais.cc>
This commit was merged in pull request #388.
This commit is contained in:
1 parent
8f3d75680d
commit
b4d24c3345
2 files changed
+11
-28
No files matched your search
+9
-28
@@ -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
|
||||
<AuthorizeView Policy="@AppPermissions.CameraRead">
|
||||
<Authorized>
|
||||
<button @onclick="StartLiveView">📷 Live</button>
|
||||
</Authorized>
|
||||
<NotAuthorized>
|
||||
<MudTooltip Text="Accès non autorisé">
|
||||
<button disabled>📷 Live</button>
|
||||
</MudTooltip>
|
||||
</NotAuthorized>
|
||||
</AuthorizeView>
|
||||
```
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user