Documentation
¶
Overview ¶
Package saferscope plans safe workspace boundary changes.
Package saferscope turns workspace token-risk findings into reversible scope changes.
Index ¶
Constants ¶
View Source
const ( StateFileName = "safer-scope.json" IgnoreMarker = "# Codog safer-scope exclusions" ActionAppendIgnoreBlock = "append_ignore_block" ActionCreateIgnoreFile = "create_ignore_file" )
Variables ¶
This section is empty.
Functions ¶
func RenderText ¶
RenderText writes a human-readable safer-scope report.
Types ¶
type Choice ¶
type Choice struct {
ID string `json:"id"`
Action string `json:"action"`
Status string `json:"status"`
Target string `json:"target,omitempty"`
PreviewIncludes []string `json:"preview_includes,omitempty"`
PreviewExcludes []string `json:"preview_excludes,omitempty"`
IgnoreFile string `json:"ignore_file,omitempty"`
IgnoreEntries []string `json:"ignore_entries,omitempty"`
Description string `json:"description"`
}
Choice describes one actionable safer-scope option.
type Report ¶
type Report struct {
Kind string `json:"kind"`
Action string `json:"action"`
Status string `json:"status"`
Advisory bool `json:"advisory"`
Confirmed bool `json:"confirmed"`
Workspace string `json:"workspace"`
OriginalWorkspace string `json:"original_workspace,omitempty"`
ActiveWorkspace string `json:"active_workspace,omitempty"`
AppliedChoice string `json:"applied_choice,omitempty"`
Restored bool `json:"restored,omitempty"`
Message string `json:"message,omitempty"`
Risk fileinventory.ScopeRisk `json:"scope_risk"`
Choices []Choice `json:"choices,omitempty"`
Applied []Choice `json:"applied,omitempty"`
RestoreCommand string `json:"restore_command,omitempty"`
}
Report is the stable payload returned by safer-scope preview/apply/restore.
type State ¶
type State struct {
Kind string `json:"kind"`
OriginalWorkspace string `json:"original_workspace"`
ActiveWorkspace string `json:"active_workspace,omitempty"`
AppliedChoice string `json:"applied_choice"`
IgnoreFile string `json:"ignore_file,omitempty"`
IgnoreEntries []string `json:"ignore_entries,omitempty"`
AppliedAt time.Time `json:"applied_at"`
}
State records the broader scope so an applied safer scope can be restored.
Click to show internal directories.
Click to hide internal directories.