Documentation
¶
Index ¶
- func CanonicalizeExistingDirAbs(path string) (string, error)
- func CanonicalizeExistingPathAbs(path string) (string, error)
- func IsWithinScope(pathAbs string, agentHomeAbs string) (bool, error)
- func NormalizeUserPathInput(path string, agentHomeAbs string) (string, error)
- func ResolveExistingScopedDir(path string, agentHomeAbs string) (string, error)
- func ResolveExistingScopedPath(path string, agentHomeAbs string) (string, error)
- func ResolveTargetScopedPath(path string, agentHomeAbs string) (string, error)
- type PathScope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalizeExistingDirAbs ¶
CanonicalizeExistingDirAbs returns a clean absolute path for an existing directory.
func CanonicalizeExistingPathAbs ¶
CanonicalizeExistingPathAbs returns a clean absolute path for an existing filesystem entry.
func IsWithinScope ¶
IsWithinScope reports whether pathAbs stays inside agentHomeAbs.
func NormalizeUserPathInput ¶
NormalizeUserPathInput expands "~/" against agentHomeAbs and requires an absolute path.
func ResolveExistingScopedDir ¶
ResolveExistingScopedDir validates an existing directory under agentHomeAbs.
func ResolveExistingScopedPath ¶
ResolveExistingScopedPath validates an existing path under agentHomeAbs.
func ResolveTargetScopedPath ¶
ResolveTargetScopedPath validates a destination path under agentHomeAbs.
The destination itself may not exist yet, so the nearest existing ancestor is canonicalized first to prevent symlink escapes.
Types ¶
type PathScope ¶
PathScope captures the nested filesystem boundaries for a single Flower run.
func NewPathScope ¶
NewPathScope canonicalizes the runtime home and project root and enforces that the project root stays inside the runtime home boundary.
func (PathScope) ResolveExistingDir ¶
ResolveExistingDir validates an existing directory inside both the runtime home and project root.
func (PathScope) ResolveExistingPath ¶
ResolveExistingPath validates an existing path inside both the runtime home and project root.