| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Server.Path
Description
Artifact names and URL-component encoding shared by ecosystem routers. Ecluse.Core.Text owns the component gate also used by outbound metadata.
Synopsis
- data Filename
- mkFilename :: Text -> Maybe Filename
- unFilename :: Filename -> Text
- isSafeComponent :: Text -> Bool
- encodeComponent :: Text -> Text
The artifact name
An artifact's on-the-wire file name, verbatim and safe to interpolate: it cleared
isSafeComponent. The upstream path uses this exact name, never one rebuilt from the version.
mkFilename :: Text -> Maybe Filename Source #
Read a filename from untrusted text, Nothing when it is not a safe path component. Every
boundary that admits one (a route capture, a queue payload) parses through this single gate.
unFilename :: Filename -> Text Source #
The verbatim name, for interpolation into an upstream URL through encodeComponent.
Component safety
isSafeComponent :: Text -> Bool Source #
Refuse empty components, traversal, separators, and controls. Callers must still percent-encode on URL construction.
encodeComponent :: Text -> Text Source #
Encode a decoded component using only RFC 3986 unreserved bytes verbatim.
Encoding is not idempotent: a literal percent sign becomes %25.