Constructor
new Claim(uriopt, fingerprintopt)
Properties:
Name | Type | Description |
---|---|---|
uri |
string | The claim's URI |
fingerprint |
string | The fingerprint to verify the claim against |
status |
number | The current status code of the claim |
matches |
Array.<object> | The claim definitions matched against the URI |
Example
const claim = doip.Claim();
const claim = doip.Claim('dns:domain.tld?type=TXT');
const claim = doip.Claim('dns:domain.tld?type=TXT', '123abc123abc');
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
uri |
string |
<optional> |
The URI of the identity claim |
fingerprint |
string |
<optional> |
The fingerprint of the OpenPGP key |
Classes
Members
_fingerprint :string
Type:
- string
_matches :Array.<ServiceProvider>
Type:
- Array.<ServiceProvider>
_status :number
Type:
- number
_uri :string
Type:
- string
Methods
isAmbiguous() → {boolean}
- Description:
Determine the ambiguity of the claim. A claim is only unambiguous if any of the candidates is unambiguous. An ambiguous claim should never be displayed in an user interface when its result is negative.
- Source:
Returns:
Whether the claim is ambiguous
- Type
- boolean
match()
toJSON() → {object}
- Description:
Get a JSON representation of the Claim object. Useful when transferring data between instances/machines.
- Source:
Returns:
JSON reprentation of the claim
- Type
- object
(async) verify(optsopt)
- Description:
Verify the claim. The proof for each candidate is sequentially fetched and checked for the fingerprint. The verification stops when either a positive result was obtained, or an unambiguous claim definition was processed regardless of the result.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
opts |
module:types~VerificationConfig |
<optional> |
Options for proxy, fetchers |
(static) fromJSON(claimObject) → {Claim}
Example
doip.Claim.fromJSON(JSON.stringify(claim));
Parameters:
Name | Type | Description |
---|---|---|
claimObject |
* | JSON representation of a claim |
Throws:
Will throw an error if the JSON object can't be coerced into a Claim
Returns:
Parsed claim
- Type
- Claim