workflow

package
v2.42.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessRequest

type AccessRequest struct {
	ID                   string        `json:"id"`
	Author               string        `json:"author"`
	Created              string        `json:"created"`
	Updated              string        `json:"updated"`
	UpdatedBy            string        `json:"updated_by"`
	Name                 string        `json:"name"`
	Requester            *WorkflowUser `json:"requester,omitempty"`
	RequestedRole        *WorkflowRole `json:"requested_role,omitempty"`
	RequestJustification string        `json:"request_justification"`
	GrantType            string        `json:"grant_type,omitempty"`
	GrantStart           string        `json:"grant_start,omitempty"`
	GrantEnd             string        `json:"grant_end,omitempty"`
	FloatingLength       int64         `json:"floating_length,omitempty"`
	TargetUser           *WorkflowUser `json:"target_user,omitempty"`
	Action               string        `json:"action,omitempty"`
	Status               string        `json:"status,omitempty"`
	Comment              string        `json:"comment,omitempty"`
	Steps                []RequestStep `json:"steps,omitempty"`
	ApproverCanRevoke    bool          `json:"approver_can_revoke"`
	TargetRoleRevoked    bool          `json:"target_role_revoked"`
	TargetRoleRevokeTime *string       `json:"target_role_revocation_time,omitempty"`
	TargetRoleRevokedBy  *WorkflowUser `json:"target_role_revoked_by,omitempty"`
}

AccessRequest access request definition.

type AccessRequestSearch

type AccessRequestSearch struct {
	Keywords  string `json:"keywords,omitempty"`
	StartTime string `json:"start_time,omitempty"`
	EndTime   string `json:"end_time,omitempty"`
	Filter    string `json:"filter,omitempty"`
}

AccessRequestSearch access request search definition.

type Decision

type Decision struct {
	Step     int    `json:"step"`
	Decision string `json:"decision"`
	Comment  string `json:"comment,omitempty"`
}

Decision request decision definition.

type RequestStep

type RequestStep struct {
	ID        string                `json:"id"`
	Name      string                `json:"name"`
	Match     string                `json:"match"`
	Approvers []RequestStepApprover `json:"approvers"`
}

RequestStep request step definition.

type RequestStepApprover

type RequestStepApprover struct {
	ID           string        `json:"id"`
	Role         WorkflowRole  `json:"role"`
	Decision     string        `json:"decision"`
	User         *WorkflowUser `json:"user,omitempty"`
	DecisionTime *string       `json:"decision_time,omitempty"`
	Comment      string        `json:"comment"`
}

RequestStepApprover request step approver definition.

type SMTPResponse

type SMTPResponse struct {
	Status  string      `json:"status"`
	Details interface{} `json:"details"`
}

SMTPResponse smtp server test response definition.

type Workflow

type Workflow struct {
	ID                        string         `json:"id"`
	Author                    string         `json:"author"`
	Created                   string         `json:"created"`
	Updated                   string         `json:"updated"`
	UpdatedBy                 string         `json:"updated_by"`
	Name                      string         `json:"name"`
	GrantTypes                []string       `json:"grant_types,omitempty"`
	MaxTimeRestrictedDuration int64          `json:"max_time_restricted_duration,omitempty"`
	MaxFloatingDuration       int64          `json:"max_floating_duration,omitempty"`
	MaxActiveRequests         int64          `json:"max_active_requests"`
	TargetRoles               []WorkflowRole `json:"target_roles,omitempty"`
	RequestorRoles            []WorkflowRole `json:"requester_roles,omitempty"`
	Action                    string         `json:"action,omitempty"`
	CanBypassRevokeWF         bool           `json:"can_bypass_revoke_workflow"`
	Comment                   string         `json:"comment,omitempty"`
	Steps                     []WorkflowStep `json:"steps,omitempty"`
	RequiresJustification     bool           `json:"requires_justification"`
}

Workflow workflow definition

type WorkflowEngine

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

WorkflowEngine is a workflow client instance.

func New

New workflow engine client constructor.

func (*WorkflowEngine) CreateRequest

func (c *WorkflowEngine) CreateRequest(request *AccessRequest) (response.Identifier, error)

CreateRequest create request.

func (*WorkflowEngine) CreateWorkflow

func (c *WorkflowEngine) CreateWorkflow(workflow *Workflow) (response.Identifier, error)

CreateWorkflow create workflow.

func (*WorkflowEngine) DeleteRequest

func (c *WorkflowEngine) DeleteRequest(requestID string) error

DeleteRequest delete request.

func (*WorkflowEngine) DeleteWorkflow

