Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Currently setting AUDIT level to 10, a level above ERROR so it is always logged LevelAudit = slog.Level(10) )
From the Slog docs (https://betterstack.com/community/guides/logging/logging-in-go/#customizing-slog-levels): The log/slog package provides four log levels by default, with each one associated with an integer value: DEBUG (-4), INFO (0), WARN (4), and ERROR (8).
Variables ¶
View Source
var CustomLevelNames = map[slog.Leveler]string{ LevelAudit: "AUDIT", }
Functions ¶
This section is empty.
Types ¶
type AuditLog ¶ added in v0.4.3
type AuditLog struct { ID string `json:"id"` Object auditPolicyObject `json:"object"` Action auditPolicyAction `json:"action"` Actor AuditLogActor `json:"actor"` EventMetaData map[string]interface{} `json:"eventMetaData"` ClientInfo auditLogClientInfo `json:"clientInfo"` Diff map[string]interface{} `json:"diff"` Timestamp string `json:"timestamp"` }
type AuditLogActor ¶ added in v0.4.3
type AuditLogActor struct { ID string `json:"id"` Attributes auditPolicyAttributes `json:"attributes"` }
type AuditLogger ¶ added in v0.4.3
type AuditLogger struct {
// contains filtered or unexported fields
}
func CreateAuditLogger ¶ added in v0.4.3
func CreateAuditLogger(logger slog.Logger) *AuditLogger
func (*AuditLogger) RewrapFailure ¶ added in v0.4.3
func (a *AuditLogger) RewrapFailure(ctx context.Context, policy AuditPolicy) error
KAS Rewrap Failure Event Log
func (*AuditLogger) RewrapSuccess ¶ added in v0.4.3
func (a *AuditLogger) RewrapSuccess(ctx context.Context, policy AuditPolicy) error
KAS Rewrap Success Event Log
func (*AuditLogger) With ¶ added in v0.4.3
func (a *AuditLogger) With(key string, value string) *AuditLogger
type AuditPolicy ¶ added in v0.4.3
type AuditPolicy struct { UUID uuid.UUID `json:"uuid"` Body AuditPolicyBody `json:"body"` Actor AuditLogActor `json:"actor"` }
func CreateAuditPolicy ¶ added in v0.4.3
func CreateAuditPolicy( uuid uuid.UUID, dataAttributes []AuditPolicySimpleAttribute, policyDissem []string, entityToken jwt.Token, ) *AuditPolicy
Creates a simple Audit Policy to be passed into the audit rewrap logs
type AuditPolicyBody ¶ added in v0.4.3
type AuditPolicyBody struct { DataAttributes []AuditPolicySimpleAttribute `json:"dataAttributes"` Dissem []string `json:"dissem"` }
type AuditPolicySimpleAttribute ¶ added in v0.4.3
type AuditPolicySimpleAttribute struct {
URI string `json:"attribute"`
}
Click to show internal directories.
Click to hide internal directories.