Add migration to update ApiClients with centralized authorization scopes

This migration updates the ScopesJson for the ApiClient with Id 91000000-0000-0000-0000-000000000001 to include additional authorization scopes for improved API access control. The Down method reverts the changes if necessary.
This commit is contained in:
Torsten Brendgen
2026-07-09 23:49:01 +02:00
parent dc93ea0813
commit dfd9c16f61
27 changed files with 5617 additions and 34 deletions

View File

@@ -3,6 +3,7 @@ using System.Security.Claims;
using System.Text;
using System.Text.Json;
using Microsoft.IdentityModel.Tokens;
using Microsoft.SelfService.Portal.Core.API.Authorization;
using Microsoft.SelfService.Portal.Core.API.Models;
namespace Microsoft.SelfService.Portal.Core.API.Services
@@ -138,13 +139,19 @@ namespace Microsoft.SelfService.Portal.Core.API.Services
return
[
"deployment.read",
"deployment.write",
"queue.process",
"template.read",
"credential.resolve",
"token.manage",
"token.admin"
ApiScopes.ConfigurationRead,
ApiScopes.ConfigurationWrite,
ApiScopes.CredentialRead,
ApiScopes.CredentialWrite,
ApiScopes.CredentialResolve,
ApiScopes.DeploymentRead,
ApiScopes.DeploymentWrite,
ApiScopes.QueueRead,
ApiScopes.QueueProcess,
ApiScopes.TemplateRead,
ApiScopes.TemplateWrite,
ApiScopes.TokenManage,
ApiScopes.TokenAdmin
];
}