Documentation
¶
Overview ¶
Package bridge defines local interfaces for optional forgery extension integration. Herald defines its own slim interfaces (following the authsome bridge pattern) to avoid hard coupling to external packages. Bridge adapters in separate packages translate between these local types and the actual extension APIs.
Index ¶
Constants ¶
const ( SeverityInfo = "info" SeverityWarning = "warning" SeverityCritical = "critical" )
Severity constants.
const ( OutcomeSuccess = "success" OutcomeFailure = "failure" )
Outcome constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditEvent ¶
type AuditEvent struct {
Action string `json:"action"`
Resource string `json:"resource"`
ResourceID string `json:"resource_id,omitempty"`
ActorID string `json:"actor_id,omitempty"`
Tenant string `json:"tenant,omitempty"`
Outcome string `json:"outcome"`
Severity string `json:"severity"`
Category string `json:"category"`
Metadata map[string]string `json:"metadata,omitempty"`
Reason string `json:"reason,omitempty"`
}
AuditEvent is a local representation of an audit event.
type Chronicle ¶
type Chronicle interface {
Record(ctx context.Context, event *AuditEvent) error
}
Chronicle is a local audit interface. Implementations record notification events to an audit trail backend (e.g., chronicle).
type ChronicleFunc ¶
type ChronicleFunc func(ctx context.Context, event *AuditEvent) error
ChronicleFunc is an adapter to use a plain function as a Chronicle.
func (ChronicleFunc) Record ¶
func (f ChronicleFunc) Record(ctx context.Context, event *AuditEvent) error
Record implements Chronicle.
type SlogChronicle ¶
SlogChronicle is a standalone Chronicle stub that logs audit events to slog.
func NewSlogChronicle ¶
func NewSlogChronicle(logger *slog.Logger) *SlogChronicle
NewSlogChronicle creates a Chronicle that logs to the given logger.
func (*SlogChronicle) Record ¶
func (c *SlogChronicle) Record(_ context.Context, event *AuditEvent) error
Record implements Chronicle by logging the event.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package chronicleadapter bridges Herald audit events to the Chronicle extension.
|
Package chronicleadapter bridges Herald audit events to the Chronicle extension. |