audit

package
v0.0.0-...-110fe3a Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditEventList

type AuditEventList struct {
	Nodes    []model.AuditEventNode `json:"nodes"`
	PageInfo model.PageInfo         `json:"pageInfo"`
}

type AuditEventMemberAdded

type AuditEventMemberAdded struct {
	BaseAuditEvent
	Data model.AuditEventMemberAddedData
}

func (AuditEventMemberAdded) GetData

func (a AuditEventMemberAdded) GetData() any

type AuditEventMemberRemoved

type AuditEventMemberRemoved struct {
	BaseAuditEvent
	Data model.AuditEventMemberRemovedData
}

func (AuditEventMemberRemoved) GetData

func (a AuditEventMemberRemoved) GetData() any

type AuditEventMemberSetRole

type AuditEventMemberSetRole struct {
	BaseAuditEvent
	Data model.AuditEventMemberSetRoleData
}

func (AuditEventMemberSetRole) GetData

func (a AuditEventMemberSetRole) GetData() any

type AuditEventTeamAddRepository

type AuditEventTeamAddRepository struct {
	BaseAuditEvent
	Data model.AuditEventTeamAddRepositoryData
}

func (AuditEventTeamAddRepository) GetData

func (a AuditEventTeamAddRepository) GetData() any

type AuditEventTeamRemoveRepository

type AuditEventTeamRemoveRepository struct {
	BaseAuditEvent
	Data model.AuditEventTeamRemoveRepositoryData
}

func (AuditEventTeamRemoveRepository) GetData

func (a AuditEventTeamRemoveRepository) GetData() any

type AuditEventTeamSetAlertsSlackChannel

type AuditEventTeamSetAlertsSlackChannel struct {
	BaseAuditEvent
	Data model.AuditEventTeamSetAlertsSlackChannelData
}

func (AuditEventTeamSetAlertsSlackChannel) GetData

type AuditEventTeamSetDefaultSlackChannel

type AuditEventTeamSetDefaultSlackChannel struct {
	BaseAuditEvent
	Data model.AuditEventTeamSetDefaultSlackChannelData
}

func (AuditEventTeamSetDefaultSlackChannel) GetData

type AuditEventTeamSetPurpose

type AuditEventTeamSetPurpose struct {
	BaseAuditEvent
	Data model.AuditEventTeamSetPurposeData
}

func (AuditEventTeamSetPurpose) GetData

func (a AuditEventTeamSetPurpose) GetData() any

type Auditor

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

Auditor mediates persistence of audit events.

func NewAuditor

func NewAuditor(db database.Database) *Auditor

func (*Auditor) AppDeleted

func (a *Auditor) AppDeleted(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, env, applicationName string) error

func (*Auditor) AppRestarted

func (a *Auditor) AppRestarted(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, env, applicationName string) error

func (*Auditor) GetEventsForTeam

func (a *Auditor) GetEventsForTeam(ctx context.Context, obj *model.Team, offset *int, limit *int, filter *model.AuditEventsFilter) (*AuditEventList, error)

func (*Auditor) NaisjobDeleted

func (a *Auditor) NaisjobDeleted(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, env, jobName string) error

func (*Auditor) SecretCreated

func (a *Auditor) SecretCreated(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, env, secretName string) error

func (*Auditor) SecretDeleted

func (a *Auditor) SecretDeleted(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, env, secretName string) error

func (*Auditor) SecretUpdated

func (a *Auditor) SecretUpdated(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, env, secretName string) error

func (*Auditor) TeamAddRepository

func (a *Auditor) TeamAddRepository(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, repositoryName string) error

func (*Auditor) TeamCreated

func (a *Auditor) TeamCreated(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug) error

func (*Auditor) TeamDeletionConfirmed

func (a *Auditor) TeamDeletionConfirmed(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug) error

func (*Auditor) TeamDeletionRequested

func (a *Auditor) TeamDeletionRequested(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug) error

func (*Auditor) TeamMemberAdded

func (a *Auditor) TeamMemberAdded(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, memberEmail string, role model.TeamRole) error

func (*Auditor) TeamMemberRemoved

func (a *Auditor) TeamMemberRemoved(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, memberEmail string) error

func (*Auditor) TeamMemberSetRole

func (a *Auditor) TeamMemberSetRole(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, memberEmail string, role model.TeamRole) error

func (*Auditor) TeamRemoveRepository

func (a *Auditor) TeamRemoveRepository(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, repositoryName string) error

func (*Auditor) TeamRotatedDeployKey

func (a *Auditor) TeamRotatedDeployKey(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug) error

func (*Auditor) TeamSetAlertsSlackChannel

func (a *Auditor) TeamSetAlertsSlackChannel(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, environment, channelName string) error

func (*Auditor) TeamSetDefaultSlackChannel

func (a *Auditor) TeamSetDefaultSlackChannel(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, defaultSlackChannel string) error

func (*Auditor) TeamSetPurpose

func (a *Auditor) TeamSetPurpose(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, purpose string) error

func (*Auditor) TeamSynchronized

func (a *Auditor) TeamSynchronized(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug) error

func (*Auditor) UnleashCreated

func (a *Auditor) UnleashCreated(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, unleashName string) error

func (*Auditor) UnleashUpdated

func (a *Auditor) UnleashUpdated(ctx context.Context, actor authz.AuthenticatedUser, team slug.Slug, unleashName string) error

type BaseAuditEvent

type BaseAuditEvent struct {
	ID           scalar.Ident                 `json:"id"`
	Action       model.AuditEventAction       `json:"action"`
	Actor        string                       `json:"actor"`
	CreatedAt    time.Time                    `json:"createdAt"`
	Message      string                       `json:"message"`
	ResourceType model.AuditEventResourceType `json:"resourceType"`
	ResourceName string                       `json:"resourceName"`

	GQLVars BaseAuditEventGQLVars `json:"-"`
}

BaseAuditEvent is the base type for audit events.

func (BaseAuditEvent) GetAction

func (e BaseAuditEvent) GetAction() string

func (BaseAuditEvent) GetActor

func (e BaseAuditEvent) GetActor() string

func (BaseAuditEvent) GetCreatedAt

func (e BaseAuditEvent) GetCreatedAt() time.Time

func (BaseAuditEvent) GetData

func (e BaseAuditEvent) GetData() any

func (BaseAuditEvent) GetEnvironment

func (e BaseAuditEvent) GetEnvironment() *string

func (BaseAuditEvent) GetResourceName

func (e BaseAuditEvent) GetResourceName() string

func (BaseAuditEvent) GetResourceType

func (e BaseAuditEvent) GetResourceType() string

func (BaseAuditEvent) GetTeam

func (e BaseAuditEvent) GetTeam() *slug.Slug

func (BaseAuditEvent) IsAuditEvent

func (BaseAuditEvent) IsAuditEvent()

func (BaseAuditEvent) IsAuditEventNode

func (BaseAuditEvent) IsAuditEventNode()

func (BaseAuditEvent) WithMessage

func (e BaseAuditEvent) WithMessage(message string) BaseAuditEvent

type BaseAuditEventGQLVars

type BaseAuditEventGQLVars struct {
	Team        slug.Slug `json:"team"`
	Environment string    `json:"env"`
}

Jump to

Keyboard shortcuts

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