Documentation
¶
Index ¶
- Variables
- func HandleError(err error) error
- type BaseHandler
- func (b *BaseHandler) Bind(ctx echo.Context, req interface{}) error
- func (b *BaseHandler) BindAndValidate(ctx echo.Context, req interface{}) error
- func (b *BaseHandler) GetActorFromClaims(ctx echo.Context, db *gorm.DB) (*uuid.UUID, string, error)
- func (b *BaseHandler) HandleServiceError(ctx echo.Context, err error, operation, entityName string) error
- func (b *BaseHandler) ParseUUID(ctx echo.Context, paramName, entityName string) (*uuid.UUID, error)
- func (b *BaseHandler) RespondCreated(ctx echo.Context, data interface{}) error
- func (b *BaseHandler) RespondNoContent(ctx echo.Context) error
- func (b *BaseHandler) RespondOK(ctx echo.Context, data interface{}) error
- type BulkReassignRoleResponse
- type BulkReassignRoleResponseData
- type CancelWorkflowExecutionRequest
- type ControlRelationshipHandler
- func (h *ControlRelationshipHandler) Activate(ctx echo.Context) error
- func (h *ControlRelationshipHandler) Create(ctx echo.Context) error
- func (h *ControlRelationshipHandler) Deactivate(ctx echo.Context) error
- func (h *ControlRelationshipHandler) Delete(ctx echo.Context) error
- func (h *ControlRelationshipHandler) Get(ctx echo.Context) error
- func (h *ControlRelationshipHandler) List(ctx echo.Context) error
- func (h *ControlRelationshipHandler) Register(api *echo.Group)
- func (h *ControlRelationshipHandler) Update(ctx echo.Context) error
- type ControlRelationshipListResponse
- type ControlRelationshipResponse
- type CreateControlRelationshipRequest
- type CreateRoleAssignmentRequest
- type CreateWorkflowDefinitionRequest
- type CreateWorkflowInstanceRequest
- type CreateWorkflowStepDefinitionRequest
- type FailStepRequest
- type MyAssignmentsResponse
- type ReassignRoleRequest
- type ReassignStepRequest
- type RoleAssignmentHandler
- func (h *RoleAssignmentHandler) Activate(ctx echo.Context) error
- func (h *RoleAssignmentHandler) Create(ctx echo.Context) error
- func (h *RoleAssignmentHandler) Deactivate(ctx echo.Context) error
- func (h *RoleAssignmentHandler) Delete(ctx echo.Context) error
- func (h *RoleAssignmentHandler) Get(ctx echo.Context) error
- func (h *RoleAssignmentHandler) List(ctx echo.Context) error
- func (h *RoleAssignmentHandler) Register(api *echo.Group)
- func (h *RoleAssignmentHandler) Update(ctx echo.Context) error
- type RoleAssignmentListResponse
- type RoleAssignmentResponse
- type StartWorkflowExecutionRequest
- type StepExecutionHandler
- func (h *StepExecutionHandler) CanTransition(ctx echo.Context) error
- func (h *StepExecutionHandler) Fail(ctx echo.Context) error
- func (h *StepExecutionHandler) Get(ctx echo.Context) error
- func (h *StepExecutionHandler) GetEvidenceRequirements(ctx echo.Context) error
- func (h *StepExecutionHandler) List(ctx echo.Context) error
- func (h *StepExecutionHandler) ListMy(ctx echo.Context) error
- func (h *StepExecutionHandler) Reassign(ctx echo.Context) error
- func (h *StepExecutionHandler) Register(api *echo.Group)
- func (h *StepExecutionHandler) TransitionStep(ctx echo.Context) error
- type StepExecutionListResponse
- type StepExecutionResponse
- type TransitionStepRequest
- type UpdateControlRelationshipRequest
- type UpdateRoleAssignmentRequest
- type UpdateWorkflowDefinitionRequest
- type UpdateWorkflowInstanceRequest
- type UpdateWorkflowStepDefinitionRequest
- type WorkflowDefinitionHandler
- func (h *WorkflowDefinitionHandler) Create(ctx echo.Context) error
- func (h *WorkflowDefinitionHandler) Delete(ctx echo.Context) error
- func (h *WorkflowDefinitionHandler) Get(ctx echo.Context) error
- func (h *WorkflowDefinitionHandler) List(ctx echo.Context) error
- func (h *WorkflowDefinitionHandler) Register(api *echo.Group)
- func (h *WorkflowDefinitionHandler) Update(ctx echo.Context) error
- type WorkflowDefinitionListResponse
- type WorkflowDefinitionResponse
- type WorkflowExecutionHandler
- func (h *WorkflowExecutionHandler) Cancel(ctx echo.Context) error
- func (h *WorkflowExecutionHandler) Get(ctx echo.Context) error
- func (h *WorkflowExecutionHandler) GetMetrics(ctx echo.Context) error
- func (h *WorkflowExecutionHandler) GetStatus(ctx echo.Context) error
- func (h *WorkflowExecutionHandler) List(ctx echo.Context) error
- func (h *WorkflowExecutionHandler) ReassignRole(ctx echo.Context) error
- func (h *WorkflowExecutionHandler) Register(api *echo.Group)
- func (h *WorkflowExecutionHandler) Retry(ctx echo.Context) error
- func (h *WorkflowExecutionHandler) Start(ctx echo.Context) error
- type WorkflowExecutionListResponse
- type WorkflowExecutionMetricsResponse
- type WorkflowExecutionResponse
- type WorkflowExecutionStatusResponse
- type WorkflowInstanceHandler
- func (h *WorkflowInstanceHandler) Activate(ctx echo.Context) error
- func (h *WorkflowInstanceHandler) Create(ctx echo.Context) error
- func (h *WorkflowInstanceHandler) Deactivate(ctx echo.Context) error
- func (h *WorkflowInstanceHandler) Delete(ctx echo.Context) error
- func (h *WorkflowInstanceHandler) Get(ctx echo.Context) error
- func (h *WorkflowInstanceHandler) List(ctx echo.Context) error
- func (h *WorkflowInstanceHandler) Register(api *echo.Group)
- func (h *WorkflowInstanceHandler) Update(ctx echo.Context) error
- type WorkflowInstanceListResponse
- type WorkflowInstanceResponse
- type WorkflowStepDefinitionHandler
- func (h *WorkflowStepDefinitionHandler) Create(ctx echo.Context) error
- func (h *WorkflowStepDefinitionHandler) Delete(ctx echo.Context) error
- func (h *WorkflowStepDefinitionHandler) Get(ctx echo.Context) error
- func (h *WorkflowStepDefinitionHandler) GetDependencies(ctx echo.Context) error
- func (h *WorkflowStepDefinitionHandler) ListByWorkflowDefinition(ctx echo.Context) error
- func (h *WorkflowStepDefinitionHandler) Register(api *echo.Group)
- func (h *WorkflowStepDefinitionHandler) Update(ctx echo.Context) error
- type WorkflowStepDefinitionListResponse
- type WorkflowStepDefinitionResponse
Constants ¶
This section is empty.
Variables ¶
var ( // ErrResponseSent is a sentinel error indicating the response was already sent ErrResponseSent = errors.New("response already sent") )
Functions ¶
func HandleError ¶
HandleError checks if the error is ErrResponseSent and returns nil to Echo Otherwise returns the error as-is for Echo to handle
Types ¶
type BaseHandler ¶
type BaseHandler struct {
// contains filtered or unexported fields
}
BaseHandler provides common functionality for workflow handlers
func NewBaseHandler ¶
func NewBaseHandler(sugar *zap.SugaredLogger) *BaseHandler
NewBaseHandler creates a new base handler
func (*BaseHandler) Bind ¶
func (b *BaseHandler) Bind(ctx echo.Context, req interface{}) error
Bind binds a request without validation (used for Update operations with optional fields)
func (*BaseHandler) BindAndValidate ¶
func (b *BaseHandler) BindAndValidate(ctx echo.Context, req interface{}) error
BindAndValidate binds and validates a request
func (*BaseHandler) GetActorFromClaims ¶
GetActorFromClaims resolves the authenticated actor from JWT claims.
func (*BaseHandler) HandleServiceError ¶
func (b *BaseHandler) HandleServiceError(ctx echo.Context, err error, operation, entityName string) error
HandleServiceError handles service layer errors with appropriate HTTP status codes
func (*BaseHandler) RespondCreated ¶
func (b *BaseHandler) RespondCreated(ctx echo.Context, data interface{}) error
RespondCreated sends a created JSON response
func (*BaseHandler) RespondNoContent ¶
func (b *BaseHandler) RespondNoContent(ctx echo.Context) error
RespondNoContent sends a no content response
type BulkReassignRoleResponse ¶
type BulkReassignRoleResponse struct {
Data BulkReassignRoleResponseData `json:"data"`
}
type CancelWorkflowExecutionRequest ¶
type CancelWorkflowExecutionRequest struct {
Reason string `json:"reason"`
}
type ControlRelationshipHandler ¶
type ControlRelationshipHandler struct {
*BaseHandler
// contains filtered or unexported fields
}
func NewControlRelationshipHandler ¶
func NewControlRelationshipHandler(sugar *zap.SugaredLogger, db *gorm.DB) *ControlRelationshipHandler
func (*ControlRelationshipHandler) Activate ¶
func (h *ControlRelationshipHandler) Activate(ctx echo.Context) error
Activate godoc
@Summary Activate control relationship
@Description Activate a control relationship
@Tags Control Relationships
@Produce json
@Param id path string true "Control Relationship ID"
@Success 200 {object} ControlRelationshipResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/control-relationships/{id}/activate [put]
func (*ControlRelationshipHandler) Create ¶
func (h *ControlRelationshipHandler) Create(ctx echo.Context) error
Create godoc
@Summary Create control relationship
@Description Create a new control relationship for a workflow
@Tags Control Relationships
@Accept json
@Produce json
@Param request body CreateControlRelationshipRequest true "Control relationship details"
@Success 201 {object} ControlRelationshipResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/control-relationships [post]
func (*ControlRelationshipHandler) Deactivate ¶
func (h *ControlRelationshipHandler) Deactivate(ctx echo.Context) error
Deactivate godoc
@Summary Deactivate control relationship
@Description Deactivate a control relationship
@Tags Control Relationships
@Produce json
@Param id path string true "Control Relationship ID"
@Success 200 {object} ControlRelationshipResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/control-relationships/{id}/deactivate [put]
func (*ControlRelationshipHandler) Delete ¶
func (h *ControlRelationshipHandler) Delete(ctx echo.Context) error
Delete godoc
@Summary Delete control relationship
@Description Delete a control relationship
@Tags Control Relationships
@Param id path string true "Control Relationship ID"
@Success 204
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/control-relationships/{id} [delete]
func (*ControlRelationshipHandler) Get ¶
func (h *ControlRelationshipHandler) Get(ctx echo.Context) error
Get godoc
@Summary Get control relationship
@Description Get control relationship by ID
@Tags Control Relationships
@Produce json
@Param id path string true "Control Relationship ID"
@Success 200 {object} ControlRelationshipResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/control-relationships/{id} [get]
func (*ControlRelationshipHandler) List ¶
func (h *ControlRelationshipHandler) List(ctx echo.Context) error
List godoc
@Summary List control relationships
@Description List all control relationships, optionally filtered by workflow definition
@Tags Control Relationships
@Produce json
@Param workflow_definition_id query string false "Workflow Definition ID"
@Param control_id query string false "Control ID"
@Success 200 {object} ControlRelationshipListResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/control-relationships [get]
func (*ControlRelationshipHandler) Register ¶
func (h *ControlRelationshipHandler) Register(api *echo.Group)
func (*ControlRelationshipHandler) Update ¶
func (h *ControlRelationshipHandler) Update(ctx echo.Context) error
Update godoc
@Summary Update control relationship
@Description Update an existing control relationship
@Tags Control Relationships
@Accept json
@Produce json
@Param id path string true "Control Relationship ID"
@Param request body UpdateControlRelationshipRequest true "Update details"
@Success 200 {object} ControlRelationshipResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/control-relationships/{id} [put]
type ControlRelationshipListResponse ¶
type ControlRelationshipListResponse struct {
Data []workflows.ControlRelationship `json:"data"`
}
type ControlRelationshipResponse ¶
type ControlRelationshipResponse struct {
Data *workflows.ControlRelationship `json:"data"`
}
type CreateControlRelationshipRequest ¶
type CreateControlRelationshipRequest struct {
WorkflowDefinitionID *uuid.UUID `json:"workflow-definition-id" validate:"required"`
ControlID string `json:"control-id" validate:"required"`
CatalogID string `json:"catalog-id" validate:"required"`
RelationshipType string `json:"relationship-type"` // If not provided - 'satisfies' is used
Strength string `json:"strength"` // If not provided - 'primary' is used
Description string `json:"description"`
IsActive *bool `json:"is-active"`
}
type CreateRoleAssignmentRequest ¶
type CreateRoleAssignmentRequest struct {
WorkflowInstanceID *uuid.UUID `json:"workflow-instance-id" validate:"required"`
RoleName string `json:"role-name" validate:"required"`
AssignedToType string `json:"assigned-to-type" validate:"required"`
AssignedToID string `json:"assigned-to-id" validate:"required"`
IsActive *bool `json:"is-active"`
}
type CreateWorkflowDefinitionRequest ¶
type CreateWorkflowDefinitionRequest struct {
Name string `json:"name" validate:"required"`
Description string `json:"description"`
Version string `json:"version"`
SuggestedCadence string `json:"suggested-cadence"`
EvidenceRequired string `json:"evidence-required"`
GracePeriodDays *int `json:"grace-period-days"`
}
type CreateWorkflowInstanceRequest ¶
type CreateWorkflowInstanceRequest struct {
WorkflowDefinitionID *uuid.UUID `json:"workflow-definition-id" validate:"required"`
Name string `json:"name" validate:"required"`
Description string `json:"description"`
SystemSecurityPlanID string `json:"system-id" validate:"required"`
Cadence string `json:"cadence"`
IsActive *bool `json:"is-active"`
GracePeriodDays *int `json:"grace-period-days"`
}
type CreateWorkflowStepDefinitionRequest ¶
type CreateWorkflowStepDefinitionRequest struct {
WorkflowDefinitionID *uuid.UUID `json:"workflow-definition-id" validate:"required"`
Name string `json:"name" validate:"required"`
Description string `json:"description"`
ResponsibleRole string `json:"responsible-role" validate:"required"`
EvidenceRequired []workflows.EvidenceRequirement `json:"evidence-required"`
EstimatedDuration int `json:"estimated-duration"`
GracePeriodDays *int `json:"grace-period-days"`
DependsOn []string `json:"depends-on"` // Array of step IDs this step depends on
}
type FailStepRequest ¶
type FailStepRequest struct {
Reason string `json:"reason" validate:"required"`
}
type MyAssignmentsResponse ¶
type ReassignRoleRequest ¶
type ReassignStepRequest ¶
type RoleAssignmentHandler ¶
type RoleAssignmentHandler struct {
*BaseHandler
// contains filtered or unexported fields
}
func NewRoleAssignmentHandler ¶
func NewRoleAssignmentHandler(sugar *zap.SugaredLogger, db *gorm.DB) *RoleAssignmentHandler
func (*RoleAssignmentHandler) Activate ¶
func (h *RoleAssignmentHandler) Activate(ctx echo.Context) error
Activate godoc
@Summary Activate role assignment
@Description Activate a role assignment
@Tags Role Assignments
@Produce json
@Param id path string true "Role Assignment ID"
@Success 200 {object} RoleAssignmentResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/role-assignments/{id}/activate [put]
func (*RoleAssignmentHandler) Create ¶
func (h *RoleAssignmentHandler) Create(ctx echo.Context) error
Create godoc
@Summary Create role assignment
@Description Create a new role assignment for a workflow instance
@Tags Role Assignments
@Accept json
@Produce json
@Param request body CreateRoleAssignmentRequest true "Role assignment details"
@Success 201 {object} RoleAssignmentResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/role-assignments [post]
func (*RoleAssignmentHandler) Deactivate ¶
func (h *RoleAssignmentHandler) Deactivate(ctx echo.Context) error
Deactivate godoc
@Summary Deactivate role assignment
@Description Deactivate a role assignment
@Tags Role Assignments
@Produce json
@Param id path string true "Role Assignment ID"
@Success 200 {object} RoleAssignmentResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/role-assignments/{id}/deactivate [put]
func (*RoleAssignmentHandler) Delete ¶
func (h *RoleAssignmentHandler) Delete(ctx echo.Context) error
Delete godoc
@Summary Delete role assignment
@Description Delete a role assignment
@Tags Role Assignments
@Param id path string true "Role Assignment ID"
@Success 204
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/role-assignments/{id} [delete]
func (*RoleAssignmentHandler) Get ¶
func (h *RoleAssignmentHandler) Get(ctx echo.Context) error
Get godoc
@Summary Get role assignment
@Description Get role assignment by ID
@Tags Role Assignments
@Produce json
@Param id path string true "Role Assignment ID"
@Success 200 {object} RoleAssignmentResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/role-assignments/{id} [get]
func (*RoleAssignmentHandler) List ¶
func (h *RoleAssignmentHandler) List(ctx echo.Context) error
List godoc
@Summary List role assignments
@Description List all role assignments, optionally filtered by workflow instance
@Tags Role Assignments
@Produce json
@Param workflow_instance_id query string false "Workflow Instance ID"
@Param role_name query string false "Role Name"
@Success 200 {object} RoleAssignmentListResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/role-assignments [get]
func (*RoleAssignmentHandler) Register ¶
func (h *RoleAssignmentHandler) Register(api *echo.Group)
func (*RoleAssignmentHandler) Update ¶
func (h *RoleAssignmentHandler) Update(ctx echo.Context) error
Update godoc
@Summary Update role assignment
@Description Update an existing role assignment
@Tags Role Assignments
@Accept json
@Produce json
@Param id path string true "Role Assignment ID"
@Param request body UpdateRoleAssignmentRequest true "Update details"
@Success 200 {object} RoleAssignmentResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/role-assignments/{id} [put]
type RoleAssignmentListResponse ¶
type RoleAssignmentListResponse struct {
Data []workflows.RoleAssignment `json:"data"`
}
type RoleAssignmentResponse ¶
type RoleAssignmentResponse struct {
Data *workflows.RoleAssignment `json:"data"`
}
type StepExecutionHandler ¶
type StepExecutionHandler struct {
*BaseHandler
// contains filtered or unexported fields
}
func NewStepExecutionHandler ¶
func NewStepExecutionHandler( sugar *zap.SugaredLogger, db *gorm.DB, transitionService *workflow.StepTransitionService, assignmentService *workflow.AssignmentService, ) *StepExecutionHandler
func (*StepExecutionHandler) CanTransition ¶
func (h *StepExecutionHandler) CanTransition(ctx echo.Context) error
CanTransition godoc
@Summary Check if user can transition step
@Description Check if a user has permission to transition a step execution
@Tags Step Executions
@Produce json
@Param id path string true "Step Execution ID"
@Param user_id query string true "User ID"
@Param user_type query string true "User Type (user, group, email)"
@Success 200 {object} map[string]interface{}
@Failure 400 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/step-executions/{id}/can-transition [get]
func (*StepExecutionHandler) Fail ¶
func (h *StepExecutionHandler) Fail(ctx echo.Context) error
Fail godoc
@Summary Fail step execution
@Description Mark a step execution as failed with a reason
@Tags Step Executions
@Accept json
@Produce json
@Param id path string true "Step Execution ID"
@Param request body FailStepRequest true "Failure details"
@Success 200 {object} StepExecutionResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/step-executions/{id}/fail [put]
func (*StepExecutionHandler) Get ¶
func (h *StepExecutionHandler) Get(ctx echo.Context) error
Get godoc
@Summary Get step execution
@Description Get step execution by ID
@Tags Step Executions
@Produce json
@Param id path string true "Step Execution ID"
@Success 200 {object} StepExecutionResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/step-executions/{id} [get]
func (*StepExecutionHandler) GetEvidenceRequirements ¶
func (h *StepExecutionHandler) GetEvidenceRequirements(ctx echo.Context) error
GetEvidenceRequirements godoc
@Summary Get evidence requirements for step
@Description Get the evidence requirements for a step execution
@Tags Step Executions
@Produce json
@Param id path string true "Step Execution ID"
@Success 200 {object} map[string]interface{}
@Failure 400 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/step-executions/{id}/evidence-requirements [get]
func (*StepExecutionHandler) List ¶
func (h *StepExecutionHandler) List(ctx echo.Context) error
List godoc
@Summary List step executions
@Description List all step executions for a workflow execution
@Tags Step Executions
@Produce json
@Param workflow_execution_id query string true "Workflow Execution ID"
@Success 200 {object} StepExecutionListResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/step-executions [get]
func (*StepExecutionHandler) ListMy ¶
func (h *StepExecutionHandler) ListMy(ctx echo.Context) error
ListMy godoc
@Summary List my step assignments
@Description List all step executions assigned to the current user with optional filters and pagination
@Tags Step Executions
@Produce json
@Param status query string false "Filter by status (pending, in_progress, blocked)"
@Param due_before query string false "Filter by due date before (RFC3339 format)"
@Param due_after query string false "Filter by due date after (RFC3339 format)"
@Param workflow_definition_id query string false "Filter by workflow definition ID"
@Param limit query int false "Limit (default 20, max 100)"
@Param offset query int false "Offset (default 0)"
@Success 200 {object} MyAssignmentsResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/step-executions/my [get]
func (*StepExecutionHandler) Reassign ¶
func (h *StepExecutionHandler) Reassign(ctx echo.Context) error
Reassign godoc
@Summary Reassign step execution
@Description Reassign a step execution to a new assignee
@Tags Step Executions
@Accept json
@Produce json
@Param id path string true "Step Execution ID"
@Param request body ReassignStepRequest true "Reassignment details"
@Success 200 {object} StepExecutionResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/step-executions/{id}/reassign [put]
func (*StepExecutionHandler) Register ¶
func (h *StepExecutionHandler) Register(api *echo.Group)
func (*StepExecutionHandler) TransitionStep ¶
func (h *StepExecutionHandler) TransitionStep(ctx echo.Context) error
TransitionStep godoc
@Summary Transition step execution status
@Description Transition a step execution status with role verification and evidence validation
@Tags Step Executions
@Accept json
@Produce json
@Param id path string true "Step Execution ID"
@Param request body TransitionStepRequest true "Transition request"
@Success 200 {object} StepExecutionResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 403 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/step-executions/{id}/transition [put]
type StepExecutionListResponse ¶
type StepExecutionListResponse struct {
Data []workflows.StepExecution `json:"data"`
}
type StepExecutionResponse ¶
type StepExecutionResponse struct {
Data *workflows.StepExecution `json:"data"`
}
type TransitionStepRequest ¶
type TransitionStepRequest struct {
Status string `json:"status" validate:"required,oneof=in_progress completed"`
Evidence []workflow.EvidenceSubmission `json:"evidence,omitempty"`
Notes string `json:"notes,omitempty"`
UserID string `json:"user-id" validate:"required"`
UserType string `json:"user-type" validate:"required,oneof=user group email"`
}
type UpdateWorkflowDefinitionRequest ¶
type UpdateWorkflowDefinitionRequest struct {
Name *string `json:"name"`
Description *string `json:"description"`
Version *string `json:"version"`
SuggestedCadence *string `json:"suggested-cadence"`
EvidenceRequired *string `json:"evidence-required"`
GracePeriodDays *int `json:"grace-period-days"`
}
type UpdateWorkflowStepDefinitionRequest ¶
type UpdateWorkflowStepDefinitionRequest struct {
Name *string `json:"name"`
Description *string `json:"description"`
ResponsibleRole *string `json:"responsible-role"`
EvidenceRequired *[]workflows.EvidenceRequirement `json:"evidence-required"`
EstimatedDuration *int `json:"estimated-duration"`
GracePeriodDays *int `json:"grace-period-days"`
DependsOn *[]string `json:"depends-on"`
}
type WorkflowDefinitionHandler ¶
type WorkflowDefinitionHandler struct {
*BaseHandler
// contains filtered or unexported fields
}
func NewWorkflowDefinitionHandler ¶
func NewWorkflowDefinitionHandler(sugar *zap.SugaredLogger, db *gorm.DB) *WorkflowDefinitionHandler
func (*WorkflowDefinitionHandler) Create ¶
func (h *WorkflowDefinitionHandler) Create(ctx echo.Context) error
Create godoc
@Summary Create workflow definition
@Description Create a new workflow definition template
@Tags Workflow Definitions
@Accept json
@Produce json
@Param request body CreateWorkflowDefinitionRequest true "Workflow definition details"
@Success 201 {object} WorkflowDefinitionResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/definitions [post]
func (*WorkflowDefinitionHandler) Delete ¶
func (h *WorkflowDefinitionHandler) Delete(ctx echo.Context) error
Delete godoc
@Summary Delete workflow definition
@Description Delete workflow definition by ID
@Tags Workflow Definitions
@Produce json
@Param id path string true "Workflow Definition ID"
@Success 204 "No Content"
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/definitions/{id} [delete]
func (*WorkflowDefinitionHandler) Get ¶
func (h *WorkflowDefinitionHandler) Get(ctx echo.Context) error
Get godoc
@Summary Get workflow definition
@Description Get workflow definition by ID
@Tags Workflow Definitions
@Produce json
@Param id path string true "Workflow Definition ID"
@Success 200 {object} WorkflowDefinitionResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/definitions/{id} [get]
func (*WorkflowDefinitionHandler) List ¶
func (h *WorkflowDefinitionHandler) List(ctx echo.Context) error
List godoc
@Summary List workflow definitions
@Description List all workflow definition templates
@Tags Workflow Definitions
@Produce json
@Success 200 {object} WorkflowDefinitionListResponse
@Failure 401 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/definitions [get]
func (*WorkflowDefinitionHandler) Register ¶
func (h *WorkflowDefinitionHandler) Register(api *echo.Group)
func (*WorkflowDefinitionHandler) Update ¶
func (h *WorkflowDefinitionHandler) Update(ctx echo.Context) error
Update godoc
@Summary Update workflow definition
@Description Update workflow definition by ID
@Tags Workflow Definitions
@Accept json
@Produce json
@Param id path string true "Workflow Definition ID"
@Param request body UpdateWorkflowDefinitionRequest true "Updated workflow definition details"
@Success 200 {object} WorkflowDefinitionResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/definitions/{id} [put]
type WorkflowDefinitionListResponse ¶
type WorkflowDefinitionListResponse struct {
Data []workflows.WorkflowDefinition `json:"data"`
}
type WorkflowDefinitionResponse ¶
type WorkflowDefinitionResponse struct {
Data *workflows.WorkflowDefinition `json:"data"`
}
type WorkflowExecutionHandler ¶
type WorkflowExecutionHandler struct {
*BaseHandler
// contains filtered or unexported fields
}
func NewWorkflowExecutionHandler ¶
func NewWorkflowExecutionHandler( sugar *zap.SugaredLogger, db *gorm.DB, manager *workflow.Manager, assignmentService *workflow.AssignmentService, ) *WorkflowExecutionHandler
func (*WorkflowExecutionHandler) Cancel ¶
func (h *WorkflowExecutionHandler) Cancel(ctx echo.Context) error
Cancel godoc
@Summary Cancel workflow execution
@Description Cancel a running workflow execution
@Tags Workflow Executions
@Accept json
@Produce json
@Param id path string true "Workflow Execution ID"
@Param request body CancelWorkflowExecutionRequest true "Cancel details"
@Success 200 {object} WorkflowExecutionResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/executions/{id}/cancel [put]
func (*WorkflowExecutionHandler) Get ¶
func (h *WorkflowExecutionHandler) Get(ctx echo.Context) error
Get godoc
@Summary Get workflow execution
@Description Get workflow execution by ID
@Tags Workflow Executions
@Produce json
@Param id path string true "Workflow Execution ID"
@Success 200 {object} WorkflowExecutionResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/executions/{id} [get]
func (*WorkflowExecutionHandler) GetMetrics ¶
func (h *WorkflowExecutionHandler) GetMetrics(ctx echo.Context) error
GetMetrics godoc
@Summary Get workflow execution metrics
@Description Get performance metrics for a workflow execution
@Tags Workflow Executions
@Produce json
@Param id path string true "Workflow Execution ID"
@Success 200 {object} WorkflowExecutionMetricsResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/executions/{id}/metrics [get]
func (*WorkflowExecutionHandler) GetStatus ¶
func (h *WorkflowExecutionHandler) GetStatus(ctx echo.Context) error
GetStatus godoc
@Summary Get workflow execution status
@Description Get detailed status of a workflow execution including step counts
@Tags Workflow Executions
@Produce json
@Param id path string true "Workflow Execution ID"
@Success 200 {object} WorkflowExecutionStatusResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/executions/{id}/status [get]
func (*WorkflowExecutionHandler) List ¶
func (h *WorkflowExecutionHandler) List(ctx echo.Context) error
List godoc
@Summary List workflow executions
@Description List all executions for a workflow instance
@Tags Workflow Executions
@Produce json
@Param workflow_instance_id query string true "Workflow Instance ID"
@Param limit query int false "Limit"
@Param offset query int false "Offset"
@Success 200 {object} WorkflowExecutionListResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/executions [get]
func (*WorkflowExecutionHandler) ReassignRole ¶
func (h *WorkflowExecutionHandler) ReassignRole(ctx echo.Context) error
ReassignRole godoc
@Summary Bulk reassign steps by role
@Description Reassign eligible steps in an execution for a given role
@Tags Workflow Executions
@Accept json
@Produce json
@Param id path string true "Workflow Execution ID"
@Param request body ReassignRoleRequest true "Bulk reassignment details"
@Success 200 {object} BulkReassignRoleResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/executions/{id}/reassign-role [put]
func (*WorkflowExecutionHandler) Register ¶
func (h *WorkflowExecutionHandler) Register(api *echo.Group)
func (*WorkflowExecutionHandler) Retry ¶
func (h *WorkflowExecutionHandler) Retry(ctx echo.Context) error
Retry godoc
@Summary Retry workflow execution
@Description Create a new execution to retry a failed workflow
@Tags Workflow Executions
@Produce json
@Param id path string true "Workflow Execution ID"
@Success 201 {object} WorkflowExecutionResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/executions/{id}/retry [post]
func (*WorkflowExecutionHandler) Start ¶
func (h *WorkflowExecutionHandler) Start(ctx echo.Context) error
Start godoc
@Summary Start workflow execution
@Description Start a new execution of a workflow instance
@Tags Workflow Executions
@Accept json
@Produce json
@Param request body StartWorkflowExecutionRequest true "Execution details"
@Success 201 {object} WorkflowExecutionResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/executions [post]
type WorkflowExecutionListResponse ¶
type WorkflowExecutionListResponse struct {
Data []workflows.WorkflowExecution `json:"data"`
}
type WorkflowExecutionMetricsResponse ¶
type WorkflowExecutionMetricsResponse struct {
Data *workflow.ExecutionMetrics `json:"data"`
}
type WorkflowExecutionResponse ¶
type WorkflowExecutionResponse struct {
Data *workflows.WorkflowExecution `json:"data"`
}
type WorkflowExecutionStatusResponse ¶
type WorkflowExecutionStatusResponse struct {
Data *workflow.ExecutionStatus `json:"data"`
}
type WorkflowInstanceHandler ¶
type WorkflowInstanceHandler struct {
*BaseHandler
// contains filtered or unexported fields
}
func NewWorkflowInstanceHandler ¶
func NewWorkflowInstanceHandler(sugar *zap.SugaredLogger, db *gorm.DB) *WorkflowInstanceHandler
func (*WorkflowInstanceHandler) Activate ¶
func (h *WorkflowInstanceHandler) Activate(ctx echo.Context) error
Activate godoc
@Summary Activate workflow instance
@Description Activate a workflow instance to enable scheduled executions
@Tags Workflow Instances
@Produce json
@Param id path string true "Workflow Instance ID"
@Success 200 {object} WorkflowInstanceResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/instances/{id}/activate [put]
func (*WorkflowInstanceHandler) Create ¶
func (h *WorkflowInstanceHandler) Create(ctx echo.Context) error
Create godoc
@Summary Create workflow instance
@Description Create a new workflow instance for a specific system
@Tags Workflow Instances
@Accept json
@Produce json
@Param request body CreateWorkflowInstanceRequest true "Workflow instance details"
@Success 201 {object} WorkflowInstanceResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/instances [post]
func (*WorkflowInstanceHandler) Deactivate ¶
func (h *WorkflowInstanceHandler) Deactivate(ctx echo.Context) error
Deactivate godoc
@Summary Deactivate workflow instance
@Description Deactivate a workflow instance to disable scheduled executions
@Tags Workflow Instances
@Produce json
@Param id path string true "Workflow Instance ID"
@Success 200 {object} WorkflowInstanceResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/instances/{id}/deactivate [put]
func (*WorkflowInstanceHandler) Delete ¶
func (h *WorkflowInstanceHandler) Delete(ctx echo.Context) error
Delete godoc
@Summary Delete workflow instance
@Description Delete workflow instance by ID
@Tags Workflow Instances
@Produce json
@Param id path string true "Workflow Instance ID"
@Success 204 "No Content"
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/instances/{id} [delete]
func (*WorkflowInstanceHandler) Get ¶
func (h *WorkflowInstanceHandler) Get(ctx echo.Context) error
Get godoc
@Summary Get workflow instance
@Description Get workflow instance by ID
@Tags Workflow Instances
@Produce json
@Param id path string true "Workflow Instance ID"
@Success 200 {object} WorkflowInstanceResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/instances/{id} [get]
func (*WorkflowInstanceHandler) List ¶
func (h *WorkflowInstanceHandler) List(ctx echo.Context) error
List godoc
@Summary List workflow instances
@Description List all workflow instances with optional filtering
@Tags Workflow Instances
@Produce json
@Param workflow_definition_id query string false "Filter by Workflow Definition ID"
@Param system_security_plan_id query string false "Filter by System Security Plan ID"
@Param is_active query bool false "Filter by Active Status"
@Success 200 {object} WorkflowInstanceListResponse
@Failure 401 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/instances [get]
func (*WorkflowInstanceHandler) Register ¶
func (h *WorkflowInstanceHandler) Register(api *echo.Group)
func (*WorkflowInstanceHandler) Update ¶
func (h *WorkflowInstanceHandler) Update(ctx echo.Context) error
Update godoc
@Summary Update workflow instance
@Description Update workflow instance by ID
@Tags Workflow Instances
@Accept json
@Produce json
@Param id path string true "Workflow Instance ID"
@Param request body UpdateWorkflowInstanceRequest true "Updated workflow instance details"
@Success 200 {object} WorkflowInstanceResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/instances/{id} [put]
type WorkflowInstanceListResponse ¶
type WorkflowInstanceListResponse struct {
Data []workflows.WorkflowInstance `json:"data"`
}
type WorkflowInstanceResponse ¶
type WorkflowInstanceResponse struct {
Data *workflows.WorkflowInstance `json:"data"`
}
type WorkflowStepDefinitionHandler ¶
type WorkflowStepDefinitionHandler struct {
*BaseHandler
// contains filtered or unexported fields
}
func NewWorkflowStepDefinitionHandler ¶
func NewWorkflowStepDefinitionHandler(sugar *zap.SugaredLogger, db *gorm.DB) *WorkflowStepDefinitionHandler
func (*WorkflowStepDefinitionHandler) Create ¶
func (h *WorkflowStepDefinitionHandler) Create(ctx echo.Context) error
Create godoc
@Summary Create workflow step definition
@Description Create a new step definition for a workflow
@Tags Workflow Step Definitions
@Accept json
@Produce json
@Param request body CreateWorkflowStepDefinitionRequest true "Step definition details"
@Success 201 {object} WorkflowStepDefinitionResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/steps [post]
func (*WorkflowStepDefinitionHandler) Delete ¶
func (h *WorkflowStepDefinitionHandler) Delete(ctx echo.Context) error
Delete godoc
@Summary Delete workflow step definition
@Description Delete workflow step definition by ID
@Tags Workflow Step Definitions
@Produce json
@Param id path string true "Step Definition ID"
@Success 204 "No Content"
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/steps/{id} [delete]
func (*WorkflowStepDefinitionHandler) Get ¶
func (h *WorkflowStepDefinitionHandler) Get(ctx echo.Context) error
Get godoc
@Summary Get workflow step definition
@Description Get workflow step definition by ID
@Tags Workflow Step Definitions
@Produce json
@Param id path string true "Step Definition ID"
@Success 200 {object} WorkflowStepDefinitionResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/steps/{id} [get]
func (*WorkflowStepDefinitionHandler) GetDependencies ¶
func (h *WorkflowStepDefinitionHandler) GetDependencies(ctx echo.Context) error
GetDependencies godoc
@Summary Get step dependencies
@Description Get all dependencies for a workflow step definition
@Tags Workflow Step Definitions
@Produce json
@Param id path string true "Step Definition ID"
@Success 200 {object} WorkflowStepDefinitionListResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/steps/{id}/dependencies [get]
func (*WorkflowStepDefinitionHandler) ListByWorkflowDefinition ¶
func (h *WorkflowStepDefinitionHandler) ListByWorkflowDefinition(ctx echo.Context) error
ListByWorkflowDefinition godoc
@Summary List workflow step definitions
@Description List all step definitions for a workflow definition
@Tags Workflow Step Definitions
@Produce json
@Param workflow_definition_id query string true "Workflow Definition ID"
@Success 200 {object} WorkflowStepDefinitionListResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/steps [get]
func (*WorkflowStepDefinitionHandler) Register ¶
func (h *WorkflowStepDefinitionHandler) Register(api *echo.Group)
func (*WorkflowStepDefinitionHandler) Update ¶
func (h *WorkflowStepDefinitionHandler) Update(ctx echo.Context) error
Update godoc
@Summary Update workflow step definition
@Description Update workflow step definition by ID
@Tags Workflow Step Definitions
@Accept json
@Produce json
@Param id path string true "Step Definition ID"
@Param request body UpdateWorkflowStepDefinitionRequest true "Updated step definition details"
@Success 200 {object} WorkflowStepDefinitionResponse
@Failure 400 {object} api.Error
@Failure 401 {object} api.Error
@Failure 404 {object} api.Error
@Failure 500 {object} api.Error
@Security OAuth2Password
@Router /workflows/steps/{id} [put]
type WorkflowStepDefinitionListResponse ¶
type WorkflowStepDefinitionListResponse struct {
Data []workflows.WorkflowStepDefinition `json:"data"`
}
type WorkflowStepDefinitionResponse ¶
type WorkflowStepDefinitionResponse struct {
Data *workflows.WorkflowStepDefinition `json:"data"`
}