Skip to content

Commit

Permalink
docs(changeset): add support for intent_to_retain for mso_mdoc cl…
Browse files Browse the repository at this point in the history
…aims query

Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Feb 12, 2025
1 parent c3bb052 commit 95526ca
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/clean-countries-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"dcql": patch
---

add support for `intent_to_retain` for `mso_mdoc` claims query
9 changes: 7 additions & 2 deletions dcql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ const query = {
format: 'mso_mdoc',
meta: { doctype_value: 'org.iso.7367.1.mVRC' },
claims: [
{ path: ['org.iso.7367.1', 'vehicle_holder'] },
{ path: ['org.iso.18013.5.1', 'first_name'] },
{
path: ['org.iso.7367.1', 'vehicle_holder'],
intent_to_reatin: true
},
{
path: ['org.iso.18013.5.1', 'first_name']
},
],
}]
};
Expand Down
4 changes: 4 additions & 0 deletions dcql/src/dcql-query/dcql-query-complex.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ const complexMdocQuery = {
{
id: 'resident_address',
path: ['org.iso.18013.5.1', 'resident_address'],
intent_to_retain: false,
},
{
id: 'resident_country',
path: ['org.iso.18013.5.1', 'resident_country'],
intent_to_retain: true,
},
],
},
Expand Down Expand Up @@ -2992,10 +2994,12 @@ describe('complex-mdoc-query', () => {
{
id: 'resident_address',
path: ['org.iso.18013.5.1', 'resident_address'],
intent_to_retain: false,
},
{
id: 'resident_country',
path: ['org.iso.18013.5.1', 'resident_country'],
intent_to_retain: true,
},
],
meta: {
Expand Down
5 changes: 4 additions & 1 deletion dcql/src/dcql-query/dcql-query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const mdocMvrcQuery = {
id: 'my_credential',
format: 'mso_mdoc' as const,
meta: { doctype_value: 'org.iso.7367.1.mVRC' },
claims: [{ path: ['org.iso.7367.1', 'vehicle_holder'] }, { path: ['org.iso.18013.5.1', 'first_name'] }],
claims: [
{ path: ['org.iso.7367.1', 'vehicle_holder'], intent_to_retain: false },
{ path: ['org.iso.18013.5.1', 'first_name'], intent_to_retain: true },
],
},
],
} satisfies DcqlQuery
Expand Down
7 changes: 7 additions & 0 deletions dcql/src/dcql-query/m-dcql-claims-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ export namespace DcqlClaimsQuery {
export const vMdocPath = v.object({
...vMdocBase.entries,

intent_to_retain: v.pipe(
v.optional(v.boolean()),
v.description(
'A boolean that is equivalent to `IntentToRetain` variable defined in Section 8.3.2.1.2.1 of [@ISO.18013-5].'
)
),

path: v.pipe(
v.tuple([
v.pipe(
Expand Down

0 comments on commit 95526ca

Please sign in to comment.