Browse Source

Update migrations of `OpenIddict.Demo.Server`.

pull/18347/head
maliming 3 years ago
parent
commit
cf09d28094
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 18
      modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231204054625_Initial.Designer.cs
  2. 5
      modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231204054625_Initial.cs
  3. 1598
      modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231204084517_openiddict5.Designer.cs
  4. 59
      modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231204084517_openiddict5.cs
  5. 6
      modules/openiddict/test/Volo.Abp.OpenIddict.Domain.Tests/Volo/Abp/OpenIddict/Applications/AbpOpenIddictApplicationStore_Tests.cs

18
modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231204054625_Initial.Designer.cs

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace OpenIddict.Demo.Server.Migrations
{
[DbContext(typeof(ServerDbContext))]
[Migration("20231204054625_Initial")]
[Migration("20231116094249_Initial")]
partial class Initial
{
/// <inheritdoc />
@ -818,10 +818,6 @@ namespace OpenIddict.Demo.Server.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<string>("ApplicationType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ClientId")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
@ -829,10 +825,6 @@ namespace OpenIddict.Demo.Server.Migrations
b.Property<string>("ClientSecret")
.HasColumnType("nvarchar(max)");
b.Property<string>("ClientType")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ClientUri")
.HasColumnType("nvarchar(max)");
@ -880,9 +872,6 @@ namespace OpenIddict.Demo.Server.Migrations
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<string>("JsonWebKeySet")
.HasColumnType("nvarchar(max)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
@ -909,8 +898,9 @@ namespace OpenIddict.Demo.Server.Migrations
b.Property<string>("Requirements")
.HasColumnType("nvarchar(max)");
b.Property<string>("Settings")
.HasColumnType("nvarchar(max)");
b.Property<string>("Type")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id");

5
modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231204054625_Initial.cs

@ -340,20 +340,17 @@ namespace OpenIddict.Demo.Server.Migrations
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ApplicationType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ClientId = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
ClientSecret = table.Column<string>(type: "nvarchar(max)", nullable: true),
ClientType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ConsentType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
DisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true),
DisplayNames = table.Column<string>(type: "nvarchar(max)", nullable: true),
JsonWebKeySet = table.Column<string>(type: "nvarchar(max)", nullable: true),
Permissions = table.Column<string>(type: "nvarchar(max)", nullable: true),
PostLogoutRedirectUris = table.Column<string>(type: "nvarchar(max)", nullable: true),
Properties = table.Column<string>(type: "nvarchar(max)", nullable: true),
RedirectUris = table.Column<string>(type: "nvarchar(max)", nullable: true),
Requirements = table.Column<string>(type: "nvarchar(max)", nullable: true),
Settings = table.Column<string>(type: "nvarchar(max)", nullable: true),
Type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
ClientUri = table.Column<string>(type: "nvarchar(max)", nullable: true),
LogoUri = table.Column<string>(type: "nvarchar(max)", nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),

1598
modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231204084517_openiddict5.Designer.cs

File diff suppressed because it is too large

59
modules/openiddict/app/OpenIddict.Demo.Server/Migrations/20231204084517_openiddict5.cs

@ -0,0 +1,59 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace OpenIddict.Demo.Server.Migrations
{
/// <inheritdoc />
public partial class openiddict5 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Type",
table: "OpenIddictApplications",
newName: "ClientType");
migrationBuilder.AddColumn<string>(
name: "ApplicationType",
table: "OpenIddictApplications",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "JsonWebKeySet",
table: "OpenIddictApplications",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Settings",
table: "OpenIddictApplications",
type: "nvarchar(max)",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ApplicationType",
table: "OpenIddictApplications");
migrationBuilder.DropColumn(
name: "JsonWebKeySet",
table: "OpenIddictApplications");
migrationBuilder.DropColumn(
name: "Settings",
table: "OpenIddictApplications");
migrationBuilder.RenameColumn(
name: "ClientType",
table: "OpenIddictApplications",
newName: "Type");
}
}
}

6
modules/openiddict/test/Volo.Abp.OpenIddict.Domain.Tests/Volo/Abp/OpenIddict/Applications/AbpOpenIddictApplicationStore_Tests.cs

@ -6,6 +6,7 @@ using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Tokens;
using OpenIddict.Abstractions;
using Shouldly;
using Xunit;
@ -73,19 +74,24 @@ public class AbpOpenIddictApplicationStore_Tests : OpenIddictDomainTestBase
{
var clientId = Guid.NewGuid().ToString();
await _applicationStore.CreateAsync(new OpenIddictApplicationModel {
ApplicationType = OpenIddictConstants.ApplicationTypes.Web,
ClientId = clientId,
ConsentType = OpenIddictConstants.ConsentTypes.Explicit,
DisplayName = "Test Application",
ClientType = OpenIddictConstants.ClientTypes.Public,
JsonWebKeySet = JsonWebKeySet.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Qx2UBadIf7VjBOQeXNO2PG/NMNLwVoH4YMNCr83remg7VUVRWdKSfdrCLaNIHBHlNnLLdtbNtSAhiN20/NPgSK1nvzhm1rdC8JE2CzBhWkoiKL+uTqpwZvS4mRYKQDZPIGo5j1uPSafcODenVyiZqSw+CntE6h1dcMdw3qWLPXHV5chAIf2W+ol+/hmiKpKYht9hI9Xs3PkH48tep7dZsaw5IGTUTl3qPXUik/swrlDWgKA4/d7xRZys3RgeMIlG3kW/n73mwCg8CAwEAAaNQME4wHQYDVR0OBBYEFCnN7HANDCj/ncgFu4AI+U6wXn2AMB8GA1UdIwQYMBaAFCnN7HANDCj/ncgFu4AI+U6wXn2AMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAEvVPtZnXzebhgVIyD+TBE7cgI567ck5W9kfeZhJLPlWQzrOQCgXbR7rqNLRs4K73k6Yo6/9E5jAOtjlqqotiqj89tqOTZzG6kDIVoMiYJjgEVLeF1bVBnCA7xDbdpVfrL2IOnNGy9Ys+FsG6EV/oBbTw8Fqk+5c7M0RvverCaEfPHWSTg6M+B5pHBk50p67MB6DeaD0u6RUnCkqYxBBPrnVHvvGEoimoEAdT5g3/8CAtAG9m4b9IoBpUHi626b+/SS+2h1xr4oq54gxG8jlDkLoRWT2cKiFM/bCufZkd1LyOmke8udpHBZ3Jt0nH64oZdSUT6huDzYBdtXfSw3XTwo=\"]}]}"),
PostLogoutRedirectUris = "https://abp.io",
RedirectUris = "https://abp.io"
}, CancellationToken.None);
var application = await _applicationStore.FindByClientIdAsync(clientId, CancellationToken.None);
application.ShouldNotBeNull();
application.ApplicationType.ShouldBe(OpenIddictConstants.ApplicationTypes.Web);
application.ClientId.ShouldBe(clientId);
application.DisplayName.ShouldBe("Test Application");
application.ClientType.ShouldBe(OpenIddictConstants.ClientTypes.Public);
application.JsonWebKeySet.ShouldNotBeNull();
application.JsonWebKeySet.Keys.First().Alg.ShouldBe(SecurityAlgorithms.RsaSha256);
application.PostLogoutRedirectUris.ShouldBe("https://abp.io");
application.RedirectUris.ShouldBe("https://abp.io");
}

Loading…
Cancel
Save