fix(secrets-ui): admin role must be canonical 'Administrator' (case-sensitive) — 0.1.1
Reference-consumer (HistorianGateway) caught that SecretsAuthorization.AdminRole was 'administrator' (lowercase) while the family canonical role is CanonicalRole.Administrator. ASP.NET role claims compare case-sensitively (Ordinal), so a real admin got 403 on the secrets UI. Now nameof(CanonicalRole.Administrator).
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Version>0.1.0</Version>
|
||||
<Version>0.1.1</Version>
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using ZB.MOM.WW.Auth.Abstractions.Roles;
|
||||
using ZB.MOM.WW.Auth.AspNetCore;
|
||||
|
||||
namespace ZB.MOM.WW.Secrets.Ui;
|
||||
@@ -46,8 +47,13 @@ public static class SecretsAuthorization
|
||||
/// <summary>Role that grants secret value reveal (satisfies both <see cref="RevealPolicy"/> and <see cref="ManagePolicy"/>).</summary>
|
||||
public const string RevealRole = "secrets-reveal";
|
||||
|
||||
/// <summary>Administrator role that satisfies every secrets policy.</summary>
|
||||
public const string AdminRole = "administrator";
|
||||
/// <summary>
|
||||
/// Administrator role that satisfies every secrets policy. Uses the family's canonical
|
||||
/// <see cref="CanonicalRole.Administrator"/> role name ("Administrator") so an existing
|
||||
/// admin principal satisfies the secrets policies without a separate mapping. Role-claim
|
||||
/// values are compared case-sensitively, so the exact canonical spelling matters.
|
||||
/// </summary>
|
||||
public const string AdminRole = nameof(CanonicalRole.Administrator);
|
||||
|
||||
/// <summary>
|
||||
/// Registers the <see cref="ManagePolicy"/> and <see cref="RevealPolicy"/> policies on the
|
||||
|
||||
Reference in New Issue
Block a user