approval

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelRequest

func CancelRequest(ac *client.AlpaconClient, id string) error

func FindCommandApprovalRequestID added in v1.18.0

func FindCommandApprovalRequestID(ac *client.AlpaconClient, commandID string) (string, error)

FindCommandApprovalRequestID reads the requester's pending command approvals: the command detail does not carry the approval request's id.

func GetApprovalRequestRaw

func GetApprovalRequestRaw(ac *client.AlpaconClient, id string) ([]byte, error)

Types

type ApprovalMetadata added in v1.16.0

type ApprovalMetadata struct {
	CommandID   string            `json:"command_id"`
	Command     *CommandDetail    `json:"command"`
	Sudo        *SudoDetail       `json:"sudo"`
	Intent      string            `json:"intent"`
	WorkSession *WorkSessionRef   `json:"work_session"`
	Changes     *RequestedChanges `json:"changes"`
}

ApprovalMetadata is the part of an approval's metadata the CLI renders.

type ApprovalRequest

type ApprovalRequest struct {
	ID          string             `json:"id"`
	RequestType string             `json:"request_type"`
	RequestData string             `json:"request_data"`
	Description string             `json:"description"`
	Status      string             `json:"status"`
	RequestedBy *types.UserSummary `json:"requested_by"`
	ReviewedBy  *types.UserSummary `json:"reviewed_by"`
	ReviewedAt  *time.Time         `json:"reviewed_at"`
	AddedAt     time.Time          `json:"added_at"`
	Metadata    *ApprovalMetadata  `json:"metadata"`
}

func GetApprovalRequest

func GetApprovalRequest(ac *client.AlpaconClient, id string) (*ApprovalRequest, error)

type ApprovalRequestAttributes

type ApprovalRequestAttributes struct {
	ID          string `json:"id"           table:"ID"`
	Type        string `json:"request_type" table:"Type"`
	Status      string `json:"status"       table:"Status"`
	RequestData string `json:"request_data" table:"Request"`
	RequestedBy string `json:"requested_by" table:"Requested By"`
	AddedAt     string `json:"added_at"     table:"Added At"`
}

func ListApprovalRequests

func ListApprovalRequests(ac *client.AlpaconClient, status, requestType string) ([]ApprovalRequestAttributes, error)

func ListMyApprovalRequests

func ListMyApprovalRequests(ac *client.AlpaconClient, status, requestType string) ([]ApprovalRequestAttributes, error)

type CommandDetail added in v1.16.0

type CommandDetail struct {
	CommandID     string `json:"command_id"`
	Line          string `json:"line"`
	ServerName    string `json:"server_name"`
	RiskLevel     string `json:"risk_level"`
	RunsWithSudo  bool   `json:"runs_with_sudo"`
	Purpose       string `json:"purpose"`
	DeclaredAgent string `json:"declared_agent"`
	// ReviewSummary, Tier2Reasoning and Factors reach only a viewer who may decide the request.
	ReviewSummary  string         `json:"review_summary"`
	Tier2Reasoning string         `json:"tier2_reasoning"`
	Factors        []RiskFactor   `json:"factors"`
	FileExecution  *FileExecution `json:"file_execution"`
}

CommandDetail is the part of a command_exec approval's detail payload the CLI renders. The full payload is available with --output json.

type FileExecution added in v1.16.0

type FileExecution struct {
	Content     *string  `json:"content"`
	SHA256      string   `json:"sha256"`
	Path        string   `json:"path"`
	Interpreter string   `json:"interpreter"`
	Args        []string `json:"args"`
	RunAs       string   `json:"runas"`
	RunAsGroup  string   `json:"runas_group"`
	// ReuseDays is what the requester proposed for a standing approval; null
	// when none was proposed.
	ReuseDays *int `json:"reuse_days"`
	// GrantDays is what approving with a standing approval would grant now.
	// Present only while the request is pending.
	GrantDays *int `json:"grant_days"`
}

FileExecution is what the approver is asked to clear for a file execution request. Content is the script as the server shows it to approvers (with acknowledged exposures masked) and is null when the server withholds it.

type RequestedChanges added in v1.16.0

type RequestedChanges struct {
	Title                 string       `json:"title"`
	Description           string       `json:"description"`
	Scopes                []string     `json:"scopes"`
	Servers               []ServerRef  `json:"servers"`
	SudoPolicies          []SudoPolicy `json:"sudo_policies"`
	TargetAccountUsername string       `json:"target_account_username"`
}

type RiskFactor added in v1.16.0

type RiskFactor struct {
	Type   string `json:"type"`
	Detail string `json:"detail"`
}

type ServerRef added in v1.16.0

type ServerRef struct {
	Name string `json:"name"`
}

type SudoDetail added in v1.16.0

type SudoDetail struct {
	Command            string `json:"command"`
	RunAs              string `json:"runas"`
	ServerName         string `json:"server_name"`
	RiskLevel          string `json:"risk_level"`
	GrantStatus        string `json:"grant_status"`
	DeclaredAgent      string `json:"declared_agent"`
	Tier2Reasoning     string `json:"tier2_reasoning"`
	DescriptionAligned *bool  `json:"description_aligned"`
}

SudoDetail is the sudo approval's detail payload. Tier2Reasoning and DescriptionAligned reach deciders only; a null DescriptionAligned is no judgment.

type SudoPolicy added in v1.16.0

type SudoPolicy struct {
	Commands []string `json:"commands"`
}

type WorkSessionRef added in v1.16.0

type WorkSessionRef struct {
	ID     string `json:"id"`
	Title  string `json:"title"`
	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

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