auditrecord

package
v0.83.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIdempotencyKeyConflict = errors.New("audit record already exists for the given idempotency key")
	ErrInvalidUUID            = errors.New("invalid syntax of uuid")
	ErrNotFound               = errors.New("audit record not found")
	ErrRepositoryBadInput     = errors.New("invalid repository input")
	ErrActorNotFound          = errors.New("actor not found")
)

Functions

func SetAuditRecordActorContext added in v0.76.0

func SetAuditRecordActorContext(ctx context.Context, actor Actor) context.Context

SetAuditRecordActorContext sets the audit record actor in context It accepts an Actor struct but stores it as a map to avoid layer violations in repositories

Types

type Actor

type Actor = models.Actor

type AuditRecord

type AuditRecord = models.AuditRecord

Models moved to a new package to avoid circular dependency with other packages. Re-assigned for backward compatibility

type AuditRecordRQLSchema added in v0.75.0

type AuditRecordRQLSchema = models.AuditRecordRQLSchema

type AuditRecordsList added in v0.75.0

type AuditRecordsList = models.AuditRecordsList

type Repository

type Repository interface {
	Create(ctx context.Context, auditRecord AuditRecord) (AuditRecord, error)
	GetByIdempotencyKey(ctx context.Context, idempotencyKey string) (AuditRecord, error)
	List(ctx context.Context, query *rql.Query) (AuditRecordsList, error)
	Export(ctx context.Context, query *rql.Query) (io.Reader, string, error)
}

type Resource

type Resource = models.Resource

type Service

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

func NewService

func NewService(repository Repository, userService UserService, serviceUserService ServiceUserService, sessionService SessionService) *Service

func (*Service) Create

func (s *Service) Create(ctx context.Context, auditRecord AuditRecord) (AuditRecord, bool, error)

func (*Service) Export added in v0.75.0

func (s *Service) Export(ctx context.Context, query *rql.Query) (io.Reader, string, error)

func (*Service) List added in v0.75.0

func (s *Service) List(ctx context.Context, query *rql.Query) (AuditRecordsList, error)

type ServiceUserService

type ServiceUserService interface {
	Get(ctx context.Context, id string) (serviceuser.ServiceUser, error)
}

type SessionService added in v0.75.0

type SessionService interface {
	Get(ctx context.Context, id uuid.UUID) (*frontiersession.Session, error)
}

type Target

type Target = models.Target

type UserService

type UserService interface {
	GetByID(ctx context.Context, id string) (userpkg.User, error)
	IsSudo(ctx context.Context, id string, permissionName string) (bool, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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