Browse Source

Merge pull request #21755 from abpframework/auto-merge/rel-9-0/3335

Merge branch dev with rel-9.0
pull/21756/head
maliming 1 year ago
committed by GitHub
parent
commit
16f20c2a2a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentitySecurityLogRepository.cs
  2. 8
      modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentitySecurityLogRepository.cs
  3. 12
      modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentitySecurityLogRepository.cs

2
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IIdentitySecurityLogRepository.cs

@ -21,6 +21,7 @@ public interface IIdentitySecurityLogRepository : IBasicRepository<IdentitySecur
string userName = null,
string clientId = null,
string correlationId = null,
string clientIpAddress = null,
bool includeDetails = false,
CancellationToken cancellationToken = default);
@ -34,6 +35,7 @@ public interface IIdentitySecurityLogRepository : IBasicRepository<IdentitySecur
string userName = null,
string clientId = null,
string correlationId = null,
string clientIpAddress = null,
CancellationToken cancellationToken = default);
Task<IdentitySecurityLog> GetByUserIdAsync(

8
modules/identity/src/Volo.Abp.Identity.EntityFrameworkCore/Volo/Abp/Identity/EntityFrameworkCore/EfCoreIdentitySecurityLogRepository.cs

@ -31,6 +31,7 @@ public class EfCoreIdentitySecurityLogRepository : EfCoreRepository<IIdentityDbC
string userName = null,
string clientId = null,
string correlationId = null,
string clientIpAddress = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
@ -46,6 +47,7 @@ public class EfCoreIdentitySecurityLogRepository : EfCoreRepository<IIdentityDbC
userName,
clientId,
correlationId,
clientIpAddress,
cancellationToken
);
@ -64,6 +66,7 @@ public class EfCoreIdentitySecurityLogRepository : EfCoreRepository<IIdentityDbC
string userName = null,
string clientId = null,
string correlationId = null,
string clientIpAddress = null,
CancellationToken cancellationToken = default)
{
cancellationToken = GetCancellationToken(cancellationToken);
@ -78,6 +81,7 @@ public class EfCoreIdentitySecurityLogRepository : EfCoreRepository<IIdentityDbC
userName,
clientId,
correlationId,
clientIpAddress,
cancellationToken
);
@ -101,6 +105,7 @@ public class EfCoreIdentitySecurityLogRepository : EfCoreRepository<IIdentityDbC
string userName = null,
string clientId = null,
string correlationId = null,
string clientIpAddress = null,
CancellationToken cancellationToken = default)
{
return (await GetDbSetAsync()).AsNoTracking()
@ -112,6 +117,7 @@ public class EfCoreIdentitySecurityLogRepository : EfCoreRepository<IIdentityDbC
.WhereIf(userId.HasValue, securityLog => securityLog.UserId == userId)
.WhereIf(!userName.IsNullOrWhiteSpace(), securityLog => securityLog.UserName == userName)
.WhereIf(!clientId.IsNullOrWhiteSpace(), securityLog => securityLog.ClientId == clientId)
.WhereIf(!correlationId.IsNullOrWhiteSpace(), securityLog => securityLog.CorrelationId == correlationId);
.WhereIf(!correlationId.IsNullOrWhiteSpace(), securityLog => securityLog.CorrelationId == correlationId)
.WhereIf(!clientIpAddress.IsNullOrWhiteSpace(), securityLog => securityLog.ClientIpAddress == clientIpAddress);
}
}

12
modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/MongoIdentitySecurityLogRepository.cs

@ -32,6 +32,7 @@ public class MongoIdentitySecurityLogRepository :
string userName = null,
string clientId = null,
string correlationId = null,
string clientIpAddress = null,
bool includeDetails = false,
CancellationToken cancellationToken = default)
{
@ -45,6 +46,7 @@ public class MongoIdentitySecurityLogRepository :
userName,
clientId,
correlationId,
clientIpAddress,
cancellationToken
);
@ -64,6 +66,7 @@ public class MongoIdentitySecurityLogRepository :
string userName = null,
string clientId = null,
string correlationId = null,
string clientIpAddress = null,
CancellationToken cancellationToken = default)
{
var query = await GetListQueryAsync(
@ -76,6 +79,7 @@ public class MongoIdentitySecurityLogRepository :
userName,
clientId,
correlationId,
clientIpAddress,
cancellationToken
);
@ -101,19 +105,19 @@ public class MongoIdentitySecurityLogRepository :
string userName = null,
string clientId = null,
string correlationId = null,
string clientIpAddress = null,
CancellationToken cancellationToken = default)
{
return (await GetMongoQueryableAsync(cancellationToken))
.WhereIf(startTime.HasValue, securityLog => securityLog.CreationTime >= startTime.Value)
.WhereIf(endTime.HasValue, securityLog => securityLog.CreationTime < endTime.Value.AddDays(1).Date)
.WhereIf(!applicationName.IsNullOrWhiteSpace(),
securityLog => securityLog.ApplicationName == applicationName)
.WhereIf(!applicationName.IsNullOrWhiteSpace(), securityLog => securityLog.ApplicationName == applicationName)
.WhereIf(!identity.IsNullOrWhiteSpace(), securityLog => securityLog.Identity == identity)
.WhereIf(!action.IsNullOrWhiteSpace(), securityLog => securityLog.Action == action)
.WhereIf(userId.HasValue, securityLog => securityLog.UserId == userId)
.WhereIf(!userName.IsNullOrWhiteSpace(), securityLog => securityLog.UserName == userName)
.WhereIf(!clientId.IsNullOrWhiteSpace(), securityLog => securityLog.ClientId == clientId)
.WhereIf(!correlationId.IsNullOrWhiteSpace(),
securityLog => securityLog.CorrelationId == correlationId);
.WhereIf(!correlationId.IsNullOrWhiteSpace(), securityLog => securityLog.CorrelationId == correlationId)
.WhereIf(!clientIpAddress.IsNullOrWhiteSpace(), securityLog => securityLog.ClientIpAddress == clientIpAddress);
}
}

Loading…
Cancel
Save