Documentation
¶
Index ¶
- func ExpandPath(path string) (string, error)
- func SecureCommand(name string, args ...string) (*exec.Cmd, error)
- func SecureJoin(base string, elem ...string) (string, error)
- func ValidateBranch(branch string) error
- func ValidatePath(path string) error
- func ValidateRepository(repo string) error
- func ValidateScriptPath(scriptPath string) error
- type FileManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandPath ¶
ExpandPath safely expands ~ to home directory
func SecureCommand ¶
SecureCommand creates a secure exec.Cmd with validated arguments
func SecureJoin ¶
SecureJoin safely joins path components and validates the result
func ValidateBranch ¶
ValidateBranch validates git branch names
func ValidatePath ¶
ValidatePath checks for path traversal attacks and validates path format
func ValidateRepository ¶
ValidateRepository validates repository names to prevent injection
func ValidateScriptPath ¶
ValidateScriptPath validates that script paths are in allowed directories
Types ¶
type FileManager ¶
type FileManager struct{}
FileManager provides secure file operations
func NewFileManager ¶
func NewFileManager() *FileManager
NewFileManager creates a new FileManager instance
func (*FileManager) Copy ¶
func (fm *FileManager) Copy(src, dst string) error
Copy safely copies a file from src to dst with validation
func (*FileManager) Exists ¶
func (fm *FileManager) Exists(path string) (bool, error)
Exists checks if a path exists
func (*FileManager) IsDir ¶
func (fm *FileManager) IsDir(path string) (bool, error)
IsDir checks if a path is a directory
func (*FileManager) Move ¶
func (fm *FileManager) Move(src, dst string) error
Move safely moves a file from src to dst
func (*FileManager) Remove ¶
func (fm *FileManager) Remove(path string) error
Remove safely removes a file or directory