Skip to content

Commit

Permalink
Merge pull request #184 from TimoGlastra/feat/extra-stuff
Browse files Browse the repository at this point in the history
fix: support generating submission for mdoc
  • Loading branch information
sanderPostma authored Oct 31, 2024
2 parents 20669be + 21b664b commit 0b9c601
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/utils/formatMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ const vcVpFormatMap = {
ldp_vc: 'ldp_vp',
jwt_vc: 'jwt_vp',
'vc+sd-jwt': 'vc+sd-jwt',
mso_mdoc: 'mso_mdoc',
} as const;
25 changes: 25 additions & 0 deletions test/Mdoc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,31 @@ describe('evaluate mdoc', () => {
});
});

it('evaluatePresentation with mso_mdoc format generating a submission', async () => {
const presentationDefinition = getPresentationDefinitionV2();
const evaluateResults = pex.evaluatePresentation(presentationDefinition, [mdocBase64UrlUniversityPresentation], {
generatePresentationSubmission: true,
});

expect(evaluateResults).toEqual({
presentations: [mdocBase64UrlUniversityPresentation],
areRequiredCredentialsPresent: Status.INFO,
warnings: [],
errors: [],
value: {
definition_id: presentationDefinition.id,
descriptor_map: [
{
format: 'mso_mdoc',
id: 'org.eu.university',
path: '$[0]',
},
],
id: expect.any(String),
},
});
});

it('evaluatePresentation with both mso_mdoc and vc+sd-jwt format', async () => {
const presentationDefinition = getPresentationDefinitionV2(true);
const submission = {
Expand Down

0 comments on commit 0b9c601

Please sign in to comment.