Documentation
¶
Overview ¶
Command protoc-gen-servora-audit translates servora audit proto annotations into a Go file (`audit_rules.gen.go`) that exports a map of audit.CompiledRule entries consumed by the audit middleware at runtime.
Merge semantics (matches authn / authz):
- method-level rule with mode != AUDIT_MODE_UNSPECIFIED replaces the service-level default in its entirety,
- method-level rule absent (or mode == AUDIT_MODE_UNSPECIFIED) inherits the service-level default,
- only methods whose merged mode is AUDIT_MODE_ENABLED reach the generated output; AUDIT_MODE_DISABLED and methods with no resolved rule are skipped.
Generated output per proto package:
func AuditRules() map[string]*audit.CompiledRule { ... }
Each CompiledRule includes Mode, EventType, Severity and a BuildEvent func that constructs a CloudEvents event from request/response payloads.
Click to show internal directories.
Click to hide internal directories.