Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApprovalStage ¶
type ApprovalStage struct {
Index int `json:"index"`
Name string `json:"name,omitempty"`
RequiredApprovals int `json:"required_approvals"`
AllowedCheckerRoles json.RawMessage `json:"allowed_checker_roles,omitempty"`
AllowedPermissions json.RawMessage `json:"allowed_permissions,omitempty"`
AuthorizationMode AuthorizationMode `json:"authorization_mode,omitempty"`
RejectionPolicy RejectionPolicy `json:"rejection_policy"`
MaxCheckers *int `json:"max_checkers,omitempty"`
}
type AuthorizationMode ¶
type AuthorizationMode string
const ( AuthModeRole AuthorizationMode = "role" AuthModePermission AuthorizationMode = "permission" AuthModeAny AuthorizationMode = "any" AuthModeAll AuthorizationMode = "all" )
type Operator ¶
type Operator struct {
ID uuid.UUID `json:"id"`
Username string `json:"username"`
PasswordHash string `json:"-"` // never expose in JSON
DisplayName string `json:"display_name"`
MustChangePassword bool `json:"must_change_password"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Operator represents a console user who can manage policies, webhooks, and other administrative tasks through the Quorum admin console.
type OutboxEntry ¶
type OutboxEntry struct {
ID uuid.UUID `json:"id"`
RequestID uuid.UUID `json:"request_id"`
WebhookURL string `json:"webhook_url"`
WebhookSecret string `json:"-"`
Payload json.RawMessage `json:"payload"`
EventType string `json:"event_type"`
Status string `json:"status"` // pending, delivered, failed
Attempts int `json:"attempts"`
MaxRetries int `json:"max_retries"`
LastError *string `json:"last_error,omitempty"`
NextRetryAt time.Time `json:"next_retry_at"`
CreatedAt time.Time `json:"created_at"`
DeliveredAt *time.Time `json:"delivered_at,omitempty"`
}
OutboxEntry represents a durable webhook delivery entry in the outbox table.
type Policy ¶
type Policy struct {
ID uuid.UUID `json:"id"`
TenantID string `json:"tenant_id"`
Name string `json:"name"`
RequestType string `json:"request_type"`
Stages []ApprovalStage `json:"stages"`
IdentityFields []string `json:"identity_fields,omitempty"`
DynamicAuthorizationURL *string `json:"dynamic_authorization_url,omitempty"`
DynamicAuthorizationSecret *string `json:"-"`
AutoExpireDuration *time.Duration `json:"auto_expire_duration,omitempty"`
DisplayTemplate json.RawMessage `json:"display_template,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (*Policy) StageAt ¶
func (p *Policy) StageAt(index int) *ApprovalStage
StageAt returns the approval stage at the given index, or nil if out of range.
func (*Policy) TotalStages ¶
TotalStages returns the number of stages in this policy.
type RejectionPolicy ¶
type RejectionPolicy string
const ( RejectionPolicyAny RejectionPolicy = "any" RejectionPolicyThreshold RejectionPolicy = "threshold" )
type Request ¶
type Request struct {
ID uuid.UUID `json:"id"`
TenantID string `json:"tenant_id"`
IdempotencyKey *string `json:"idempotency_key,omitempty"`
Type string `json:"type"`
Payload json.RawMessage `json:"payload"`
Status RequestStatus `json:"status"`
MakerID string `json:"maker_id"`
EligibleReviewers []string `json:"eligible_reviewers,omitempty"`
Metadata json.RawMessage `json:"metadata,omitempty"`
Fingerprint *string `json:"fingerprint,omitempty"`
CurrentStage int `json:"current_stage"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Approvals []Approval `json:"approvals,omitempty"`
ViewerCanAct *bool `json:"viewer_can_act,omitempty"`
TotalStages *int `json:"total_stages,omitempty"`
}
type RequestStatus ¶
type RequestStatus string
const ( StatusPending RequestStatus = "pending" StatusApproved RequestStatus = "approved" StatusRejected RequestStatus = "rejected" StatusCancelled RequestStatus = "cancelled" StatusExpired RequestStatus = "expired" )
func (RequestStatus) IsTerminal ¶
func (s RequestStatus) IsTerminal() bool
type Tenant ¶
type Tenant struct {
ID uuid.UUID `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Tenant represents a registered tenant (application) in the system.
Click to show internal directories.
Click to hide internal directories.