From e3f0ad6732f10a4e67419f8f2a65a461cf2f54ef Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Fri, 1 Jul 2022 11:54:44 -0300 Subject: [PATCH 01/16] feat: Adding the interface for credential status manager --- packages/core/src/types/ICredentialStatus.ts | 80 ++++++++++++++++++++ packages/core/src/types/vc-data-model.ts | 13 +++- packages/credential-status/src/types.ts | 4 +- 3 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 packages/core/src/types/ICredentialStatus.ts diff --git a/packages/core/src/types/ICredentialStatus.ts b/packages/core/src/types/ICredentialStatus.ts new file mode 100644 index 0000000000..3ed573c0d4 --- /dev/null +++ b/packages/core/src/types/ICredentialStatus.ts @@ -0,0 +1,80 @@ +import { VerifiableCredential } from 'did-jwt-vc' +import { + CredentialStatusVerification +} from 'credential-status' + +export { DIDDocument, DIDResolutionOptions, DIDResolutionResult } from 'did-resolver' +import { IPluginMethodMap } from './IAgent' +import { CredentialStatus, CredentialStatusType } from './vc-data-model' + +/** + * The arguments expected by a plugin that implements a credential status type/method + * in order to change the status of an issued verifiable credential. + * + * Each cretential status type has its own specific parameters according to their spec. + * + * @see https://w3c-ccg.github.io/vc-status-list-2021/ | StatusList2021Entry + * @see https://w3c-ccg.github.io/vc-csl2017/ | CredentialStatusList2017 + */ +class CredentialStatusUpdateOptions { [x: string]: any } + +/** + * Input arguments for {@link IRevocation.credentialStatusUpdate | credentialStatusUpdate} + * @public + */ +export interface CredentialStatusUpdateArgs { + /** + * The verifiable credential whose status will be updated. + */ + vc: VerifiableCredential + + /** + * Credential status strategy options that will be passed to the method specific manager. + * + * @see: https://www.w3.org/TR/vc-data-model/#status + */ + options?: CredentialStatusUpdateOptions +} + +export interface CredentialStatusGenerateArgs { + /** + * The credential status type (aka credential status method) to be used in the `cretentialStatus` generation. + */ + type: CredentialStatusType +} + +/** + * Credential status manager interface + * @public + */ +export interface ICredentialStatus extends IPluginMethodMap { + /** + * Changes the status of an existing verifiable credential. + * Commonly used to revoke an existent credential. + * + * @param args - Input arguments for updating the status or revoking a credential + * @public + */ + credentialStatusUpdate(args: CredentialStatusUpdateArgs): Promise + + /** + * Generates a `credentialStatus` property for a future credential, not yet signed. + * + * This method is used during the creation of a VC in order to make the VC capable of + * having its status updated later, allowing it to be revoked later by instance. + * + * @param args - Input arguments for generating the `credentialStatus` field of a new credential + * @public + */ + credentialStatusGenerate(args: CredentialStatusGenerateArgs): Promise + + /** + * List all the credential status types (methods) available in the current agent instance. + */ + credentialStatusTypes(): Promise + + /** + * Returns the status verification of a particular credential. + */ + credentialStatusRead(vc: VerifiableCredential): Promise +} \ No newline at end of file diff --git a/packages/core/src/types/vc-data-model.ts b/packages/core/src/types/vc-data-model.ts index 1c7181399d..c5ba07c562 100644 --- a/packages/core/src/types/vc-data-model.ts +++ b/packages/core/src/types/vc-data-model.ts @@ -18,7 +18,7 @@ export type CompactJWT = string * * @beta This API may change without a BREAKING CHANGE notice. */ -export type IssuerType = { id: string; [x: string]: any } | string +export type IssuerType = { id: string;[x: string]: any } | string /** * The value of the credentialSubject property is defined as a set of objects that contain one or more properties that @@ -34,6 +34,15 @@ export type CredentialSubject = { [x: string]: any } +/** + * Expresses the credential status type (also referred to as the credential status method). + * It is expected that the value will provide enough information to determine the current status of the credential + * and that machine readable information needs to be retrievable from the URI. + * For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked. + * @see https://www.w3.org/TR/vc-data-model/#status + */ +export type CredentialStatusType = string + /** * Used for the discovery of information about the current status of a verifiable credential, such as whether it is * suspended or revoked. @@ -46,7 +55,7 @@ export type CredentialSubject = { */ export type CredentialStatus = { id: string - type: string + type: CredentialStatusType [x: string]: any } diff --git a/packages/credential-status/src/types.ts b/packages/credential-status/src/types.ts index 57a4a6d500..65bd7944ba 100644 --- a/packages/credential-status/src/types.ts +++ b/packages/credential-status/src/types.ts @@ -1,5 +1,5 @@ import { IAgentContext, IPluginMethodMap, VerifiableCredential } from '@veramo/core' -import { CredentialStatus } from 'credential-status' +import { CredentialStatusVerification } from 'credential-status' import { DIDDocument } from 'did-resolver' /** @@ -44,5 +44,5 @@ export interface ICheckCredentialStatus extends IPluginMethodMap { checkCredentialStatus( args: ICheckCredentialStatusArgs, context: IAgentContext, - ): Promise + ): Promise } From 26fab23e5ac64b0e09c87dccc84e255cf80ac78f Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Fri, 1 Jul 2022 13:38:09 -0300 Subject: [PATCH 02/16] fix: Updating plugin schemas --- packages/core/plugin.schema.json | 18 +++++++++++++++--- packages/credential-eip712/plugin.schema.json | 6 +++++- packages/credential-ld/plugin.schema.json | 6 +++++- packages/credential-status/plugin.schema.json | 17 +++++++++++++++-- packages/credential-w3c/plugin.schema.json | 6 +++++- packages/did-comm/plugin.schema.json | 6 +++++- .../selective-disclosure/plugin.schema.json | 6 +++++- 7 files changed, 55 insertions(+), 10 deletions(-) diff --git a/packages/core/plugin.schema.json b/packages/core/plugin.schema.json index 26afe0848c..b5c911430e 100644 --- a/packages/core/plugin.schema.json +++ b/packages/core/plugin.schema.json @@ -1742,7 +1742,7 @@ "type": "string" }, "type": { - "type": "string" + "$ref": "#/components/schemas/CredentialStatusType" } }, "required": [ @@ -1751,6 +1751,10 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, + "CredentialStatusType": { + "type": "string", + "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." + }, "VerifiablePresentation": { "type": "object", "properties": { @@ -2510,7 +2514,7 @@ "type": "string" }, "type": { - "type": "string" + "$ref": "#/components/schemas/CredentialStatusType" } }, "required": [ @@ -2519,6 +2523,10 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, + "CredentialStatusType": { + "type": "string", + "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." + }, "VerifiablePresentation": { "type": "object", "properties": { @@ -3286,7 +3294,7 @@ "type": "string" }, "type": { - "type": "string" + "$ref": "#/components/schemas/CredentialStatusType" } }, "required": [ @@ -3295,6 +3303,10 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, + "CredentialStatusType": { + "type": "string", + "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." + }, "VerifiablePresentation": { "type": "object", "properties": { diff --git a/packages/credential-eip712/plugin.schema.json b/packages/credential-eip712/plugin.schema.json index 4a5b503a48..5eb8281650 100644 --- a/packages/credential-eip712/plugin.schema.json +++ b/packages/credential-eip712/plugin.schema.json @@ -97,7 +97,7 @@ "type": "string" }, "type": { - "type": "string" + "$ref": "#/components/schemas/CredentialStatusType" } }, "required": [ @@ -106,6 +106,10 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, + "CredentialStatusType": { + "type": "string", + "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." + }, "VerifiableCredential": { "type": "object", "properties": { diff --git a/packages/credential-ld/plugin.schema.json b/packages/credential-ld/plugin.schema.json index b6df74bb10..15ffa0fe37 100644 --- a/packages/credential-ld/plugin.schema.json +++ b/packages/credential-ld/plugin.schema.json @@ -97,7 +97,7 @@ "type": "string" }, "type": { - "type": "string" + "$ref": "#/components/schemas/CredentialStatusType" } }, "required": [ @@ -106,6 +106,10 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, + "CredentialStatusType": { + "type": "string", + "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." + }, "VerifiableCredential": { "type": "object", "properties": { diff --git a/packages/credential-status/plugin.schema.json b/packages/credential-status/plugin.schema.json index 097e622880..abeda70b9f 100644 --- a/packages/credential-status/plugin.schema.json +++ b/packages/credential-status/plugin.schema.json @@ -122,7 +122,7 @@ "type": "string" }, "type": { - "type": "string" + "$ref": "#/components/schemas/CredentialStatusType" } }, "required": [ @@ -131,6 +131,10 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, + "CredentialStatusType": { + "type": "string", + "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." + }, "DIDDocument": { "type": "object", "properties": { @@ -368,6 +372,15 @@ "type", "serviceEndpoint" ] + }, + "CredentialStatusVerification": { + "type": "object", + "properties": { + "revoked": { + "type": "boolean" + } + }, + "description": "Represents the result of a status check.\n\nImplementations should populate the `revoked` boolean property, but they can return additional metadata that is method specific." } }, "methods": { @@ -377,7 +390,7 @@ "$ref": "#/components/schemas/ICheckCredentialStatusArgs" }, "returnType": { - "$ref": "#/components/schemas/CredentialStatus" + "$ref": "#/components/schemas/CredentialStatusVerification" } } } diff --git a/packages/credential-w3c/plugin.schema.json b/packages/credential-w3c/plugin.schema.json index 7218c9d471..1b827c1712 100644 --- a/packages/credential-w3c/plugin.schema.json +++ b/packages/credential-w3c/plugin.schema.json @@ -110,7 +110,7 @@ "type": "string" }, "type": { - "type": "string" + "$ref": "#/components/schemas/CredentialStatusType" } }, "required": [ @@ -119,6 +119,10 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, + "CredentialStatusType": { + "type": "string", + "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." + }, "ProofFormat": { "type": "string", "enum": [ diff --git a/packages/did-comm/plugin.schema.json b/packages/did-comm/plugin.schema.json index 284aa46bc8..9fd38835ba 100644 --- a/packages/did-comm/plugin.schema.json +++ b/packages/did-comm/plugin.schema.json @@ -403,7 +403,7 @@ "type": "string" }, "type": { - "type": "string" + "$ref": "#/components/schemas/CredentialStatusType" } }, "required": [ @@ -412,6 +412,10 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, + "CredentialStatusType": { + "type": "string", + "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." + }, "VerifiablePresentation": { "type": "object", "properties": { diff --git a/packages/selective-disclosure/plugin.schema.json b/packages/selective-disclosure/plugin.schema.json index 9f33fe713c..8b17009406 100644 --- a/packages/selective-disclosure/plugin.schema.json +++ b/packages/selective-disclosure/plugin.schema.json @@ -220,7 +220,7 @@ "type": "string" }, "type": { - "type": "string" + "$ref": "#/components/schemas/CredentialStatusType" } }, "required": [ @@ -229,6 +229,10 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, + "CredentialStatusType": { + "type": "string", + "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." + }, "CompactJWT": { "type": "string", "description": "Represents a Json Web Token in compact form. \"header.payload.signature\"" From fe47d3a1db381f7dfd867a1bd69099c4cd9ca8df Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Mon, 4 Jul 2022 15:16:40 -0300 Subject: [PATCH 03/16] fix: missing library reference --- packages/core/package.json | 1 + packages/core/src/types/ICredentialStatus.ts | 2 +- packages/credential-status/src/types.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 6e43ded024..da4e284ea7 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -27,6 +27,7 @@ "devDependencies": { "@types/debug": "4.1.7", "did-resolver": "3.2.2", + "credential-status": "^2.0.3", "typescript": "4.7.3" }, "files": [ diff --git a/packages/core/src/types/ICredentialStatus.ts b/packages/core/src/types/ICredentialStatus.ts index 3ed573c0d4..a108e4cdce 100644 --- a/packages/core/src/types/ICredentialStatus.ts +++ b/packages/core/src/types/ICredentialStatus.ts @@ -1,6 +1,6 @@ import { VerifiableCredential } from 'did-jwt-vc' import { - CredentialStatusVerification + CredentialStatus as CredentialStatusVerification } from 'credential-status' export { DIDDocument, DIDResolutionOptions, DIDResolutionResult } from 'did-resolver' diff --git a/packages/credential-status/src/types.ts b/packages/credential-status/src/types.ts index 65bd7944ba..82bd4bb8ff 100644 --- a/packages/credential-status/src/types.ts +++ b/packages/credential-status/src/types.ts @@ -1,5 +1,5 @@ import { IAgentContext, IPluginMethodMap, VerifiableCredential } from '@veramo/core' -import { CredentialStatusVerification } from 'credential-status' +import { CredentialStatus as CredentialStatusVerification } from 'credential-status' import { DIDDocument } from 'did-resolver' /** From efa86192e6dd95fba0fb907cdda56de698094742 Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Thu, 4 Aug 2022 09:16:41 -0300 Subject: [PATCH 04/16] Update packages/core/src/types/ICredentialStatus.ts The exported data types should be marked as @beta instead of @public Co-authored-by: Mircea Nistor --- packages/core/src/types/ICredentialStatus.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/src/types/ICredentialStatus.ts b/packages/core/src/types/ICredentialStatus.ts index a108e4cdce..43a801c9e3 100644 --- a/packages/core/src/types/ICredentialStatus.ts +++ b/packages/core/src/types/ICredentialStatus.ts @@ -15,8 +15,10 @@ import { CredentialStatus, CredentialStatusType } from './vc-data-model' * * @see https://w3c-ccg.github.io/vc-status-list-2021/ | StatusList2021Entry * @see https://w3c-ccg.github.io/vc-csl2017/ | CredentialStatusList2017 + * + * @beta */ -class CredentialStatusUpdateOptions { [x: string]: any } +interface CredentialStatusUpdateOptions { [x: string]: any } /** * Input arguments for {@link IRevocation.credentialStatusUpdate | credentialStatusUpdate} From af2251fad36701f8ed7863aa814af2730d52f48a Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Thu, 4 Aug 2022 09:16:58 -0300 Subject: [PATCH 05/16] Update packages/core/src/types/ICredentialStatus.ts The exported data types should be marked as @beta instead of @public Co-authored-by: Mircea Nistor --- packages/core/src/types/ICredentialStatus.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/types/ICredentialStatus.ts b/packages/core/src/types/ICredentialStatus.ts index 43a801c9e3..5ade63cfe3 100644 --- a/packages/core/src/types/ICredentialStatus.ts +++ b/packages/core/src/types/ICredentialStatus.ts @@ -21,8 +21,8 @@ import { CredentialStatus, CredentialStatusType } from './vc-data-model' interface CredentialStatusUpdateOptions { [x: string]: any } /** - * Input arguments for {@link IRevocation.credentialStatusUpdate | credentialStatusUpdate} - * @public + * Input arguments for {@link ICredentialStatus.credentialStatusUpdate | credentialStatusUpdate} + * @beta */ export interface CredentialStatusUpdateArgs { /** From cd07fb58076e6689512251d547a09e8577772cc3 Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Thu, 4 Aug 2022 09:17:19 -0300 Subject: [PATCH 06/16] Update packages/core/src/types/ICredentialStatus.ts The exported data types should be marked as @beta instead of @public Co-authored-by: Mircea Nistor --- packages/core/src/types/ICredentialStatus.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/core/src/types/ICredentialStatus.ts b/packages/core/src/types/ICredentialStatus.ts index 5ade63cfe3..d4e3e01b6b 100644 --- a/packages/core/src/types/ICredentialStatus.ts +++ b/packages/core/src/types/ICredentialStatus.ts @@ -38,6 +38,12 @@ export interface CredentialStatusUpdateArgs { options?: CredentialStatusUpdateOptions } +/** + * Arguments for generating a `credentialStatus` property for a {@link VerifiableCredential}. + * @see {@link ICredentialStatus.credentialStatusGenerate} + * + * @beta + */ export interface CredentialStatusGenerateArgs { /** * The credential status type (aka credential status method) to be used in the `cretentialStatus` generation. From b3d74463d2d75911d9a78310eb30acea38f6d7a3 Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Thu, 4 Aug 2022 09:17:30 -0300 Subject: [PATCH 07/16] Update packages/core/src/types/ICredentialStatus.ts The exported data types should be marked as @beta instead of @public Co-authored-by: Mircea Nistor --- packages/core/src/types/ICredentialStatus.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/types/ICredentialStatus.ts b/packages/core/src/types/ICredentialStatus.ts index d4e3e01b6b..abe513e7db 100644 --- a/packages/core/src/types/ICredentialStatus.ts +++ b/packages/core/src/types/ICredentialStatus.ts @@ -72,7 +72,7 @@ export interface ICredentialStatus extends IPluginMethodMap { * having its status updated later, allowing it to be revoked later by instance. * * @param args - Input arguments for generating the `credentialStatus` field of a new credential - * @public + * @beta */ credentialStatusGenerate(args: CredentialStatusGenerateArgs): Promise From c095a5ae7b0b14e967eb24cf68504bfea59b0c83 Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Thu, 4 Aug 2022 09:17:44 -0300 Subject: [PATCH 08/16] Update packages/core/src/types/ICredentialStatus.ts The exported data types should be marked as @beta instead of @public Co-authored-by: Mircea Nistor --- packages/core/src/types/ICredentialStatus.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/types/ICredentialStatus.ts b/packages/core/src/types/ICredentialStatus.ts index abe513e7db..c5979fcd95 100644 --- a/packages/core/src/types/ICredentialStatus.ts +++ b/packages/core/src/types/ICredentialStatus.ts @@ -61,7 +61,7 @@ export interface ICredentialStatus extends IPluginMethodMap { * Commonly used to revoke an existent credential. * * @param args - Input arguments for updating the status or revoking a credential - * @public + * @beta */ credentialStatusUpdate(args: CredentialStatusUpdateArgs): Promise From 8f03222e114e3ad306cb739539e652146c73ae73 Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Thu, 4 Aug 2022 09:29:45 -0300 Subject: [PATCH 09/16] Update packages/core/src/types/vc-data-model.ts Fixing VC status method explanation. Co-authored-by: Mircea Nistor --- packages/core/src/types/vc-data-model.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/core/src/types/vc-data-model.ts b/packages/core/src/types/vc-data-model.ts index c5ba07c562..95b8cf2d1d 100644 --- a/packages/core/src/types/vc-data-model.ts +++ b/packages/core/src/types/vc-data-model.ts @@ -36,9 +36,7 @@ export type CredentialSubject = { /** * Expresses the credential status type (also referred to as the credential status method). - * It is expected that the value will provide enough information to determine the current status of the credential - * and that machine readable information needs to be retrievable from the URI. - * For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked. + * * @see https://www.w3.org/TR/vc-data-model/#status */ export type CredentialStatusType = string From efc7adb039dec5faee99d0bc7905449fdbf735d1 Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Thu, 4 Aug 2022 09:34:09 -0300 Subject: [PATCH 10/16] Update packages/core/src/types/ICredentialStatus.ts Co-authored-by: Mircea Nistor --- packages/core/src/types/ICredentialStatus.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/types/ICredentialStatus.ts b/packages/core/src/types/ICredentialStatus.ts index c5979fcd95..74a9b2d094 100644 --- a/packages/core/src/types/ICredentialStatus.ts +++ b/packages/core/src/types/ICredentialStatus.ts @@ -46,7 +46,7 @@ export interface CredentialStatusUpdateArgs { */ export interface CredentialStatusGenerateArgs { /** - * The credential status type (aka credential status method) to be used in the `cretentialStatus` generation. + * The credential status type (aka credential status method) to be used in the `credentialStatus` generation. */ type: CredentialStatusType } From a77d9b9e23eb234d2779f975ebe86897c369dbb1 Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Thu, 4 Aug 2022 09:51:54 -0300 Subject: [PATCH 11/16] Update packages/core/src/types/ICredentialStatus.ts Co-authored-by: Mircea Nistor --- packages/core/src/types/ICredentialStatus.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/core/src/types/ICredentialStatus.ts b/packages/core/src/types/ICredentialStatus.ts index 74a9b2d094..ea2c27d2d8 100644 --- a/packages/core/src/types/ICredentialStatus.ts +++ b/packages/core/src/types/ICredentialStatus.ts @@ -1,11 +1,10 @@ -import { VerifiableCredential } from 'did-jwt-vc' import { CredentialStatus as CredentialStatusVerification } from 'credential-status' export { DIDDocument, DIDResolutionOptions, DIDResolutionResult } from 'did-resolver' import { IPluginMethodMap } from './IAgent' -import { CredentialStatus, CredentialStatusType } from './vc-data-model' +import { CredentialStatus, CredentialStatusType, VerifiableCredential } from './vc-data-model' /** * The arguments expected by a plugin that implements a credential status type/method From fc150b6923024ab552b534d420168f387eb01d79 Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Thu, 4 Aug 2022 14:54:25 -0300 Subject: [PATCH 12/16] Update packages/core/src/types/ICredentialStatus.ts Co-authored-by: Mircea Nistor --- packages/core/src/types/ICredentialStatus.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/types/ICredentialStatus.ts b/packages/core/src/types/ICredentialStatus.ts index ea2c27d2d8..2b591b371d 100644 --- a/packages/core/src/types/ICredentialStatus.ts +++ b/packages/core/src/types/ICredentialStatus.ts @@ -62,7 +62,7 @@ export interface ICredentialStatus extends IPluginMethodMap { * @param args - Input arguments for updating the status or revoking a credential * @beta */ - credentialStatusUpdate(args: CredentialStatusUpdateArgs): Promise + credentialStatusUpdate(args: CredentialStatusUpdateArgs): Promise /** * Generates a `credentialStatus` property for a future credential, not yet signed. From 01a5cb25e6e1270004160c3d80b3df14f4bfd9ef Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Thu, 4 Aug 2022 14:55:09 -0300 Subject: [PATCH 13/16] fix: Removing CredentialStatusType --- packages/core/src/types/ICredentialStatus.ts | 7 +++---- packages/core/src/types/vc-data-model.ts | 9 +-------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/packages/core/src/types/ICredentialStatus.ts b/packages/core/src/types/ICredentialStatus.ts index 74a9b2d094..3d764619e5 100644 --- a/packages/core/src/types/ICredentialStatus.ts +++ b/packages/core/src/types/ICredentialStatus.ts @@ -1,11 +1,10 @@ -import { VerifiableCredential } from 'did-jwt-vc' import { CredentialStatus as CredentialStatusVerification } from 'credential-status' export { DIDDocument, DIDResolutionOptions, DIDResolutionResult } from 'did-resolver' import { IPluginMethodMap } from './IAgent' -import { CredentialStatus, CredentialStatusType } from './vc-data-model' +import { CredentialStatus, VerifiableCredential } from './vc-data-model' /** * The arguments expected by a plugin that implements a credential status type/method @@ -48,7 +47,7 @@ export interface CredentialStatusGenerateArgs { /** * The credential status type (aka credential status method) to be used in the `credentialStatus` generation. */ - type: CredentialStatusType + type: string } /** @@ -79,7 +78,7 @@ export interface ICredentialStatus extends IPluginMethodMap { /** * List all the credential status types (methods) available in the current agent instance. */ - credentialStatusTypes(): Promise + credentialStatusTypes(): Promise /** * Returns the status verification of a particular credential. diff --git a/packages/core/src/types/vc-data-model.ts b/packages/core/src/types/vc-data-model.ts index 95b8cf2d1d..69de0c0c3d 100644 --- a/packages/core/src/types/vc-data-model.ts +++ b/packages/core/src/types/vc-data-model.ts @@ -34,13 +34,6 @@ export type CredentialSubject = { [x: string]: any } -/** - * Expresses the credential status type (also referred to as the credential status method). - * - * @see https://www.w3.org/TR/vc-data-model/#status - */ -export type CredentialStatusType = string - /** * Used for the discovery of information about the current status of a verifiable credential, such as whether it is * suspended or revoked. @@ -53,7 +46,7 @@ export type CredentialStatusType = string */ export type CredentialStatus = { id: string - type: CredentialStatusType + type: string [x: string]: any } From 956d0074f5a9c034828af9d431d640b281155b07 Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Mon, 8 Aug 2022 10:05:55 -0300 Subject: [PATCH 14/16] Update packages/core/src/types/ICredentialStatus.ts Co-authored-by: Mircea Nistor --- packages/core/src/types/ICredentialStatus.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/types/ICredentialStatus.ts b/packages/core/src/types/ICredentialStatus.ts index abed7dbac7..d2471ba917 100644 --- a/packages/core/src/types/ICredentialStatus.ts +++ b/packages/core/src/types/ICredentialStatus.ts @@ -10,7 +10,7 @@ import { CredentialStatus, VerifiableCredential } from './vc-data-model' * The arguments expected by a plugin that implements a credential status type/method * in order to change the status of an issued verifiable credential. * - * Each cretential status type has its own specific parameters according to their spec. + * Each credential status type has its own specific parameters according to their spec. * * @see https://w3c-ccg.github.io/vc-status-list-2021/ | StatusList2021Entry * @see https://w3c-ccg.github.io/vc-csl2017/ | CredentialStatusList2017 From d716027ea97a99def0703e1c31308c67eb07b3b0 Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Mon, 8 Aug 2022 10:26:22 -0300 Subject: [PATCH 15/16] fix: docs rebuilt --- packages/core/plugin.schema.json | 18 +++--------------- packages/core/src/types/ICredentialStatus.ts | 2 +- packages/credential-eip712/plugin.schema.json | 6 +----- packages/credential-ld/plugin.schema.json | 6 +----- packages/credential-w3c/plugin.schema.json | 6 +----- packages/did-comm/plugin.schema.json | 6 +----- .../selective-disclosure/plugin.schema.json | 6 +----- 7 files changed, 9 insertions(+), 41 deletions(-) diff --git a/packages/core/plugin.schema.json b/packages/core/plugin.schema.json index f4ac2557e5..a4215b59ca 100644 --- a/packages/core/plugin.schema.json +++ b/packages/core/plugin.schema.json @@ -1840,7 +1840,7 @@ "type": "string" }, "type": { - "$ref": "#/components/schemas/CredentialStatusType" + "type": "string" } }, "required": [ @@ -1849,10 +1849,6 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, - "CredentialStatusType": { - "type": "string", - "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." - }, "VerifiablePresentation": { "type": "object", "properties": { @@ -2612,7 +2608,7 @@ "type": "string" }, "type": { - "$ref": "#/components/schemas/CredentialStatusType" + "type": "string" } }, "required": [ @@ -2621,10 +2617,6 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, - "CredentialStatusType": { - "type": "string", - "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." - }, "VerifiablePresentation": { "type": "object", "properties": { @@ -3392,7 +3384,7 @@ "type": "string" }, "type": { - "$ref": "#/components/schemas/CredentialStatusType" + "type": "string" } }, "required": [ @@ -3401,10 +3393,6 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, - "CredentialStatusType": { - "type": "string", - "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." - }, "VerifiablePresentation": { "type": "object", "properties": { diff --git a/packages/core/src/types/ICredentialStatus.ts b/packages/core/src/types/ICredentialStatus.ts index abed7dbac7..4bfa231fcc 100644 --- a/packages/core/src/types/ICredentialStatus.ts +++ b/packages/core/src/types/ICredentialStatus.ts @@ -52,7 +52,7 @@ export interface CredentialStatusGenerateArgs { /** * Credential status manager interface - * @public + * @beta */ export interface ICredentialStatus extends IPluginMethodMap { /** diff --git a/packages/credential-eip712/plugin.schema.json b/packages/credential-eip712/plugin.schema.json index 5eb8281650..4a5b503a48 100644 --- a/packages/credential-eip712/plugin.schema.json +++ b/packages/credential-eip712/plugin.schema.json @@ -97,7 +97,7 @@ "type": "string" }, "type": { - "$ref": "#/components/schemas/CredentialStatusType" + "type": "string" } }, "required": [ @@ -106,10 +106,6 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, - "CredentialStatusType": { - "type": "string", - "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." - }, "VerifiableCredential": { "type": "object", "properties": { diff --git a/packages/credential-ld/plugin.schema.json b/packages/credential-ld/plugin.schema.json index 15ffa0fe37..b6df74bb10 100644 --- a/packages/credential-ld/plugin.schema.json +++ b/packages/credential-ld/plugin.schema.json @@ -97,7 +97,7 @@ "type": "string" }, "type": { - "$ref": "#/components/schemas/CredentialStatusType" + "type": "string" } }, "required": [ @@ -106,10 +106,6 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, - "CredentialStatusType": { - "type": "string", - "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." - }, "VerifiableCredential": { "type": "object", "properties": { diff --git a/packages/credential-w3c/plugin.schema.json b/packages/credential-w3c/plugin.schema.json index 6c4c4e0b53..74a912a3b0 100644 --- a/packages/credential-w3c/plugin.schema.json +++ b/packages/credential-w3c/plugin.schema.json @@ -110,7 +110,7 @@ "type": "string" }, "type": { - "$ref": "#/components/schemas/CredentialStatusType" + "type": "string" } }, "required": [ @@ -119,10 +119,6 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, - "CredentialStatusType": { - "type": "string", - "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." - }, "ProofFormat": { "type": "string", "enum": [ diff --git a/packages/did-comm/plugin.schema.json b/packages/did-comm/plugin.schema.json index 9fd38835ba..284aa46bc8 100644 --- a/packages/did-comm/plugin.schema.json +++ b/packages/did-comm/plugin.schema.json @@ -403,7 +403,7 @@ "type": "string" }, "type": { - "$ref": "#/components/schemas/CredentialStatusType" + "type": "string" } }, "required": [ @@ -412,10 +412,6 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, - "CredentialStatusType": { - "type": "string", - "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." - }, "VerifiablePresentation": { "type": "object", "properties": { diff --git a/packages/selective-disclosure/plugin.schema.json b/packages/selective-disclosure/plugin.schema.json index 8b17009406..9f33fe713c 100644 --- a/packages/selective-disclosure/plugin.schema.json +++ b/packages/selective-disclosure/plugin.schema.json @@ -220,7 +220,7 @@ "type": "string" }, "type": { - "$ref": "#/components/schemas/CredentialStatusType" + "type": "string" } }, "required": [ @@ -229,10 +229,6 @@ ], "description": "Used for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked. The precise contents of the credential status information is determined by the specific `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if it is privacy-enhancing.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }" }, - "CredentialStatusType": { - "type": "string", - "description": "Expresses the credential status type (also referred to as the credential status method). It is expected that the value will provide enough information to determine the current status of the credential and that machine readable information needs to be retrievable from the URI. For example, the object could contain a link to an external document noting whether or not the credential is suspended or revoked." - }, "CompactJWT": { "type": "string", "description": "Represents a Json Web Token in compact form. \"header.payload.signature\"" From 6ae5a1bce6d415868ee122487ef3489201b17236 Mon Sep 17 00:00:00 2001 From: Italo Borssatto Date: Mon, 8 Aug 2022 10:27:57 -0300 Subject: [PATCH 16/16] fix: removing unused dependency --- packages/core/src/types/ICredentialStatus.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/core/src/types/ICredentialStatus.ts b/packages/core/src/types/ICredentialStatus.ts index 4bfa231fcc..c47b5b9cbc 100644 --- a/packages/core/src/types/ICredentialStatus.ts +++ b/packages/core/src/types/ICredentialStatus.ts @@ -1,7 +1,3 @@ -import { - CredentialStatus as CredentialStatusVerification -} from 'credential-status' - export { DIDDocument, DIDResolutionOptions, DIDResolutionResult } from 'did-resolver' import { IPluginMethodMap } from './IAgent' import { CredentialStatus, VerifiableCredential } from './vc-data-model'