@veramo/did-jwt
Advanced tools
Comparing version 1.1.1-next.16 to 1.1.1-next.17
{ | ||
"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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
32579
350
+ Addeddid-jwt@5.1.2(transitive)
+ Addeddid-resolver@3.1.0(transitive)
- Removed@babel/runtime@7.26.9(transitive)
- Removedbech32@2.0.0(transitive)
- Removedcanonicalize@1.0.8(transitive)
- Removeddid-jwt@4.8.15.12.4(transitive)
- Removeddid-resolver@2.1.23.2.2(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removeduint8arrays@3.1.1(transitive)
Updateddid-jwt@5.1.2
Updateddid-resolver@3.1.0