Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@arcblock/abt-did

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcblock/abt-did - npm Package Compare versions

Comparing version 0.15.0 to 0.15.1

18

lib/index.js

@@ -230,3 +230,3 @@ const upperFirst = require('lodash/upperFirst');

const header = headers[type.pk];
const headerB64 = base64.escape(base64.encode(JSON.stringify(header)));
const headerB64 = base64.escape(base64.encode(stringify(header)));

@@ -238,3 +238,3 @@ // make body

iss: did.indexOf(DID_PREFIX) === 0 ? did : `${DID_PREFIX}${did}`,
ist: timestamp,
iat: timestamp,
nbf: timestamp,

@@ -294,3 +294,3 @@ exp: timestamp + 30 * 60,

*/
const jwtVerify = (token, pk) => {
const jwtVerify = (token, pk, tolerance = 5) => {
try {

@@ -315,2 +315,13 @@ const [headerB64, bodyB64] = token.split('.');

const timestamp = Math.ceil(Date.now() / 1000) + tolerance;
if (body.exp && body.exp < timestamp) {
return false;
}
if (body.iat && body.iat > timestamp) {
return false;
}
if (body.nbf && body.nbf > timestamp) {
return false;
}
const signers = {

@@ -338,2 +349,3 @@ secp256k1: getSigner(types.KeyType.SECP256K1),

module.exports = {
DID_PREFIX,
types,

@@ -340,0 +352,0 @@ toStrictHex,

4

package.json
{
"name": "@arcblock/abt-did",
"version": "0.15.0",
"version": "0.15.1",
"description": "Javascript lib to work with ArcBlock DID",

@@ -50,3 +50,3 @@ "keywords": [

},
"gitHead": "4ef4154c785ba27f71f5af2d66e67270857b4750"
"gitHead": "d5527d87709d29ca624450e50128519cbb62a98d"
}
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