Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Feb 2, 2024
2 parents 0bf7ba0 + 399c154 commit 378e95b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/evaluation/evaluationClientWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,10 +431,14 @@ export class EvaluationClientWrapper {
if (descriptor.path_nested) {
return descriptor;
}
// sd-jwt doesn't use path_nested and format is the same for vc or vp
else if (descriptor.format === 'vc+sd-jwt') {
return descriptor;
}

const format = descriptor.format;
const nestedDescriptor = { ...descriptor };
nestedDescriptor.path_nested = { ...descriptor };
// todo: delete id?
nestedDescriptor.path = '$';
// todo: We really should also look at the context of the VP, to determine whether it is jwt_vp vs jwt_vp_json instead of relying on the VC type
if (format.startsWith('ldp_')) {
Expand Down
6 changes: 5 additions & 1 deletion test/SdJwt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,13 @@ describe('evaluate', () => {
).toString('base64url')}.signature`;
return `${presentation.compactSdJwtVc}${kbJwt}`;
},
{},
{
presentationSubmissionLocation: PresentationSubmissionLocation.EXTERNAL,
},
);

// path_nested should not be used for sd-jwt
expect(presentationResult.presentationSubmission.descriptor_map[0].path_nested).toBeUndefined();
expect(presentationResult.presentationSubmission).toEqual({
definition_id: '32f54163-7166-48f1-93d8-ff217bdb0653',
descriptor_map: [
Expand Down

0 comments on commit 378e95b

Please sign in to comment.