Browse Source

Update IdentityServerDbContext.

pull/4578/head
maliming 6 years ago
parent
commit
1fa69f0c9f
  1. 6
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/SecretConsts.cs
  2. 3
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IIdentityServerDbContext.cs
  3. 3
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContext.cs
  4. 16
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs

6
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/ApiResources/ApiResourceSecretConsts.cs → modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/SecretConsts.cs

@ -1,6 +1,6 @@
namespace Volo.Abp.IdentityServer.ApiResources namespace Volo.Abp.IdentityServer
{ {
public class ApiResourceSecretConsts public class SecretConsts
{ {
/// <summary> /// <summary>
/// Default value: 250 /// Default value: 250
@ -12,8 +12,6 @@
/// </summary> /// </summary>
public static int ValueMaxLength { get; set; } = 4000; public static int ValueMaxLength { get; set; } = 4000;
public static int ValueMaxLengthValue { get; set; } = ValueMaxLength;
/// <summary> /// <summary>
/// Default value: 1000 /// Default value: 1000
/// </summary> /// </summary>

3
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IIdentityServerDbContext.cs

@ -1,6 +1,7 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data; using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.ApiScopes; using Volo.Abp.IdentityServer.ApiScopes;
using Volo.Abp.IdentityServer.Clients; using Volo.Abp.IdentityServer.Clients;
using Volo.Abp.IdentityServer.Devices; using Volo.Abp.IdentityServer.Devices;
@ -22,6 +23,8 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
DbSet<ApiResourceScope> ApiResourceScopes { get; set; } DbSet<ApiResourceScope> ApiResourceScopes { get; set; }
DbSet<ApiResourceProperty> ApiResourceProperties { get; set; }
#endregion #endregion
#region ApiScope #region ApiScope

3
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContext.cs

@ -1,6 +1,7 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data; using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.ApiScopes; using Volo.Abp.IdentityServer.ApiScopes;
using Volo.Abp.IdentityServer.Clients; using Volo.Abp.IdentityServer.Clients;
using Volo.Abp.IdentityServer.Devices; using Volo.Abp.IdentityServer.Devices;
@ -22,6 +23,8 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
public DbSet<ApiResourceScope> ApiResourceScopes { get; set; } public DbSet<ApiResourceScope> ApiResourceScopes { get; set; }
public DbSet<ApiResourceProperty> ApiResourceProperties { get; set; }
#endregion #endregion
#region ApiScope #region ApiScope

16
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs

@ -128,16 +128,16 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
b.HasKey(x => new {x.ClientId, x.Type, x.Value}); b.HasKey(x => new {x.ClientId, x.Type, x.Value});
b.Property(x => x.Type).HasMaxLength(ApiResourceSecretConsts.TypeMaxLength).IsRequired(); b.Property(x => x.Type).HasMaxLength(SecretConsts.TypeMaxLength).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
{ {
ApiResourceSecretConsts.ValueMaxLengthValue = 300; SecretConsts.ValueMaxLengthValue = 300;
} }
b.Property(x => x.Value).HasMaxLength(ApiResourceSecretConsts.ValueMaxLengthValue).IsRequired(); b.Property(x => x.Value).HasMaxLength(SecretConsts.ValueMaxLengthValue).IsRequired();
b.Property(x => x.Description).HasMaxLength(ApiResourceSecretConsts.DescriptionMaxLength); b.Property(x => x.Description).HasMaxLength(SecretConsts.DescriptionMaxLength);
}); });
builder.Entity<ClientClaim>(b => builder.Entity<ClientClaim>(b =>
@ -263,15 +263,15 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
b.HasKey(x => new {x.ApiResourceId, x.Type, x.Value}); b.HasKey(x => new {x.ApiResourceId, x.Type, x.Value});
b.Property(x => x.Type).HasMaxLength(ApiResourceSecretConsts.TypeMaxLength).IsRequired(); b.Property(x => x.Type).HasMaxLength(SecretConsts.TypeMaxLength).IsRequired();
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle)) if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql, EfCoreDatabaseProvider.Oracle))
{ {
ApiResourceSecretConsts.ValueMaxLengthValue = 300; SecretConsts.ValueMaxLengthValue = 300;
} }
b.Property(x => x.Value).HasMaxLength(ApiResourceSecretConsts.ValueMaxLengthValue).IsRequired(); b.Property(x => x.Value).HasMaxLength(SecretConsts.ValueMaxLengthValue).IsRequired();
b.Property(x => x.Description).HasMaxLength(ApiResourceSecretConsts.DescriptionMaxLength); b.Property(x => x.Description).HasMaxLength(SecretConsts.DescriptionMaxLength);
}); });
builder.Entity<ApiResourceClaim>(b => builder.Entity<ApiResourceClaim>(b =>

Loading…
Cancel
Save