Module

Pathy.Sandboxed

#SandboxedPath

data SandboxedPath a b

The type for paths that have been sandboxed.

Instances

#sandbox

sandbox :: forall a b. IsRelOrAbs a => Path Abs Dir -> Path a b -> Maybe (SandboxedPath a b)

Attempts to sandbox a path relative to an absolute directory ("sandbox root"). If the Path a b escapes the sandbox root Nothing will be returned.

#sandboxAny

sandboxAny :: forall a b. Path a b -> SandboxedPath a b

Sandboxes any path to /.

This should only be used for situations where a path is already constrained within a system so that access to / is safe - for instance, in URIs.

#sandboxRoot

sandboxRoot :: forall a b. SandboxedPath a b -> Path Abs Dir

Returns the location a SandboxedPath was sandboxed to.

#unsandbox

unsandbox :: forall a b. SandboxedPath a b -> Path a b

Extracts the original path from a SandboxedPath.

Modules