MCPcopy Create free account
hub / github.com/PostHog/duckgres / registerAuditAPI

Function registerAuditAPI

controlplane/admin/audit.go:237–247  ·  view source on GitHub ↗

registerAuditAPI wires GET /audit, admin-only via a per-route RequireAdmin gate that travels with the route (a rename cannot silently expose it).

(r *gin.RouterGroup, store *AuditStore)

Source from the content-addressed store, hash-verified

235 return "org." + verb
236 case "reshards":
237 // POST /reshards/:opid/cancel (reads aren't audited).
238 if last == "cancel" {
239 return "reshard.cancel"
240 }
241 return "reshard." + verb
242 }
243 return "config." + verb
244}
245
246// hasSeg reports whether segs contains s.
247func hasSeg(segs []string, s string) bool {
248 for _, seg := range segs {
249 if seg == s {
250 return true

Callers 1

RegisterExtrasFunction · 0.85

Calls 4

RequireAdminFunction · 0.85
ListMethod · 0.80
QueryMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected