Browse Source

Make constants changeable.

pull/4161/head
Halil İbrahim Kalkan 6 years ago
parent
commit
5f2aa6fc39
  1. 1
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPostLogoutRedirectUriConsts.cs
  2. 1
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientRedirectUriConsts.cs
  3. 4
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantConsts.cs
  4. 32
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs

1
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientPostLogoutRedirectUriConsts.cs

@ -3,5 +3,6 @@
public class ClientPostLogoutRedirectUriConsts
{
public const int PostLogoutRedirectUriMaxLength = 2000;
public static int PostLogoutRedirectUriMaxLengthValue { get; set; } = 2000;
}
}

1
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Clients/ClientRedirectUriConsts.cs

@ -3,5 +3,6 @@
public class ClientRedirectUriConsts
{
public const int RedirectUriMaxLength = 2000;
public static int RedirectUriMaxLengthValue { get; set; } = 2000;
}
}

4
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantConsts.cs

@ -6,9 +6,7 @@
public const int TypeMaxLength = 50;
public const int SubjectIdMaxLength = 200;
public const int ClientIdMaxLength = 200;
// 50000 chosen to be explicit to allow enough size to avoid truncation, yet stay beneath the MySql row size limit of ~65K
// apparently anything over 4K converts to nvarchar(max) on SqlServer
public const int DataMaxLength = 50000;
public static int DataMaxLengthValue { get; set; }= 50000;
}
}

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

@ -80,13 +80,10 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql))
{
b.Property(x => x.RedirectUri).HasMaxLength(300).IsRequired();
}
else
{
b.Property(x => x.RedirectUri).HasMaxLength(ClientRedirectUriConsts.RedirectUriMaxLength)
.IsRequired();
}
ClientRedirectUriConsts.RedirectUriMaxLengthValue = 300;
}
b.Property(x => x.RedirectUri).HasMaxLength(ClientRedirectUriConsts.RedirectUriMaxLengthValue).IsRequired();
});
builder.Entity<ClientPostLogoutRedirectUri>(b =>
@ -99,13 +96,12 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql))
{
b.Property(x => x.PostLogoutRedirectUri).HasMaxLength(300).IsRequired();
}
else
{
b.Property(x => x.PostLogoutRedirectUri)
.HasMaxLength(ClientPostLogoutRedirectUriConsts.PostLogoutRedirectUriMaxLength).IsRequired();
}
ClientPostLogoutRedirectUriConsts.PostLogoutRedirectUriMaxLengthValue = 300;
}
b.Property(x => x.PostLogoutRedirectUri)
.HasMaxLength(ClientPostLogoutRedirectUriConsts.PostLogoutRedirectUriMaxLengthValue)
.IsRequired();
});
builder.Entity<ClientScope>(b =>
@ -199,12 +195,10 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
if (IsDatabaseProvider(builder, options, EfCoreDatabaseProvider.MySql))
{
b.Property(x => x.Data).HasMaxLength(10000).IsRequired();
}
else
{
b.Property(x => x.Data).HasMaxLength(PersistedGrantConsts.DataMaxLength).IsRequired();
PersistedGrantConsts.DataMaxLengthValue = 10000; //TODO: MySQL accepts 20.000. We can consider to change in v3.0.
}
b.Property(x => x.Data).HasMaxLength(PersistedGrantConsts.DataMaxLengthValue).IsRequired();
b.HasKey(x => x.Key); //TODO: What about Id!!!

Loading…
Cancel
Save