add client IP to audit logs
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -148,9 +148,10 @@ func StoreSecret(c *gin.Context) {
|
||||
a := models.Audit{
|
||||
UserId: UserId,
|
||||
SecretId: s.SecretId,
|
||||
IpAddress: c.ClientIP(),
|
||||
EventText: fmt.Sprintf("Created Secret Id %d", s.SecretId),
|
||||
}
|
||||
a.AutidLogAdd()
|
||||
a.AuditLogAdd()
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"message": "secret stored successfully", "data": models.SecretRestricted(s)})
|
||||
}
|
||||
@@ -360,9 +361,10 @@ func UpdateSecret(c *gin.Context) {
|
||||
a := models.Audit{
|
||||
UserId: UserId,
|
||||
SecretId: s.SecretId,
|
||||
IpAddress: c.ClientIP(),
|
||||
EventText: fmt.Sprintf("Updated Secret Id %d", s.SecretId),
|
||||
}
|
||||
a.AutidLogAdd()
|
||||
a.AuditLogAdd()
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"message": "secret updated successfully", "data": models.SecretRestricted(s)})
|
||||
} else {
|
||||
@@ -451,9 +453,10 @@ func DeleteSecret(c *gin.Context) {
|
||||
a := models.Audit{
|
||||
UserId: UserId,
|
||||
SecretId: s.SecretId,
|
||||
IpAddress: c.ClientIP(),
|
||||
EventText: fmt.Sprintf("Deleted Secret Id %d", s.SecretId),
|
||||
}
|
||||
a.AutidLogAdd()
|
||||
a.AuditLogAdd()
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"message": "secret deleted successfully"})
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user