did-web and (crate features did-jwk or did-key or did-web) only.Expand description
did:web: a DID document served over HTTPS by a web origin.
The did:web method maps a DID to the URL of its document: did:web:example.com is served
at https://example.com/.well-known/did.json, and did:web:example.com%3A8443:user:alice
at https://example.com:8443/user/alice/did.json (a port is percent-encoded as %3A, path
segments are separated by :). document_url implements that mapping and
did_from_url its inverse. The document is fetched through an HttpClient the caller
injects; ReqwestClient (feature reqwest) is a hardened default that speaks HTTPS only,
follows no redirect, refuses non-public addresses and caps the response size.
The method is updated by republishing the document and deactivated by removing it; neither
has an API, so DidWeb as a DidProducer builds the document to publish and nothing
more.
Structs§
- DidWeb
- The
did:webmethod: aDidResolverfetching documents through anHttpClient, and aDidProducerbuilding the document to publish. - Http
Error - Why an
HttpClientcould not get a response. - Http
Response - An HTTP response: the status code, the body and, for a redirect, its target.
- Local
Network local-network - The local address ranges a
ReqwestClientmay reach besides the public internet. - Reqwest
Client reqwest - An
HttpClientoverreqwesthardened for fetching DID documents from the public web. - Reqwest
Client Builder local-network - Builds a
ReqwestClientthat may also reach the local network, for development and tests; see Local development and tests.
Enums§
- WebError
- Why a URL has no
did:web, or adid:webno document URL.
Constants§
Traits§
- Http
Client - What
DidWebneeds from HTTP: aGETof a URL.
Functions§
- did_
from_ origin - The
did:webof the origin ofurl: asdid_from_url, but the URL must have no path. - did_
from_ url - The
did:webwhose document lives underurl:https://example.comgivesdid:web:example.com,https://example.com:8443/user/alicegivesdid:web:example.com%3A8443:user:alice. - document_
url - The URL of the document of
did(the Read operation’s URL construction):https://host[:port]/.well-known/did.jsonfor a bare domain, elsehttps://host[:port]/<segments>/did.json.