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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
10 additions and
2 deletions
-
modules/identityserver/src/Volo.Abp.IdentityServer.Domain.Shared/Volo/Abp/IdentityServer/Grants/PersistedGrantConsts.cs
-
modules/identityserver/src/Volo.Abp.IdentityServer.EntityFrameworkCore/Volo/Abp/IdentityServer/EntityFrameworkCore/IdentityServerDbContextModelCreatingExtensions.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
|
|
|
// 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
|
|
|
// apparently anything over 4K converts to nvarchar(max) on SqlServer
|
|
|
public const int DataMaxLength = 5000; |
|
|
public const int DataMaxLength = 50000; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -176,7 +176,15 @@ namespace Volo.Abp.IdentityServer.EntityFrameworkCore |
|
|
grant.Property(x => x.SubjectId).HasMaxLength(PersistedGrantConsts.SubjectIdMaxLength); |
|
|
grant.Property(x => x.SubjectId).HasMaxLength(PersistedGrantConsts.SubjectIdMaxLength); |
|
|
grant.Property(x => x.ClientId).HasMaxLength(PersistedGrantConsts.ClientIdMaxLength).IsRequired(); |
|
|
grant.Property(x => x.ClientId).HasMaxLength(PersistedGrantConsts.ClientIdMaxLength).IsRequired(); |
|
|
grant.Property(x => x.CreationTime).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!!!
|
|
|
grant.HasKey(x => x.Key); //TODO: What about Id!!!
|
|
|
|
|
|
|
|
|
|