Documentation
¶
Index ¶
Constants ¶
const DenialHint = "cross-workspace access is denied by this session's permission mode; " +
"ask the operator to set the agent's permissions.mode to approve-all, or approve the prompt when asked"
DenialHint is the canonical operator guidance returned by workspace-access seams.
Variables ¶
var ErrInvalidRequest = errors.New("workspace access: invalid request")
ErrInvalidRequest identifies a structurally invalid workspace-access request.
Functions ¶
This section is empty.
Types ¶
type AccessRecord ¶
type AccessRecord struct {
Actor ActorRef
TargetID string
Allowed bool
Source DecisionSource
Mode Mode
Seam Seam
Err string
}
AccessRecord is the audit representation of one authorization decision.
type ActorKind ¶
type ActorKind string
ActorKind identifies the trusted runtime origin of an access request.
type ActorRef ¶
type ActorRef struct {
Kind ActorKind
SessionID string
WorkspaceID string
AgentName string
Operator bool
}
ActorRef carries daemon-validated actor identity into the policy.
type AuditEmitter ¶
type AuditEmitter interface {
EmitWorkspaceAccess(ctx context.Context, record AccessRecord) error
}
AuditEmitter appends one best-effort record per decision.
type Consent ¶
type Consent string
Consent is a session-lifetime answer captured from an ACP prompt.
type Decision ¶
type Decision struct {
Allowed bool
Source DecisionSource
PromptEligible bool
}
Decision is the fail-closed result of one authorization request.
type DecisionSource ¶
type DecisionSource string
DecisionSource records the policy branch that produced a decision.
const ( SourceOperator DecisionSource = "operator" SourceSameWorkspace DecisionSource = "same_workspace" SourcePermissionMode DecisionSource = "permission_mode" SourceSessionConsent DecisionSource = "session_consent" SourceDenied DecisionSource = "denied" )
type DefaultPolicy ¶
type DefaultPolicy struct {
// contains filtered or unexported fields
}
DefaultPolicy applies the fixed workspace-access decision chain.
func New ¶
func New(deps Deps) (*DefaultPolicy, error)
New constructs the fail-closed default policy.
type Deps ¶
type Deps struct {
Modes ModeSource
Consent SessionConsentCache
Audit AuditEmitter
Log *slog.Logger
}
Deps contains every dependency required by DefaultPolicy.
type ModeSource ¶
type ModeSource interface {
SessionPermissionMode(ctx context.Context, sessionID string) (Mode, error)
}
ModeSource resolves the effective permission mode of a live session.