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:
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Microsoft.SelfService.Portal.Core.API.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddCentralizedAuthorizationScopes : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.UpdateData(
|
||||
table: "ApiClients",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("91000000-0000-0000-0000-000000000001"),
|
||||
column: "ScopesJson",
|
||||
value: "[\"configuration.read\",\"configuration.write\",\"credential.read\",\"credential.write\",\"credential.resolve\",\"deployment.read\",\"deployment.write\",\"queue.read\",\"queue.process\",\"template.read\",\"template.write\",\"token.manage\",\"token.admin\"]");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.UpdateData(
|
||||
table: "ApiClients",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("91000000-0000-0000-0000-000000000001"),
|
||||
column: "ScopesJson",
|
||||
value: "[\"deployment.read\",\"deployment.write\",\"queue.process\",\"template.read\",\"credential.resolve\",\"token.manage\",\"token.admin\"]");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user