Audit log claims from token (#6847)

This commit is contained in:
Harshavardhana
2018-11-21 20:03:24 -08:00
committed by Nitish Tiwari
parent d4265f9a13
commit 9e3fce441e
12 changed files with 128 additions and 86 deletions

View File

@@ -55,7 +55,7 @@ func AddAuditTarget(t Target) {
}
// AuditLog - logs audit logs to all audit targets.
func AuditLog(w http.ResponseWriter, r *http.Request, api string) {
func AuditLog(w http.ResponseWriter, r *http.Request, api string, reqClaims map[string]interface{}) {
var statusCode int
lrw, ok := w.(*ResponseWriter)
if ok {
@@ -63,6 +63,6 @@ func AuditLog(w http.ResponseWriter, r *http.Request, api string) {
}
// Send audit logs only to http targets.
for _, t := range AuditTargets {
t.Send(audit.ToEntry(w, r, api, statusCode))
_ = t.Send(audit.ToEntry(w, r, api, statusCode, reqClaims))
}
}