Browse Source

feat(audit-logs): Add ClientIPAddress filter

pull/9717/head
Berkan Sasmaz 5 years ago
parent
commit
dd67042309
  1. 2
      modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/IAuditLogRepository.cs
  2. 6
      modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs
  3. 6
      modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs

2
modules/audit-logging/src/Volo.Abp.AuditLogging.Domain/Volo/Abp/AuditLogging/IAuditLogRepository.cs

@ -21,6 +21,7 @@ namespace Volo.Abp.AuditLogging
Guid? userId = null,
string userName = null,
string applicationName = null,
string clientIpAddress = null,
string correlationId = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
@ -37,6 +38,7 @@ namespace Volo.Abp.AuditLogging
Guid? userId = null,
string userName = null,
string applicationName = null,
string clientIpAddress = null,
string correlationId = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,

6
modules/audit-logging/src/Volo.Abp.AuditLogging.EntityFrameworkCore/Volo/Abp/AuditLogging/EntityFrameworkCore/EfCoreAuditLogRepository.cs

@ -32,6 +32,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
Guid? userId = null,
string userName = null,
string applicationName = null,
string clientIpAddress = null,
string correlationId = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
@ -48,6 +49,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
userId,
userName,
applicationName,
clientIpAddress,
correlationId,
maxExecutionDuration,
minExecutionDuration,
@ -72,6 +74,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
Guid? userId = null,
string userName = null,
string applicationName = null,
string clientIpAddress = null,
string correlationId = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
@ -87,6 +90,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
userId,
userName,
applicationName,
clientIpAddress,
correlationId,
maxExecutionDuration,
minExecutionDuration,
@ -107,6 +111,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
Guid? userId = null,
string userName = null,
string applicationName = null,
string clientIpAddress = null,
string correlationId = null,
int? maxExecutionDuration = null,
int? minExecutionDuration = null,
@ -126,6 +131,7 @@ namespace Volo.Abp.AuditLogging.EntityFrameworkCore
.WhereIf(userId != null, auditLog => auditLog.UserId == userId)
.WhereIf(userName != null, auditLog => auditLog.UserName == userName)
.WhereIf(applicationName != null, auditLog => auditLog.ApplicationName == applicationName)
.WhereIf(clientIpAddress != null, auditLog => auditLog.ClientIpAddress != null && auditLog.ClientIpAddress == clientIpAddress)
.WhereIf(correlationId != null, auditLog => auditLog.CorrelationId == correlationId)
.WhereIf(httpStatusCode != null && httpStatusCode > 0, auditLog => auditLog.HttpStatusCode == nHttpStatusCode)
.WhereIf(maxExecutionDuration != null && maxExecutionDuration.Value > 0, auditLog => auditLog.ExecutionDuration <= maxExecutionDuration)

6
modules/audit-logging/src/Volo.Abp.AuditLogging.MongoDB/Volo/Abp/AuditLogging/MongoDB/MongoAuditLogRepository.cs

@ -33,6 +33,7 @@ namespace Volo.Abp.AuditLogging.MongoDB
Guid? userId = null,
string userName = null,
string applicationName = null,
string clientIpAddress = null,
string correlationId = null,
int? maxDuration = null,
int? minDuration = null,
@ -49,6 +50,7 @@ namespace Volo.Abp.AuditLogging.MongoDB
userId,
userName,
applicationName,
clientIpAddress,
correlationId,
maxDuration,
minDuration,
@ -73,6 +75,7 @@ namespace Volo.Abp.AuditLogging.MongoDB
Guid? userId = null,
string userName = null,
string applicationName = null,
string clientIpAddress = null,
string correlationId = null,
int? maxDuration = null,
int? minDuration = null,
@ -88,6 +91,7 @@ namespace Volo.Abp.AuditLogging.MongoDB
userId,
userName,
applicationName,
clientIpAddress,
correlationId,
maxDuration,
minDuration,
@ -110,6 +114,7 @@ namespace Volo.Abp.AuditLogging.MongoDB
Guid? userId = null,
string userName = null,
string applicationName = null,
string clientIpAddress = null,
string correlationId = null,
int? maxDuration = null,
int? minDuration = null,
@ -128,6 +133,7 @@ namespace Volo.Abp.AuditLogging.MongoDB
.WhereIf(userId != null, auditLog => auditLog.UserId == userId)
.WhereIf(userName != null, auditLog => auditLog.UserName == userName)
.WhereIf(applicationName != null, auditLog => auditLog.ApplicationName == applicationName)
.WhereIf(clientIpAddress != null, auditLog => auditLog.ClientIpAddress == clientIpAddress)
.WhereIf(correlationId != null, auditLog => auditLog.CorrelationId == correlationId)
.WhereIf(httpStatusCode != null && httpStatusCode > 0, auditLog => auditLog.HttpStatusCode == (int?)httpStatusCode)
.WhereIf(maxDuration != null && maxDuration > 0, auditLog => auditLog.ExecutionDuration <= maxDuration)

Loading…
Cancel
Save