New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

uport

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uport - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

19

lib/Credentials.js

@@ -61,2 +61,5 @@ 'use strict';

}
if (params.verified) {
payload.verified = params.verified;
}
if (params.notifications) {

@@ -76,2 +79,4 @@ payload.permissions = ['notifications'];

value: function receive(token) {
var _this2 = this;
var callbackUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;

@@ -82,3 +87,15 @@

profile = _ref.profile;
return _extends({}, profile, payload.own || {}, payload.capabilities && payload.capabilities.length === 1 ? { pushToken: payload.capabilities[0] } : {}, { address: payload.iss });
var credentials = _extends({}, profile, payload.own || {}, payload.capabilities && payload.capabilities.length === 1 ? { pushToken: payload.capabilities[0] } : {}, { address: payload.iss });
if (payload.verified) {
return Promise.all(payload.verified.map(function (token) {
return (0, _JWT.verifyJWT)(_this2.settings, token);
})).then(function (verified) {
return _extends({}, credentials, { verified: verified.map(function (v) {
return _extends({}, v.payload, { jwt: v.jwt });
}) });
});
} else {
return credentials;
}
});

@@ -85,0 +102,0 @@ }

2

lib/JWT.js

@@ -65,3 +65,3 @@ 'use strict';

}
resolve({ payload: payload, profile: profile });
resolve({ payload: payload, profile: profile, jwt: jwt });
} else {

@@ -68,0 +68,0 @@ return reject(new Error('Signature invalid for JWT'));

{
"name": "uport",
"version": "0.3.2",
"version": "0.3.3",
"description": "Library for interacting with uport profiles and attestations",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -25,2 +25,5 @@ import { createJWT, verifyJWT } from './JWT'

}
if (params.verified) {
payload.verified = params.verified
}
if (params.notifications) {

@@ -37,5 +40,12 @@ payload.permissions = ['notifications']

receive (token, callbackUrl = null) {
return verifyJWT(this.settings, token, callbackUrl).then(({payload, profile}) => (
{...profile, ...(payload.own || {}), ...(payload.capabilities && payload.capabilities.length === 1 ? {pushToken: payload.capabilities[0]} : {}), address: payload.iss}
))
return verifyJWT(this.settings, token, callbackUrl).then(({payload, profile}) => {
const credentials = {...profile, ...(payload.own || {}), ...(payload.capabilities && payload.capabilities.length === 1 ? {pushToken: payload.capabilities[0]} : {}), address: payload.iss}
if (payload.verified) {
return Promise.all(payload.verified.map(token => verifyJWT(this.settings, token))).then(verified => {
return {...credentials, verified: verified.map(v => ({...v.payload, jwt: v.jwt}))}
})
} else {
return credentials
}
})
}

@@ -42,0 +52,0 @@

@@ -49,3 +49,3 @@ import { createUnsignedToken, TokenVerifier, decodeToken } from 'jsontokens'

}
resolve({payload, profile})
resolve({payload, profile, jwt})
} else {

@@ -57,1 +57,2 @@ return reject(new Error('Signature invalid for JWT'))

}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc