workflows

package
v0.0.0-...-1a0b003 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HealthCheckURI = "/api/v1/health"
	ResetEmailURI  = "/api/v1/workflow/send_password_reset_email"
	AuditlogsURI   = "/api/v1/workflow/emit_auditlog"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string
const (
	ActionTerminalOpen     Action = "open_terminal"
	ActionTerminalClose    Action = "close_terminal"
	ActionPortForwardOpen  Action = "open_portforward"
	ActionPortForwardClose Action = "close_portforward"
	ActionDownloadFile     Action = "download_file"
	ActionUploadFile       Action = "upload_file"
)

type Actor

type Actor struct {
	ID             string    `json:"id"`
	Type           ActorType `json:"type"`
	Email          string    `json:"email,omitempty"`
	DeviceIdentity string    `json:"identity_data,omitempty"`
}

func (Actor) Validate

func (a Actor) Validate() error

type ActorType

type ActorType string
const (
	ActorUser ActorType = "user"
)

type AuditLog

type AuditLog struct {
	Action   Action              `json:"action"`
	Actor    Actor               `json:"actor"`
	Object   Object              `json:"object"`
	Change   string              `json:"change,omitempty"`
	MetaData map[string][]string `json:"meta,omitempty"`
	EventTS  time.Time           `json:"time,omitempty"`
}

func (AuditLog) Validate

func (l AuditLog) Validate() error

type AuditWorkflow

type AuditWorkflow struct {
	RequestID string   `json:"request_id"`
	TenantID  string   `json:"tenant_id"`
	AuditLog  AuditLog `json:"auditlog"`
}

type Client

type Client interface {
	CheckHealth(ctx context.Context) error
	SubmitAuditLog(ctx context.Context, log AuditLog) error
}

Client is the workflows client

func NewClient

func NewClient(url string, opts ...ClientOptions) Client

NewClient returns a new workflows client

type ClientOptions

type ClientOptions struct {
	Client *http.Client
}

type Object

type Object struct {
	ID   string     `json:"id"`
	Type ObjectType `json:"type"`
}

func (Object) Validate

func (o Object) Validate() error

type ObjectType

type ObjectType string
const ObjectDevice ObjectType = "device"

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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