Documentation
¶
Index ¶
- func GetSafeWriteRoot() string
- func IsWriteDenied(path string) error
- func NearestExistingAncestor(path string) (string, error)
- func PathWithinWorkspace(path string) error
- func RealWorkspaceRoot() (string, error)
- func ResolveExistingWorkspacePath(path string) (string, error)
- func ResolveWorkspacePath(path string) (string, error)
- func SanitizedEnv(extra map[string]string) []string
- func SetWriteSafeRoot(root string)
- func ValidateWritableWorkspacePath(path string) error
- func WorkspaceRoot() (string, error)
- type ApprovalResult
- type DangerousPattern
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NearestExistingAncestor ¶
NearestExistingAncestor 查找路径最近的已存在的祖先目录
func PathWithinWorkspace ¶
PathWithinWorkspace 检查路径是否在工作区内
func RealWorkspaceRoot ¶
RealWorkspaceRoot 获取工作区根目录的真实路径(解析符号链接)。
func ResolveExistingWorkspacePath ¶
ResolveExistingWorkspacePath 解析路径并验证符号链接目标在工作区内
func ResolveWorkspacePath ¶
ResolveWorkspacePath 解析相对于工作区的路径,检查是否超出工作区
func ValidateWritableWorkspacePath ¶
ValidateWritableWorkspacePath 验证路径可用于写入,检查符号链接和父目录
Types ¶
type ApprovalResult ¶
type ApprovalResult struct {
Approved bool
Status string
PatternKey string
Description string
Message string
}
ApprovalResult 命令审批结果
func CheckDangerousCommand ¶
func CheckDangerousCommand(command string) ApprovalResult
CheckDangerousCommand 检查命令是否危险
Click to show internal directories.
Click to hide internal directories.