workflow

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decision

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

Decision request decision definition

type Engine

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

Engine is a workflow client instance.

func New

func New(api restapi.Connector) *Engine

New creates a new workflow client instance, using the argument SDK API client.

func (*Engine) CreateRequest

func (store *Engine) CreateRequest(request *Request) (string, error)

CreateRequest add a workflow to the request queue.

func (*Engine) CreateWorkflow

func (store *Engine) CreateWorkflow(workflow *Workflow) (string, error)

CreateWorkflow create a new workflow

func (*Engine) DeleteRequest

func (store *Engine) DeleteRequest(requestID string) error

DeleteRequest delete request item by ID.

func (*Engine) DeleteWorkflow

func (store *Engine) DeleteWorkflow(workflowID string) error

DeleteWorkflow delete a workflow by ID

func (*Engine) MakeDecisionOnRequest

func (store *Engine) MakeDecisionOnRequest(requestID string, request Decision) error

MakeDecisionOnRequest update a request in queue

func (*Engine) Request

func (store *Engine) Request(requestID string) (*Request, error)

Request return a request object by ID.

func (*Engine) Requests

func (store *Engine) Requests(offset, limit int, filter string) ([]Request, error)

Requests get the request queue for the user

func (*Engine) RevokeTargetRole added in v0.21.0

func (store *Engine) RevokeTargetRole(requestID string) error

RevokeTargetRole Revokes the target role in a request from target user

func (*Engine) SearchRequests

func (store *Engine) SearchRequests(
	offset, limit int, sortdir, sortkey, filter string, searchObject *Search) ([]Request, error)

SearchRequests search access requests

func (*Engine) Settings

func (store *Engine) Settings() (*Settings, error)

Settings get settings for the microservice

func (*Engine) TestEmailNotification

func (store *Engine) TestEmailNotification(settings *Settings) (SMTPResponse, error)

TestEmailNotification test the email settings

func (*Engine) UpdateSettings

func (store *Engine) UpdateSettings(settings *Settings) error

UpdateSettings store microservice settings

func (*Engine) UpdateWorkflow

func (store *Engine) UpdateWorkflow(workflowID string, workflow *Workflow) error

UpdateWorkflow update a workflow

func (*Engine) Workflow

func (store *Engine) Workflow(workflowID string) (*Workflow, error)

Workflow return workflow object by ID

func (*Engine) Workflows

func (store *Engine) Workflows(offset, limit int) ([]Workflow, error)

Workflows get all workflows

type Params

type Params struct {
	Offset  int    `json:"offset,omitempty"`
	Limit   int    `json:"limit,omitempty"`
	Sortkey string `json:"sortkey,omitempty"`
	Sortdir string `json:"sortdir,omitempty"`
	Filter  string `json:"filter,omitempty"`
}

Params struct for pagination queries

type Request

type Request struct {
	ID                        string        `json:"id,omitempty"`
	Author                    string        `json:"author,omitempty"`
	Created                   string        `json:"created,omitempty"`
	Updated                   string        `json:"updated,omitempty"`
	UpdatedBy                 string        `json:"updated_by,omitempty"`
	Name                      string        `json:"name,omitempty"`
	Requester                 User          `json:"requester,omitempty"`
	RequestedRole             Role          `json:"requested_role,omitempty"`
	RequestJustification      string        `json:"request_justification,omitempty"`
	GrantType                 string        `json:"grant_type,omitempty"`
	GrantStart                string        `json:"grant_start,omitempty"`
	GrantEnd                  string        `json:"grant_end,omitempty"`
	FloatingLength            int64         `json:"floating_length,omitempty"`
	MaxTimeRestrictedDuration int64         `json:"max_time_restricted_duration,omitempty"`
	MaxFloatingDuration       int64         `json:"max_floating_duration,omitempty"`
	TargetUser                User          `json:"target_user,omitempty"`
	TargetRoles               []Role        `json:"target_roles,omitempty"`
	RequestorRoles            []Role        `json:"requester_roles,omitempty"`
	Action                    string        `json:"action,omitempty"`
	CanBypassRevokeWF         bool          `json:"can_bypass_revoke_workflow"`
	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       User          `json:"target_role_revoked_by,omitempty"`
}

Request access request definition

type RequestStep

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

RequestStep request step definition

type RequestStepApprover

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

RequestStepApprover request step approver definition

type Role

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

Role workflow frole definition

type SMTPResponse

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

SMTPResponse smtp server test response definition

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

Search request search definition

type Settings

type Settings struct {
	BackendAddress string `json:"privx_backend_address,omitempty"`
	Address        string `json:"smtp_sender_address,omitempty"`
	Server         string `json:"smtp_server,omitempty"`
	Password       string `json:"smtp_server_password,omitempty"`
	Protocol       string `json:"smtp_server_protocol,omitempty"`
	Username       string `json:"smtp_server_username,omitempty"`
	Approvers      int    `json:"request_role_max_approvers,omitempty"`
	Attempts       int    `json:"smtp_retry_attempts,omitempty"`
	Port           int    `json:"smtp_server_port,omitempty"`
	Enabled        bool   `json:"smtp_server_enabled,omitempty"`
	InsecureVerify bool   `json:"smtp_server_insecure_verify,omitempty"`
}

Settings workflow settings definition

type Step

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

Step workflow step definition

type StepApprover

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

StepApprover workflow step approver defintion

type User

type User struct {
	ID          string `json:"id,omitempty"`
	DisplayName string `json:"display_name,omitempty"`
}

User workflow user definition

type Workflow

type Workflow struct {
	ID                        string   `json:"id,omitempty"`
	Author                    string   `json:"author,omitempty"`
	Created                   string   `json:"created,omitempty"`
	Updated                   string   `json:"updated,omitempty"`
	UpdatedBy                 string   `json:"updated_by,omitempty"`
	Name                      string   `json:"name,omitempty"`
	Requester                 User     `json:"requester"`
	RequestedRole             Role     `json:"requested_role"`
	RequestJustification      string   `json:"request_justification,omitempty"`
	GrantTypes                []string `json:"grant_types,omitempty"`
	GrantStart                string   `json:"grant_start,omitempty"`
	GrantEnd                  string   `json:"grant_end,omitempty"`
	FloatingLength            int64    `json:"floating_length,omitempty"`
	MaxTimeRestrictedDuration int64    `json:"max_time_restricted_duration,omitempty"`
	MaxFloatingDuration       int64    `json:"max_floating_duration,omitempty"`
	MaxActiveRequests         *int64   `json:"max_active_requests,omitempty"`
	TargetUser                User     `json:"target_user,omitempty"`
	TargetRoles               []Role   `json:"target_roles,omitempty"`
	RequestorRoles            []Role   `json:"requester_roles,omitempty"`
	Action                    string   `json:"action,omitempty"`
	CanBypassRevokeWF         bool     `json:"can_bypass_revoke_workflow"`
	Status                    string   `json:"status,omitempty"`
	Comment                   string   `json:"comment,omitempty"`
	Steps                     []Step   `json:"steps,omitempty"`
}

Workflow workflow definition

Jump to

Keyboard shortcuts

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