Skip to main content

Module proof

Module proof 

Source
Expand description

Who a caller is, before anything is created for them.

One verifier, three shapes (Proof): a session this server issued, a JWT signed by a key in the caller’s credential records, and an OpenID Connect token (see this module’s oidc sibling). createAccount and createSession both reach it through prove, naming the account the credential is for (Named).

StructsΒ§

KeyJwt πŸ”’
A key-signed JWT that checks out, not yet spent.
Named πŸ”’
The account a request says its credential is for.
Replay
Proofs already spent, each until its own expiry.

EnumsΒ§

NamedBy πŸ”’
Which field of a request names the account its credential is for.
NotSpent
Why a proof could not be spent.
Proof
What a credential on the tree’s routes resolved to.

ConstantsΒ§

MAX_NAMED_DID_BYTES πŸ”’
The longest did or parent the lexicons allow.
MAX_PROOF_LIFETIME
The furthest into the future a proof’s exp may sit.

FunctionsΒ§

account_keys πŸ”’
The multibase keys did’s credential records hold.
account_mismatch πŸ”’
A credential for one account, sent with a request naming another.
check_named πŸ”’
Refuses a named account that is not a DID, before it reaches a comparison or a lookup.
decode_jwt πŸ”’
A JWT’s header and claims, decoded but not verified.
fetch_json πŸ”’
GET of a small JSON body from a URL this server chose to reach.
invalid_proof πŸ”’
not_the_operator πŸ”’
Refuses a DID that is neither hosted here nor the operator this deployment was launched naming, before anything is fetched for it.
prove πŸ”’
Resolves the Authorization header on a tree route into what it proves.
prove_by_key πŸ”’
Verifies a JWT whose iss is a DID: signed by a key the DID logs in with, for this server, for lxm, unexpired and unspent. The DID must be hosted here, and its keys are its credential records.
segment πŸ”’
One segment of a compact JWS, decoded.
spend πŸ”’
Spends a proof, naming why it could not be.
split_jwt πŸ”’
A JWT’s three parts, split but not decoded.
verify_key_jwt πŸ”’
Checks a JWT whose iss is iss against keys: for this server, for lxm, exp in the future and at most MAX_PROOF_LIFETIME away, a jti of a bounded length, and signed by one of keys.
verify_with_keys πŸ”’
Verifies signing_input’s signature against every multibase key in keys on the curve alg names, answering the key that verified it.