func (c *WorkflowEngine) DeleteWorkflow(workflowID string) error

DeleteWorkflow delete a workflow.

func (*WorkflowEngine) GetRequest

func (c *WorkflowEngine) GetRequest(requestID string) (*AccessRequest, error)

GetRequest get request by id.

func (*WorkflowEngine) GetRequests

func (c *WorkflowEngine) GetRequests(opts ...filters.Option) (*response.ResultSet[AccessRequest], error)

MARK: Requests GetRequests get the request queue for the user

func (*WorkflowEngine) GetSettings

func (c *WorkflowEngine) GetSettings() (*WorkflowSettings, error)

MARK: Settings GetSettings get settings for workflow engine.

func (*WorkflowEngine) GetWorkflow

func (c *WorkflowEngine) GetWorkflow(workflowID string) (*Workflow, error)

GetWorkflow get workflow by id.

func (*WorkflowEngine) GetWorkflows

func (c *WorkflowEngine) GetWorkflows(opts ...filters.Option) (*response.ResultSet[Workflow], error)

MARK: Workflows GetWorkflows get workflows.

func (*WorkflowEngine) RevokeTargetRole

func (c *WorkflowEngine) RevokeTargetRole(requestID string) error

RevokeTargetRole revoke target role in request from target user.

func (*WorkflowEngine) SearchRequests

func (c *WorkflowEngine) SearchRequests(search *AccessRequestSearch, opts ...filters.Option) (*response.ResultSet[AccessRequest], error)

SearchRequests search access requests

func (*WorkflowEngine) Status

func (c *WorkflowEngine) Status() (*response.ServiceStatus, error)

MARK: Status Status get workflow engine microservice status.

func (*WorkflowEngine) TestSMTP

func (c *WorkflowEngine) TestSMTP(settings *WorkflowSettings) (SMTPResponse, error)

MARK: Test SMTP TestSMTP test SMTP settings.

func (*WorkflowEngine) UpdateDecisionOnRequest

func (c *WorkflowEngine) UpdateDecisionOnRequest(requestID string, request Decision) error

UpdateDecisionOnRequest update a request decision in queue.

func (*WorkflowEngine) UpdateSettings

func (c *WorkflowEngine) UpdateSettings(settings *WorkflowSettings) error

UpdateSettings update settings for workflow engine.

func (*WorkflowEngine) UpdateWorkflow

func (c *WorkflowEngine) UpdateWorkflow(workflowID string, workflow *Workflow) error

UpdateWorkflow update workflow.

type WorkflowRole

type WorkflowRole struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Deleted bool   `json:"deleted,omitempty"`
}

WorkflowRole workflow role definition.

type WorkflowSettings

type WorkflowSettings struct {
	Host                  string `json:"smtp_server"`
	Port                  int    `json:"smtp_server_port"`
	MaxApprovers          int    `json:"request_role_max_approvers"`
	Enabled               bool   `json:"smtp_server_enabled"`
	BackendAddress        string `json:"privx_backend_address"`
	Username              string `json:"smtp_server_username"`
	Password              string `json:"smtp_server_password"`
	Protocol              string `json:"smtp_server_protocol"`
	SenderAddress         string `json:"smtp_sender_address"`
	EmailRetryAttempts    int    `json:"smtp_retry_attempts"`
	InsecureVerify        bool   `json:"smtp_server_insecure_verify"`
	Provider              string `json:"smtp_provider"`
	AuthenticationMode    string `json:"smtp_authentication_mode"`
	ProviderTokenEndpoint string `json:"smtp_provider_token_endpoint"`
	ProviderTokenScope    string `json:"smtp_provider_token_scope"`
}

WorkflowSettings workflow settings definition.

type WorkflowStep

type WorkflowStep struct {
	ID        string                 `json:"id,omitempty"`
	Name      string                 `json:"name,omitempty"`
	Match     string                 `json:"match,omitempty"`
	Approvers []WorkflowStepApprover `json:"approvers,omitempty"`
}

WorkflowStep workflow step definition.

type WorkflowStepApprover

type WorkflowStepApprover struct {
	ID   string       `json:"id,omitempty"`
	Role WorkflowRole `json:"role,omitempty"`
}

WorkflowStepApprover workflow step approver definition.

type WorkflowUser

type WorkflowUser struct {
	ID          string `json:"id,omitempty"`
	DisplayName string `json:"display_name,omitempty"`
	Deleted     bool   `json:"deleted"`
}

WorkflowUser workflow user definition.

Jump to

Keyboard shortcuts

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