audit

package
v0.0.0-...-17e6b21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	ID        string `json:"id"`
	Type      string `json:"type"`
	Name      string `json:"name"`
	IPAddress string `json:"ip_address,omitempty"`
}

type AuditEvent

type AuditEvent struct {
	ID         string                 `json:"id"`
	Timestamp  time.Time              `json:"timestamp"`
	Actor      Actor                  `json:"actor"`
	Action     string                 `json:"action"`
	Resource   Resource               `json:"resource"`
	Status     string                 `json:"status"`
	Changes    []Change               `json:"changes,omitempty"`
	Metadata   map[string]interface{} `json:"metadata,omitempty"`
	Signatures []Signature            `json:"signatures,omitempty"`
}

type AuditLogger

type AuditLogger struct {
	// contains filtered or unexported fields
}

func NewAuditLogger

func NewAuditLogger(
	metrics *metrics.QuantumStorageMetrics,
	tracer tracing.Tracer,
	natsConn *nats.Conn,
	streamName string,
	retention time.Duration,
) (*AuditLogger, error)

func (*AuditLogger) LogEvent

func (al *AuditLogger) LogEvent(
	ctx context.Context,
	event *AuditEvent,
) error

type Change

type Change struct {
	Field     string      `json:"field"`
	OldValue  interface{} `json:"old_value,omitempty"`
	NewValue  interface{} `json:"new_value"`
	Timestamp time.Time   `json:"timestamp"`
}

type Resource

type Resource struct {
	ID         string                 `json:"id"`
	Type       string                 `json:"type"`
	Name       string                 `json:"name"`
	Attributes map[string]interface{} `json:"attributes,omitempty"`
}

type Signature

type Signature struct {
	KeyID     string    `json:"key_id"`
	Algorithm string    `json:"algorithm"`
	Value     []byte    `json:"value"`
	Timestamp time.Time `json:"timestamp"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL