Saltar al contenido principal
Esta página no tiene versión en español, así que te la mostramos en inglés.

inji@1.0.0

request(method, path, body, [options])
verify(credential, [options])

This adaptor exports the following from common:

as()
combine()
cursor()
dataPath()
dataValue()
dateFns
each()
field()
fields()
fn()
fnIf()
group()
lastReferenceValue()
map()
merge()
scrubEmojis()
sourceValue()
util

Functions​

request​

request(method, path, body, [options]) ⇒ Operation

Make a general HTTP request to Inji Verify. Prefer verify for VC verification.

ParamTypeDefaultDescription
methodstringHTTP method to use
pathstringPath relative to configuration.baseUrl
bodyobjectObject attached to the request body
[options]RequestOptions{}Optional request options

This operation writes the following keys to state:

State KeyDescription
datathe parsed response body
responsethe response from the HTTP server, including headers, statusCode, etc
referencesan array of all previous data objects used in the Job

Example

request('POST', 'v2/vc-verification', {
verifiableCredential: JSON.stringify($.data),
skipStatusChecks: false,
statusCheckFilters: ['revocation'],
includeClaims: false,
});

verify​

verify(credential, [options]) ⇒ Operation

Verify a Verifiable Credential with Inji Verify (V2).

Posts to {baseUrl}/v2/vc-verification. Configure baseUrl with the service context path, e.g. https://verify.example.org/v1/verify.

ParamTypeDefaultDescription
credentialobject | stringJSON-LD object, SD-JWT string, or CWT hex string
[options]VerifyOptions{}Verification options

This operation writes the following keys to state:

State KeyDescription
datathe parsed response body
responsethe response from the HTTP server, including headers, statusCode, etc
referencesan array of all previous data objects used in the Job

Example: Verify a credential from state

verify($.data, {
skipStatusChecks: false,
statusCheckFilters: ['revocation'],
includeClaims: false,
});

Interfaces​

HttpState​

State object after an Inji Verify HTTP call

Properties

NameDescription
datathe parsed response body
responsethe response from the HTTP server, including headers, statusCode, etc
referencesan array of all previous data objects used in the Job

RequestOptions​

Options provided to a general HTTP request

Properties

NameTypeDescription
bodyobject | stringbody data to append to the request
errorsobjectMap of errorCodes -> error messages
queryobjectAn object of query parameters to be encoded into the URL
headersobjectAn object of headers to append to the request
parseAsstringParse the response body as json, text or stream
timeoutnumberRequest timeout in ms. Default: 300 seconds

VerifyOptions​

Options for verify

Properties

NameTypeDefaultDescription
[skipStatusChecks]booleanfalseSkip credential status (e.g. revocation) checks
[statusCheckFilters]Array.<string>[]Status check purposes to run (e.g. ['revocation'])
[includeClaims]booleanfalseInclude extracted claims when schema/signature is valid