pub enum WebvhPathMode {
WellKnown,
Explicit(String),
AutoAssign,
}Expand description
How the <path> segment of a server-managed did:webvh is chosen.
Only meaningful when a hosting server is selected (server_id is
set). A serverless DID always resolves at
<host>/.well-known/did.jsonl and ignores this — serverless mode is
selected by the absence of server_id, not by this enum. The three
variants map onto the hosting server’s check-name / create_did
path contract:
WebvhPathMode::WellKnown→ the reserved.well-knownroot slot (<host>/.well-known/did.jsonl). Admin-gated on the host.WebvhPathMode::Explicit→ an operator-chosen label (<host>/<path>/did.jsonl).WebvhPathMode::AutoAssign→ the host allocates a path (it mints a fresh mnemonic). This is the default.
AutoAssign is the default because that is the long-standing
“no path given → the server assigns one” contract: the setup wizard’s
“leave blank → server-assigned” prompt maps a blank path here. An
absent path has never meant the .well-known root on a hosting
server — that is the serverless case (selected by the absence of a
server_id, where the DID location comes from the URL itself).
Variants§
WellKnown
Root DID at the host: resolves at <host>/.well-known/did.jsonl.
Explicit(String)
Operator-chosen path label: <host>/<path>/did.jsonl.
AutoAssign
Let the hosting server allocate the path.
Implementations§
Source§impl WebvhPathMode
impl WebvhPathMode
Sourcepub fn to_request_path(&self) -> Option<&str>
pub fn to_request_path(&self) -> Option<&str>
The path string to hand the hosting server’s check-name /
create_did call. Some(".well-known") / Some(label) reserve a
specific slot; None tells the host to allocate one (the
auto-assign contract — the host mints a mnemonic).
Returning None for AutoAssign is
load-bearing: the DIDComm/REST clients must omit the path wire
field for auto-assign. Sending an empty string instead makes the
host reject it with e.p.did.path-invalid (“path must not be
empty”), since the host validates a present-but-empty path.
Sourcepub fn resolve(
path_mode: Option<WebvhPathMode>,
legacy_path: Option<String>,
) -> Self
pub fn resolve( path_mode: Option<WebvhPathMode>, legacy_path: Option<String>, ) -> Self
Resolve the effective mode from the new explicit path_mode field
and the legacy path: Option<String> field. path_mode wins when
present; otherwise the legacy path is interpreted (via
From<Option<String>>) so pre-enum callers keep working.
Trait Implementations§
Source§impl Clone for WebvhPathMode
impl Clone for WebvhPathMode
Source§fn clone(&self) -> WebvhPathMode
fn clone(&self) -> WebvhPathMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more