audit

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyUnknown contextKey = iota
	KeyActorID
	KeyActorType
)

Variables

View Source
var (
	ErrSigningKeyMissing      = errors.New("could not get a signing key")
	ErrVerificationKeyMissing = errors.New("could not get a verification key")
)

Functions

func ActorID

func ActorID(ctx context.Context) (actorID []byte, ok bool)

Returns the context's actor ID and true, if present, otherwise returns false for the second value (first value not useful).

func ActorType

func ActorType(ctx context.Context) (actorType enum.Actor, ok bool)

Returns the context's actor type and true, if present, otherwise returns false for the second value (first value not useful).

func Sign

func Sign(log *models.ComplianceAuditLog) (err error)

Signs the given ComplianceAuditLog, replacing any signature and metadata currently present.

func UseKeyChain

func UseKeyChain(keychain keychain.KeyChain)

The package will use the given keychain.KeyChain for signing and verification of ComplianceAuditLog entries.

func Verify

func Verify(log *models.ComplianceAuditLog) (err error)

Verifies the given ComplianceAuditLog's signature versus the data. If no error is returned, then the log is valid.

func WithActor

func WithActor(parent context.Context, actorID []byte, actorType enum.Actor) (ctx context.Context)

Adds the actor id and type to the given context that can be retrieved later with ActorID() and ActorType().

Types

This section is empty.

Jump to

Keyboard shortcuts

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