uport-connect
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "uport-connect", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Library for integrating uPort into your app frontend", | ||
@@ -113,3 +113,3 @@ "main": "lib/index.js", | ||
"store": "^2.0.12", | ||
"uport-credentials": "^1.0.0-alpha-4", | ||
"uport-credentials": "^1.0.2", | ||
"uport-did-resolver": "0.0.3", | ||
@@ -116,0 +116,0 @@ "uport-lite": "^1.0.2", |
@@ -293,11 +293,19 @@ import { Credentials, ContractFactory } from 'uport-credentials' | ||
* @param {Object} unsignedClaim unsigned claim object which you want the user to attest | ||
* @param {String} sub the DID which the unsigned claim is about | ||
* @param {Object} opts an object containing options for the signature request, including the subject | ||
* @param {String} opts.sub the DID which the unsigned claim is about | ||
* @param {Number} [opts.expiresIn] seconds after current time when the requested verifiable claim will expire | ||
* @param {String} [id='signVerReq'] string to identify request, later used to get response | ||
* @param {Object} [sendOpts] reference send function options | ||
* @param {Object} [sendOpts] @see this.send function options | ||
*/ | ||
requestVerificationSignature (unsignedClaim, sub, id = 'verSigReq', sendOpts) { | ||
this.credentials.createVerificationSignatureRequest(unsignedClaim, {sub, aud: this.did, callbackUrl: this.genCallback(id)}) | ||
requestVerificationSignature (unsignedClaim, opts, id = 'verSigReq', sendOpts) { | ||
if (typeof opts === 'string') { | ||
console.warn('The subject argument is deprecated, use option object with {sub: sub, ...}') | ||
opts = {sub: opts} | ||
} else if (!opts || !opts.sub) { | ||
throw new Error(`Missing required field sub in opts. Received: ${opts}`) | ||
} | ||
this.credentials.createVerificationSignatureRequest(unsignedClaim, {...opts, aud: this.did, callbackUrl: this.genCallback(id)}) | ||
.then(jwt => this.send(jwt, id, sendOpts)) | ||
} | ||
/** | ||
@@ -304,0 +312,0 @@ * Creates a [Selective Disclosure Request JWT](https://github.com/uport-project/specs/blob/develop/messages/sharereq.md) and sends request message to uPort client. |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3443603
20830
Updateduport-credentials@^1.0.2