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)
| 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. |
| 247 | func hasSeg(segs []string, s string) bool { |
| 248 | for _, seg := range segs { |
| 249 | if seg == s { |
| 250 | return true |
no test coverage detected