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

@veramo/did-jwt

Package Overview
Dependencies
Maintainers
4
Versions
574
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@veramo/did-jwt - npm Package Compare versions

Comparing version 1.1.1-next.16 to 1.1.1-next.17

12

package.json
{
"name": "@veramo/did-jwt",
"description": "Veramo message validator plugin for decoding and verifying JWT payloads.",
"version": "1.1.1-next.16+6f588615",
"version": "1.1.1-next.17+9712db0e",
"main": "build/index.js",

@@ -12,7 +12,7 @@ "types": "build/index.d.ts",

"dependencies": {
"@veramo/core": "^1.1.1-next.16+6f588615",
"@veramo/message-handler": "^1.1.1-next.16+6f588615",
"@veramo/core": "^1.1.1-next.17+9712db0e",
"@veramo/message-handler": "^1.1.1-next.17+9712db0e",
"debug": "^4.1.1",
"did-jwt": "4.8.1",
"did-resolver": "2.1.2"
"did-jwt": "5.1.2",
"did-resolver": "3.1.0"
},

@@ -42,3 +42,3 @@ "devDependencies": {

"keywords": [],
"gitHead": "6f5886157aaaf4357f0e606bd6bff55ea6a0b4cf"
"gitHead": "9712db0eea1a3f48cf0665d66ae715ea0c23cd4a"
}

@@ -1,2 +0,2 @@

import { DIDDocument } from '@veramo/core'
import { DIDResolutionResult } from '@veramo/core'
import { Message } from '@veramo/message-handler'

@@ -15,17 +15,21 @@ import { JwtMessageHandler, IContext } from '../message-handler'

emit: jest.fn(),
resolveDid: async (args?): Promise<DIDDocument> => {
resolveDid: async (args?): Promise<DIDResolutionResult> => {
if (!args?.didUrl) throw Error('DID required')
return {
'@context': 'https://w3id.org/did/v1',
id: 'did:key:z6MkoTHsgNNrby8JzCNQ1iRLyW5QQ6R8Xuu6AA8igGrMVPUM',
publicKey: [
{
id:
'did:key:z6MkoTHsgNNrby8JzCNQ1iRLyW5QQ6R8Xuu6AA8igGrMVPUM#z6MkoTHsgNNrby8JzCNQ1iRLyW5QQ6R8Xuu6AA8igGrMVPUM',
type: 'Ed25519VerificationKey2018',
controller: 'did:key:z6MkoTHsgNNrby8JzCNQ1iRLyW5QQ6R8Xuu6AA8igGrMVPUM',
publicKeyBase58: 'A12q688RGRdqshXhL9TW8QXQaX9H82ejU9DnqztLaAgy',
},
],
didDocumentMetadata: {},
didResolutionMetadata: {},
didDocument: {
'@context': 'https://w3id.org/did/v1',
id: 'did:key:z6MkoTHsgNNrby8JzCNQ1iRLyW5QQ6R8Xuu6AA8igGrMVPUM',
publicKey: [
{
id:
'did:key:z6MkoTHsgNNrby8JzCNQ1iRLyW5QQ6R8Xuu6AA8igGrMVPUM#z6MkoTHsgNNrby8JzCNQ1iRLyW5QQ6R8Xuu6AA8igGrMVPUM',
type: 'Ed25519VerificationKey2018',
controller: 'did:key:z6MkoTHsgNNrby8JzCNQ1iRLyW5QQ6R8Xuu6AA8igGrMVPUM',
publicKeyBase58: 'A12q688RGRdqshXhL9TW8QXQaX9H82ejU9DnqztLaAgy',
},
],
},
}

@@ -32,0 +36,0 @@ },

@@ -1,2 +0,2 @@

import { DIDDocument } from '@veramo/core'
import { DIDDocument, DIDResolutionResult } from '@veramo/core'
import { Message } from '@veramo/message-handler'

@@ -62,22 +62,21 @@ import { JwtMessageHandler, IContext } from '../message-handler'

emit: jest.fn(),
resolveDid: async (args?): Promise<DIDDocument> => {
resolveDid: async (args?): Promise<DIDResolutionResult> => {
if (!args?.didUrl) throw Error('DID required')
return {
'@context': 'https://w3id.org/did/v1',
id: args?.didUrl,
publicKey: [
{
id: `${args?.didUrl}#owner`,
type: 'Secp256k1VerificationKey2018',
controller: args?.didUrl,
ethereumAddress: args?.didUrl.slice(-42),
},
],
authentication: [
{
type: 'Secp256k1SignatureAuthentication2018',
publicKey: `${args?.didUrl}#owner`,
},
],
didResolutionMetadata: {},
didDocumentMetadata: {},
didDocument: {
'@context': 'https://w3id.org/did/v1',
id: args?.didUrl,
verificationMethod: [
{
id: `${args?.didUrl}#owner`,
type: 'EcdsaSecp256k1RecoveryMethod2020',
controller: args?.didUrl,
blockchainAccountId: `${args?.didUrl.slice(-42)}@eip155:1`,
},
],
authentication: [`${args?.didUrl}#owner`],
},
}

@@ -84,0 +83,0 @@ },

@@ -5,2 +5,3 @@ import { IAgentContext, IResolver } from '@veramo/core'

import Debug from 'debug'
import { Resolvable } from 'did-resolver'
const debug = Debug('veramo:did-jwt:message-handler')

@@ -20,3 +21,3 @@

const audience = Array.isArray(decoded.payload.aud) ? decoded.payload.aud[0] : decoded.payload.aud
const resolver = { resolve: (didUrl: string) => context.agent.resolveDid({ didUrl }) }
const resolver = { resolve: (didUrl: string) => context.agent.resolveDid({ didUrl }) } as Resolvable
const verified = await verifyJWT(message.raw, { resolver, audience })

@@ -23,0 +24,0 @@ debug('Message.raw is a valid JWT')

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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