feat(auth): ScadaBridge full canonical claims (ZbClaimTypes role/scope) + ZbCookieDefaults, keep cookie name (Task 1.5)

This commit is contained in:
Joseph Doherty
2026-06-02 06:23:15 -04:00
parent afa55981d5
commit a0938f708b
25 changed files with 247 additions and 50 deletions
@@ -16,8 +16,9 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.Tests.Layout;
/// reveals a section's items and persists state to a cookie) and that the
/// Notifications section's items are gated per-policy. The
/// <c>AuthorizeView Policy=...</c> blocks evaluate the real policies, which
/// require a claim of type <see cref="JwtTokenService.RoleClaimType"/> ("Role"),
/// so the test principal carries claims of that exact type.
/// require a claim of type <see cref="JwtTokenService.RoleClaimType"/> (the
/// canonical <c>ZbClaimTypes.Role</c> framework URI), so the test principal
/// carries claims of that exact type.
/// </summary>
public class NavMenuTests : BunitContext
{
@@ -40,7 +41,7 @@ public class NavMenuTests : BunitContext
/// </summary>
private IRenderedComponent<NavMenu> RenderWithRoles(params string[] roles)
{
var claims = new List<Claim> { new("Username", "tester") };
var claims = new List<Claim> { new(JwtTokenService.UsernameClaimType, "tester") };
claims.AddRange(roles.Select(r => new Claim(JwtTokenService.RoleClaimType, r)));
var user = new ClaimsPrincipal(new ClaimsIdentity(claims, "TestAuth"));