MM-53165 Add X-Forwarded-For header to audit for rest api calls (#24390)

* Add X-Forwarded-For header to audit for rest api calls

* fix unit test
Этот коммит содержится в:
Doug Lauder
2023-08-28 07:24:55 -04:00
коммит произвёл GitHub
родитель 0a499770e6
Коммит 84b52333c1
6 изменённых файлов: 28 добавлений и 15 удалений

Просмотреть файл

@@ -59,10 +59,11 @@ func (c *Context) MakeAuditRecord(event string, initialStatus string) *audit.Rec
EventName: event,
Status: initialStatus,
Actor: audit.EventActor{
UserId: c.AppContext.Session().UserId,
SessionId: c.AppContext.Session().Id,
Client: c.AppContext.UserAgent(),
IpAddress: c.AppContext.IPAddress(),
UserId: c.AppContext.Session().UserId,
SessionId: c.AppContext.Session().Id,
Client: c.AppContext.UserAgent(),
IpAddress: c.AppContext.IPAddress(),
XForwardedFor: c.AppContext.XForwardedFor(),
},
Meta: map[string]interface{}{
audit.KeyAPIPath: c.AppContext.Path(),