doipjs/docs/api.md

43 lines
1.6 KiB
Markdown
Raw Normal View History

2020-11-05 15:28:56 -07:00
# API
## verify
2020-11-07 18:05:34 -07:00
_(async)_ doip.verify(uri, [fingerprint], [opts])
2020-11-05 15:28:56 -07:00
Verifies the identity behind the provided **uri** using the **fingerprint**.
**Parameters**
2020-11-05 19:39:36 -07:00
| Name | Type | Mandatory | Description |
2020-11-07 18:05:34 -07:00
| ----------- | ------ | --------- | -------------------------------- |
2020-11-05 19:39:36 -07:00
| uri | string | true | the URI to an identity to verify |
| fingerprint | string | false | the fingerprint of the claim |
| opts | object | false | options (see below) |
2020-11-05 15:28:56 -07:00
**Options**
2020-11-05 19:39:36 -07:00
| Name | Type | Default value | Description |
2020-11-07 18:05:34 -07:00
| ----------------- | ------- | -------------------- | ------------------------------------------------------------------- |
2020-11-05 19:39:36 -07:00
| returnMatchesOnly | boolean | false | only return matching service providers, do not attempt verification |
| proxyPolicy | string | 'adaptive' | when to use a proxy ['adaptive', 'always', 'never'] |
| doipProxyHostname | string | 'proxy.keyoxide.org' | the hostname of the proxy server |
When the `proxyPolicy` option is to `adaptive`, the chosen strategy is
the one suggested by the service provider.
2020-11-05 15:28:56 -07:00
**Returns**
2020-11-05 19:39:36 -07:00
An object with the results of the identity claim verification containing a
boolean named `isVerified` and a [serviceproviderData](serviceproviderdataobject.md#service-provider-data-object)
object.
```json
{
"isVerified": true,
"serviceproviderData": { ... }
}
```
If `opts.returnMatchesOnly` is `true`, this function instead returns a list of
service providers matched to the provided `uri`.