From 2dc27633b3b21ed0777719ed0c06fb7832e19c38 Mon Sep 17 00:00:00 2001 From: Brad Lassey Date: Fri, 9 Sep 2022 11:53:04 -0400 Subject: [PATCH 1/6] Update README.md --- README.md | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 3c3a79a..2ab09ef 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ dictionary CredentialStorageDuration { long days; // Cannot (currently) be used with any other properties. }; -dictionary CredentialDocumentDescriptor { +dictionary DocumentCredentialOptions { required DOMString documentType; // As defined in ISO 18013-5 clause 8. required sequence requestedElements; @@ -116,23 +116,16 @@ dictionary CredentialDocumentDescriptor { CredentialStorageDuration desiredStorageDuration; // Not providing this is equivalent to not asking to store. }; -dictionary CredentialDocument { +[Exposed=Window, SecureContext] +interface DocumentCredential : Credential { object data; // The CBOR encoded `CredentialDocument` defined above. }; -dictionary RequestConfiguration { - required DOMString nonce; -}; - -[ - SecureContext, - Exposed=Window, -] interface CredentialRequest { - constructor(DOMString requesterIdentity, CredentialDocumentDescriptor documentDescriptor); // This throws if anything in the `documentDescriptor` is not recognized (e.g. an invalid `documentType`). - +dictionary CredentialRequestOptions { Promise requestDocument(RequestConfiguration configuration); Promise abort(); + required DOMString nonce; }; ``` @@ -141,7 +134,7 @@ dictionary RequestConfiguration { ```js // Driver's License -let mDLCredentialRequest = new CredentialRequest(certificate, { +let options = { documentType: "org.iso.18013.5.1.mDL", requestedElements: [ { namespace: "org.iso.18013.5.1", name: "document_number" }, @@ -153,20 +146,22 @@ let mDLCredentialRequest = new CredentialRequest(certificate, { desiredStorageDuration: { days: 7, }, -}); -mDLCredentialRequest.request({ nonce }).then((credentialDocument) => { ... }); + nonce, +}; +navigator.credentials.get("mdoc", options).then((credentialDocument) => { ... }); ``` ```js // Vaccination Card -let micovCredentialRequest = new CredentialRequest(certificate, { +let options = { documentType: "org.micov.1", requestedElements: [ { namespace: "org.micov.attestation.1", name: "PersonId_dl" }, { namespace: "org.micov.attestation.1", name: "portrait" }, ], -}); -micovCredentialRequest.request({ nonce }).then((credentialDocument) => { ... }); + nonce, +}; +navigator.credentials.get("mdoc", options).then((credentialDocument) => { ... }); ``` From 57582a1640c87c202958e5deb572f6afd68ecd62 Mon Sep 17 00:00:00 2001 From: Brad Lassey Date: Fri, 9 Sep 2022 11:54:28 -0400 Subject: [PATCH 2/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ab09ef..86e895c 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ EncryptionParamaters = { ### API -One idea a new `CredentialRequest` (et al) +Add a `DocumentCredential` type to the Credential Managment API ``` dictionary CredentialElement { required DOMString namespace; // As defined in ISO 18013-5 clause 8. From f67c8cec955087aaab00c58772cb3f4e0cb40fc4 Mon Sep 17 00:00:00 2001 From: Brad Lassey Date: Fri, 9 Sep 2022 11:56:11 -0400 Subject: [PATCH 3/6] Update README.md --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 86e895c..633d99f 100644 --- a/README.md +++ b/README.md @@ -121,12 +121,6 @@ interface DocumentCredential : Credential { object data; // The CBOR encoded `CredentialDocument` defined above. }; -dictionary CredentialRequestOptions { - Promise requestDocument(RequestConfiguration configuration); - - Promise abort(); - required DOMString nonce; -}; ``` From 4539c7b3de2a960d2c6d8a809bf6e4b4d69acc7f Mon Sep 17 00:00:00 2001 From: Brad Lassey Date: Fri, 9 Sep 2022 12:03:41 -0400 Subject: [PATCH 4/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 633d99f..27ea283 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ let options = { }, nonce, }; -navigator.credentials.get("mdoc", options).then((credentialDocument) => { ... }); +navigator.credentials.get(mdoc: options).then((credentialDocument) => { ... }); ``` ```js @@ -155,7 +155,7 @@ let options = { ], nonce, }; -navigator.credentials.get("mdoc", options).then((credentialDocument) => { ... }); +navigator.credentials.get(mdoc: options).then((credentialDocument) => { ... }); ``` From 09acf3e0bb647f34f0477c000ec12617b751f0e9 Mon Sep 17 00:00:00 2001 From: Brad Lassey Date: Fri, 9 Sep 2022 12:07:35 -0400 Subject: [PATCH 5/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 27ea283..22db353 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ let options = { }, nonce, }; -navigator.credentials.get(mdoc: options).then((credentialDocument) => { ... }); +navigator.credentials.get({mdoc: options}).then((credentialDocument) => { ... }); ``` ```js @@ -155,7 +155,7 @@ let options = { ], nonce, }; -navigator.credentials.get(mdoc: options).then((credentialDocument) => { ... }); +navigator.credentials.get({mdoc: options}).then((credentialDocument) => { ... }); ``` From 05b925b5b0e945858ff4c5509f73c27201b88d58 Mon Sep 17 00:00:00 2001 From: Brad Lassey Date: Thu, 2 Feb 2023 17:26:24 -0500 Subject: [PATCH 6/6] Update README.md --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 22db353..ccb7872 100644 --- a/README.md +++ b/README.md @@ -92,15 +92,18 @@ EncryptionParamaters = { ### API - -Add a `DocumentCredential` type to the Credential Managment API +Add an Identity Managment API, which mirrors the Credential Managment API and add a `DocumentCredential` type to that extends Credential. ``` -dictionary CredentialElement { +partial interface Navigator { + [SecureContext, SameObject] readonly attribute CredentialsContainer identity; +}; + +dictionary DocumentCredentialElement { required DOMString namespace; // As defined in ISO 18013-5 clause 8. required DOMString name; }; -dictionary CredentialStorageDuration { +dictionary DocumentCredentialStorageDuration { // At least one of these is required. boolean forever; // Cannot be used with any other properties. @@ -111,9 +114,9 @@ dictionary CredentialStorageDuration { dictionary DocumentCredentialOptions { required DOMString documentType; // As defined in ISO 18013-5 clause 8. - required sequence requestedElements; + required sequence requestedElements; - CredentialStorageDuration desiredStorageDuration; // Not providing this is equivalent to not asking to store. + DocumentCredentialStorageDuration desiredStorageDuration; // Not providing this is equivalent to not asking to store. }; [Exposed=Window, SecureContext] @@ -142,7 +145,7 @@ let options = { }, nonce, }; -navigator.credentials.get({mdoc: options}).then((credentialDocument) => { ... }); +navigator.identity.get({mdoc: options}).then((credentialDocument) => { ... }); ``` ```js @@ -155,7 +158,7 @@ let options = { ], nonce, }; -navigator.credentials.get({mdoc: options}).then((credentialDocument) => { ... }); +navigator.identity.get({mdoc: options}).then((credentialDocument) => { ... }); ```