auditor

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuditorHealthHandlerFunc added in v1.0.5

func AuditorHealthHandlerFunc(immuServiceClient schema.ImmuServiceClient) http.HandlerFunc

func AuditorVersionHandlerFunc added in v1.0.5

func AuditorVersionHandlerFunc(w http.ResponseWriter, r *http.Request)

func StartHTTPServerForMonitoring added in v1.0.5

func StartHTTPServerForMonitoring(
	addr string,
	listenAndServe func(server *http.Server) error,
	l logger.Logger,
	immuServiceClient schema.ImmuServiceClient,
) *http.Server

Types

type AuditNotificationConfig added in v0.8.1

type AuditNotificationConfig struct {
	URL            string
	Username       string
	Password       string
	RequestTimeout time.Duration

	PublishFunc func(*http.Request) (*http.Response, error)
}

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,
	monitoringHTTPAddr *string) (Auditor, error)

DefaultAuditor creates initializes a default auditor implementation

type HealthResponse added in v1.0.5

type HealthResponse struct {
	Immudb string `json:"immudb"`
}

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 ...

type VersionResponse added in v1.0.5

type VersionResponse struct {
	Component string `json:"component" example:"immudb"`
	Version   string `json:"version" example:"1.0.1-c9c6495"`
	BuildTime string `json:"buildtime" example:"1604692129"`
	BuiltBy   string `json:"builtby,omitempty"`
	Static    bool   `json:"static"`
}

VersionResponse ...

var Version VersionResponse

Jump to

Keyboard shortcuts

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