Skip to main content

parse_did_document

Function parse_did_document 

Source
pub fn parse_did_document(
    did: &str,
    url: &str,
    body: &str,
) -> Result<DidDocument, ResolveError>
Expand description

Parses body as did’s document, checking its id against what was asked for.

Every caller fetches the body its own way and then comes here, so the parse and the id check are one piece of code rather than a second, drifting copy of them. The spec is blunt about that check: a document that claims to be a different account is, for did:web, whatever the host chose to serve.