Skip to content

Commit

Permalink
Add VC-JWT-specific mappings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlongley committed Aug 8, 2024
1 parent dd089bf commit 3f66e67
Show file tree
Hide file tree
Showing 4 changed files with 443 additions and 86 deletions.
4 changes: 2 additions & 2 deletions lib/envelopes.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ export async function verifyEnvelopedCredential({envelopedCredential} = {}) {
}

export async function verifyEnvelopedPresentation({
envelopedPresentation
envelopedPresentation, challenge, domain
} = {}) {
try {
const {contents: jwt} = _parseEnvelope({
envelope: envelopedPresentation
});
return vcjwt.verifyEnvelopedPresentation({jwt});
return vcjwt.verifyEnvelopedPresentation({jwt, challenge, domain});
} catch(error) {
return {verified: false, error};
}
Expand Down
4 changes: 2 additions & 2 deletions lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ export async function addRoutes({app, service} = {}) {
}

// FIXME: do not set a default domain
const expectedDomain = presentation?.proof?.domain &&
(domain || 'issuer.example.com');
const expectedDomain = domain ??
(presentation?.proof?.domain && 'issuer.example.com');
const result = await verifyPresentation({
config, presentation, challenge, domain: expectedDomain, checks
});
Expand Down
Loading

0 comments on commit 3f66e67

Please sign in to comment.