Skip to main content

Module multitenant

Module multitenant 

Source
Expand description

Pod resolution from request host (Sprint 7 §6.3, ADR-057).

JSS parity: src/utils/url.js::urlToPathWithPod and the subdomainsEnabled && podName branch in getPathFromRequest. We lift the policy (“which pod owns this request?”) out of the URL-to-filesystem mapper so that call sites (LDP, WAC, quota) can consult it uniformly without each re-parsing the Host header.

§Model

  • PathResolver — default single-tenant behaviour. The URL path is the storage path verbatim and pod is None.
  • SubdomainResolver<pod>.<base_domain> maps the first label to a pod identifier; bare <base_domain> returns the root pod (pod: None). Anything else (unknown subdomain tree) falls back to path-based semantics.

§Security

Pod labels are scrubbed of .. sequences with the same double-pass algorithm JSS uses in urlToPathWithPod (.. is replaced until the string stops changing, defeating the ....// bypass). Any resulting empty or path-containing label is rejected by falling back to path mode with pod: None.

Structs§

PathResolver
Single-tenant / path-based resolver. Equivalent to JSS’s subdomainsEnabled=false mode: the URL path is the storage path and there is no notion of a per-host pod.
ResolvedPath
Result of resolving a request to a pod + storage path.
SubdomainResolver
Subdomain-based resolver. Matches hosts of the form <pod>.<base_domain> and yields pod = Some(<pod>). The bare base domain yields pod = None (root pod). Hosts outside the base domain tree fall back to path-based semantics.

Traits§

PodResolver
Policy that maps (host, url_path) onto a ResolvedPath.

Functions§

is_file_like_label
Sprint 11 (row 125/162, JSS PR #307 6d43e66): return true when the hostname label looks like a filename that should be served from the base apex rather than promoted to a pod subdomain.