Skip to main content

Module pathmap

Module pathmap 

Source
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 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 token semantics stay exactly as before.

§Codecs

CodecShadow looks likeUse when
IdentityPathCodecthe real pathdefault; no translation
[EncryptedPathCodec]v1.<base64url> opaque blobreal paths must be hidden completely
MountPathCodeca readable alias (home/alice/…)readable, stable shadow namespaces

Structs§

IdentityPathCodec
The default codec: shadow paths are real paths. No translation.
MountPathCodec
Prefix-mapping codec: readable shadow namespaces backed by real subtrees.

Enums§

PathCodecError
Error decoding a client-supplied shadow path back to a real path.

Traits§

PathCodec
Converts between real storage paths and client-visible shadow paths.