Expand description
Path translation: storage (“real”) paths vs. client-visible shadow paths.
Some deployments do not want real storage layout (directory names,
hierarchy, naming habits) to reach the client. A PathCodec converts
between the two sides:
encode: real → shadow (outbound; response bodies, listings, upload echoes).decode: shadow → real (inbound; request URLs).
Codecs operate on canonical relative paths (what the server’s
validate_rel_path produces): no leading /, no ./.., no empty
segments. The root is "".
Authorization is unaffected by translation: the server validates the
real path against allowed_paths (see the resolve_client_path
helper in libfw-server), so claims always apply to the real path.
Hierarchical composition: resolve_client_path also accepts a
shadow with literal child segments appended ({dirShadow}/sub/file):
it decodes the longest decodable segment prefix and appends the
remainder verbatim, then authorizes the combined real path — a
directory shadow covers its whole subtree, with no per-path shadow
minting. Whole-string codecs such as EncryptedPathCodec get this
for free; prefix codecs like MountPathCodec already behave that
way natively.
§Codecs
| Codec | Shadow looks like | Use when |
|---|---|---|
IdentityPathCodec | the real path | default; no translation |
EncryptedPathCodec | v1.<base64url> opaque blob | real paths must be hidden completely |
MountPathCodec | a readable alias (home/alice/…) | readable, stable shadow namespaces |
Structs§
- Encrypted
Path Codec - Encrypting codec: shadow paths are opaque
v1.<base64url>blobs. - Identity
Path Codec - The default codec: shadow paths are real paths. No translation.
- Mount
Path Codec - Prefix-mapping codec: readable shadow namespaces backed by real subtrees.
Enums§
- Path
Codec Error - Error decoding a client-supplied shadow path back to a real path.
Traits§
- Path
Codec - Converts between real storage paths and client-visible shadow paths.