MCPcopy Create free account
hub / github.com/couchbase/cbft / GetAuditEventData

Function GetAuditEventData

audit.go:40–67  ·  view source on GitHub ↗
(eventId uint32, req *http.Request)

Source from the content-addressed store, hash-verified

38}
39
40func GetAuditEventData(eventId uint32, req *http.Request) interface{} {
41 switch eventId {
42 case AuditDeleteIndexEvent, AuditCreateUpdateIndexEvent:
43 indexName := rest.IndexNameLookup(req)
44 d := IndexAuditLog{
45 CommonAuditFields: audit.GetCommonAuditFields(req),
46 IndexName: indexName,
47 }
48 return d
49 case AuditConfigReplanEvent, AuditRunGCEvent,
50 AuditProfileCPUEvent, AuditProfileMemoryEvent:
51 return audit.GetCommonAuditFields(req)
52 case AuditControlEvent:
53 indexName := rest.IndexNameLookup(req)
54 d := IndexControlAuditLog{
55 CommonAuditFields: audit.GetCommonAuditFields(req),
56 IndexName: indexName,
57 Control: rest.RequestVariableLookup(req, "op"),
58 }
59 return d
60 case AuditAccessDeniedEvent:
61 return IndexAuditLog{
62 CommonAuditFields: audit.GetCommonAuditFields(req),
63 IndexName: rest.IndexNameLookup(req),
64 }
65 }
66 return nil
67}

Callers 2

doAuditMethod · 0.85
checkAPIAuthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected