auth0-lab / mdl

Parse and validate MDOC CBOR encoded binaries according to ISO 18013-5.
Apache License 2.0
83 stars 5 forks source link

Support of other DocTypes and namespaces #4

Closed kkmanos closed 1 month ago

kkmanos commented 3 months ago

Hello everyone,

In the framework of the MDoc implementation in wwWallet and the alignment with the EUDI ARF we noticed that in the library the org.iso.18013.5.1.mDL doc type is the only available option. Unfortunately this seems to be incompatible with the EUDI and ARF requirements which mandates a namespace and an attestation type of “eu.europa.ec.eudi.pid.<#increment>” for PIDs.

The library currently supports only the 'org.iso.18013.5.1.mDL' DocType, limiting its usability for developers who wish to implement solutions with custom DocTypes.

Adopting a more flexible approach to accommodate any DocType would be more than useful for anyone who is using this library as a core layer to implement solutions using the mDL specification ISO.18013-5.

siacomuzzi commented 3 months ago

Hi @kkmanos Could you please provide us with some examples and links about this? Thank you in advance.

dalebowie commented 1 month ago

This might be as simple as removing the DocType restriction and instead allow any string to be specified as a DocType. Currently it is restricted to the specific mDL string:

export type DocType = 'org.iso.18013.5.1.mDL';

So maybe it could become this?

export type DocType = 'org.iso.18013.5.1.mDL' | string;

It appears the addIssuerNameSpace function already allows for arbitrary custom namespaces so that probably wouldn't have to change:

addIssuerNameSpace(namespace: 'org.iso.18013.5.1' | string, values: Record<string, any>): Document;
siacomuzzi commented 1 month ago

Yeah, that's correct. My original question was out of curiosity, as the ISO standard currently only accepts org.iso.18013.5.1.mDL:

From section 7.1 - mDL document type and namespace:

The document type for an mDL document shall be “org.iso.18013.5.1.mDL”.

dalebowie commented 1 month ago

I guess it comes down to whether you want this library to support only mDLs, or any arbitrary mdoc produced following the underlying standard.

Here's a link to the introduction of the PID for EUDI ARF. Then there's this second document with sections on the doc type and namespace proposed and notes specific to the mdoc encoding of it.

github-actions[bot] commented 1 month ago

:tada: This issue has been resolved in version 1.4.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

dalebowie commented 1 month ago

Thank you!

kkmanos commented 5 days ago

Hi everyone,

Thanks to the latest improvements in the library, we were able to successfully introduce the mDoc format in https://funke.wwwallet.org/ as part of the SPRIN-D Funke competition!

It will soon also be part of the core wwWallet software.

siacomuzzi commented 5 days ago

Nice! Just FYI, as the readme says, this library was implemented in accordance with ISO 18013-7 (draft date: 2023-08-02). However, there is a more recent draft dated 2024-02-13 that we need to review to ensure the library is updated accordingly (for example, the structure of the session transcript was changed).