Documentation
¶
Index ¶
- Constants
- func CanonicalPayload(lease Lease) ([]byte, error)
- func ParseHMACKeyring(raw string) (map[string][]byte, error)
- func ValidateLease(lease Lease, now time.Time) error
- func VerifySignedLease(lease Lease, keyring map[string][]byte, now time.Time) error
- type Decision
- type DecisionInput
- type DecisionResult
- type ExecRule
- type FileAccess
- type Lease
- type LeaseError
- type ModeContext
- type NetworkRule
- type PolicyBroker
- type RuntimeRequest
- type StaticPolicy
Constants ¶
View Source
const ( ReasonFSOutOfScope = "fs_out_of_scope" ReasonExecNotAllowed = "exec_not_allowed" ReasonNetworkNotAllowed = "network_not_allowed" ReasonApprovalRequired = "approval_required" ReasonDeniedDependency = "denied_dependency" )
View Source
const ( LeaseVersionV1 = "v1" LeaseScopeRun = "run" )
View Source
const ( ReasonLeaseExpired = "lease_expired" ReasonLeaseSignatureInvalid = "lease_signature_invalid" ReasonLeaseInvalid = "lease_invalid" )
View Source
const LeaseSchemaV1JSON = `` /* 2522-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func CanonicalPayload ¶
Types ¶
type DecisionInput ¶
type DecisionInput struct {
Lease Lease
Keyring map[string][]byte
Now time.Time
Static StaticPolicy
Mode ModeContext
Request RuntimeRequest
}
type DecisionResult ¶
type FileAccess ¶
type FileAccess string
const ( FileAccessRead FileAccess = "read" FileAccessWrite FileAccess = "write" )
type Lease ¶
type Lease struct {
Version string `json:"version"`
LeaseID string `json:"lease_id"`
RunID string `json:"run_id"`
Scope string `json:"scope"`
IssuedAt time.Time `json:"issued_at"`
ExpiresAt time.Time `json:"expires_at"`
KID string `json:"kid"`
ApprovalMode string `json:"approval_mode"`
AwayPolicy string `json:"away_policy"`
FSRead []string `json:"fs_read"`
FSWrite []string `json:"fs_write"`
ExecAllowlist []ExecRule `json:"exec_allowlist"`
NetworkAllowlist []NetworkRule `json:"network_allowlist"`
Signature string `json:"signature,omitempty"`
}
type LeaseError ¶
func (*LeaseError) Error ¶
func (e *LeaseError) Error() string
func (*LeaseError) Unwrap ¶
func (e *LeaseError) Unwrap() error
type ModeContext ¶
type NetworkRule ¶
type PolicyBroker ¶
type PolicyBroker interface {
Decide(context.Context, DecisionInput) (DecisionResult, error)
}
func NewPolicyBroker ¶
func NewPolicyBroker() PolicyBroker
type RuntimeRequest ¶
type RuntimeRequest struct {
ToolName string
FilePath string
FileAccess FileAccess
Command string
Args []string
Network NetworkRule
RequiresApproval bool
}
type StaticPolicy ¶
type StaticPolicy struct {
ApprovalPolicy string
}
Click to show internal directories.
Click to hide internal directories.