auditor

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditNotificationConfig added in v0.8.1

type AuditNotificationConfig struct {
	URL            string
	Username       string
	Password       string
	RequestTimeout time.Duration
	// contains filtered or unexported fields
}

AuditNotificationConfig holds the URL and credentials used to publish audit result to ledger compliance.

type AuditNotificationRequest added in v0.8.1

type AuditNotificationRequest struct {
	Username      string    `json:"username" validate:"required"`
	Password      string    `json:"password" validate:"required"`
	DB            string    `json:"db" validate:"required"`
	RunAt         time.Time `json:"run_at" validate:"required" example:"2020-11-13T00:53:42+01:00"`
	Tampered      bool      `json:"tampered"`
	PreviousState *State    `json:"previous_state"`
	CurrentState  *State    `json:"current_state"`
}

AuditNotificationRequest ...

type Auditor

type Auditor interface {
	Run(interval time.Duration, singleRun bool, stopc <-chan struct{}, donec chan<- struct{}) error
}

Auditor the auditor interface

func DefaultAuditor

func DefaultAuditor(
	interval time.Duration,
	serverAddress string,
	dialOptions *[]grpc.DialOption,
	username string,
	passwordBase64 string,
	auditDatabases []string,
	serverSigningPubKey *ecdsa.PublicKey,
	notificationConfig AuditNotificationConfig,
	serviceClient schema.ImmuServiceClient,
	uuidProvider state.UUIDProvider,
	history cache.HistoryCache,
	updateMetrics func(string, string, bool, bool, bool, *schema.ImmutableState, *schema.ImmutableState),
	log logger.Logger) (Auditor, error)

DefaultAuditor creates initializes a default auditor implementation

type Signature added in v0.8.1

type Signature struct {
	Signature string `json:"signature"`
	PublicKey string `json:"public_key"`
}

Signature ...

type State added in v0.9.0

type State struct {
	Tx        uint64    `json:"tx" validate:"required"`
	Hash      string    `json:"hash" validate:"required"`
	Signature Signature `json:"signature" validate:"required"`
}

State ...

Jump to

Keyboard shortcuts

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