Browse Source

Merge pull request #1936 from abpframework/maliming/id4

Update PersistedGrant data max length.
pull/1938/head
Halil İbrahim Kalkan 7 years ago
committed by GitHub
parent
commit
e51287a0be
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantConsts.cs
  2. 10
      modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.cs

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

@ -9,6 +9,6 @@
// 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 = 5000;
public const int DataMaxLength = 50000;
}
}

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

@ -176,7 +176,15 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore
grant.Property(x => x.SubjectId).HasMaxLength(PersistedGrantConsts.SubjectIdMaxLength);
grant.Property(x => x.ClientId).HasMaxLength(PersistedGrantConsts.ClientIdMaxLength).IsRequired();
grant.Property(x => x.CreationTime).IsRequired();
grant.Property(x => x.Data).HasMaxLength(PersistedGrantConsts.DataMaxLength).IsRequired();
if (options.DatabaseProvider == EfCoreDatabaseProvider.MySql)
{
grant.Property(x => x.Data).HasMaxLength(10000).IsRequired();
}
else
{
grant.Property(x => x.Data).HasMaxLength(PersistedGrantConsts.DataMaxLength).IsRequired();
}
grant.HasKey(x => x.Key); //TODO: What about Id!!!

Loading…
Cancel
Save