audit

package
v0.0.0-...-cd00529 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Audit

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

Audit is a new auditlogger to be used by service layer to log changes to entities

func New

func New(database *db.Database, logger *zap.Logger) *Audit

New returns a new Auditlog instance which audit events to logfile and/or audit database.

func (*Audit) Create

func (al *Audit) Create(new interface{}, e *Environment, who Requester)

Create logs a created entity to auditlog

func (*Audit) Delete

func (al *Audit) Delete(old interface{}, e *Environment, who Requester)

Delete logs a deleted entity to auditlog

func (*Audit) Update

func (al *Audit) Update(old, new interface{}, e *Environment, who Requester)

Update logs an updated entity to auditlog

type Config

type Config struct {
	// Database configuration
	Database cassandra.DatabaseConfig `yaml:"database"`
	// audit log configuration
	Logger shared.Logger `yaml:"logging"`
}

Config holds configuration of an auditlog

type Environment

type Environment struct {
	Organization string
	Company      string
	DeveloperID  string
	AppID        string
}

Details of organization, developer and app this audit change applies to

type Requester

type Requester struct {
	RemoteAddr string
	Header     http.Header
	User       string
	Role       string
	RequestID  string
}

Requester stores the identity and connection details of an authenticated managementserver API user who is requesting a change.

Jump to

Keyboard shortcuts

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