Audit logging - new schema (#20447)
* Audit logging - new schema added, old schema removed. * fix linter error by running goimports * Address review comments * Address review comments * Example usage of new audit logging API for the updateUserAuth call * fixed unit test on auditing updating user record * Changed the `TestUpdateConfigDiffInAuditRecord` testcase---it failed, because this PR changes how the `meta` field is serialized into the audit log records. * fix linter error
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6dc897b04f
Коммит
0c5c74904b
@@ -140,6 +140,12 @@ type UserAuth struct {
|
||||
AuthService string `json:"auth_service,omitempty"`
|
||||
}
|
||||
|
||||
func (u *UserAuth) Auditable() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"auth_service": u.AuthService,
|
||||
}
|
||||
}
|
||||
|
||||
//msgp:ignore UserForIndexing
|
||||
type UserForIndexing struct {
|
||||
Id string `json:"id"`
|
||||
@@ -829,6 +835,13 @@ func (u *User) ToPatch() *UserPatch {
|
||||
}
|
||||
}
|
||||
|
||||
func (u *User) Auditable() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"id": u.Id,
|
||||
"username": u.Username,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *UserPatch) SetField(fieldName string, fieldValue string) {
|
||||
switch fieldName {
|
||||
case "FirstName":
|
||||
|
||||
Ссылка в новой задаче
Block a user