@veramo/credential-status 3.1.5-next.121 → 3.1.5-next.125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/credential-status.d.ts +18 -0
- package/build/credential-status.d.ts.map +1 -1
- package/build/credential-status.js +18 -0
- package/build/credential-status.js.map +1 -1
- package/build/tsdoc-metadata.json +1 -1
- package/build/types.d.ts +35 -7
- package/build/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/plugin.schema.json +98 -28
- package/src/credential-status.ts +18 -0
- package/src/types.ts +36 -10
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { IAgentPlugin } from '@veramo/core';
|
|
2
2
|
import { StatusMethod } from 'credential-status';
|
|
3
3
|
import { ICheckCredentialStatus } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* This plugin implements the {@link @veramo/credential-status#ICheckCredentialStatus | ICheckCredentialStatus}
|
|
6
|
+
* interface.
|
|
7
|
+
*
|
|
8
|
+
* This aggregates some {@link credential-status#StatusMethod | credential status implementations} to provide a second
|
|
9
|
+
* layer of validation when verifying Verifiable Credentials.
|
|
10
|
+
*
|
|
11
|
+
* This is used for the discovery of information about the current status of a verifiable credential, such as whether
|
|
12
|
+
* it is suspended or revoked. The precise contents of the credential status information is determined by the specific
|
|
13
|
+
* `credentialStatus` type definition.
|
|
14
|
+
*
|
|
15
|
+
* The results provided by this plugin depend on whether the {@link credential-status#StatusMethod | StatusMethod}
|
|
16
|
+
* required by the credential is installed.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link credential-status#Status}
|
|
19
|
+
*
|
|
20
|
+
* @beta This API may change without a BREAKING CHANGE notice.
|
|
21
|
+
*/
|
|
4
22
|
export declare class CredentialStatusPlugin implements IAgentPlugin {
|
|
5
23
|
private readonly status;
|
|
6
24
|
readonly methods: ICheckCredentialStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-status.d.ts","sourceRoot":"","sources":["../src/credential-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,YAAY,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAU,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,sBAAsB,EAA8B,MAAM,SAAS,CAAA;AAE5E,qBAAa,sBAAuB,YAAW,YAAY;IACzD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAA;gBAE5B,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAM;YAOzC,qBAAqB;CAGpC"}
|
|
1
|
+
{"version":3,"file":"credential-status.d.ts","sourceRoot":"","sources":["../src/credential-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,YAAY,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAU,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,sBAAsB,EAA8B,MAAM,SAAS,CAAA;AAE5E;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,sBAAuB,YAAW,YAAY;IACzD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAA;gBAE5B,QAAQ,GAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAM;YAOzC,qBAAqB;CAGpC"}
|
|
@@ -11,6 +11,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CredentialStatusPlugin = void 0;
|
|
13
13
|
const credential_status_1 = require("credential-status");
|
|
14
|
+
/**
|
|
15
|
+
* This plugin implements the {@link @veramo/credential-status#ICheckCredentialStatus | ICheckCredentialStatus}
|
|
16
|
+
* interface.
|
|
17
|
+
*
|
|
18
|
+
* This aggregates some {@link credential-status#StatusMethod | credential status implementations} to provide a second
|
|
19
|
+
* layer of validation when verifying Verifiable Credentials.
|
|
20
|
+
*
|
|
21
|
+
* This is used for the discovery of information about the current status of a verifiable credential, such as whether
|
|
22
|
+
* it is suspended or revoked. The precise contents of the credential status information is determined by the specific
|
|
23
|
+
* `credentialStatus` type definition.
|
|
24
|
+
*
|
|
25
|
+
* The results provided by this plugin depend on whether the {@link credential-status#StatusMethod | StatusMethod}
|
|
26
|
+
* required by the credential is installed.
|
|
27
|
+
*
|
|
28
|
+
* @see {@link credential-status#Status}
|
|
29
|
+
*
|
|
30
|
+
* @beta This API may change without a BREAKING CHANGE notice.
|
|
31
|
+
*/
|
|
14
32
|
class CredentialStatusPlugin {
|
|
15
33
|
constructor(registry = {}) {
|
|
16
34
|
this.status = new credential_status_1.Status(registry);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-status.js","sourceRoot":"","sources":["../src/credential-status.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yDAAwD;AAGxD,MAAa,sBAAsB;IAIjC,YAAY,WAAyC,EAAE;QACrD,IAAI,CAAC,MAAM,GAAG,IAAI,0BAAM,CAAC,QAAQ,CAAC,CAAA;QAClC,IAAI,CAAC,OAAO,GAAG;YACb,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC;SAC7D,CAAA;IACH,CAAC;IAEa,qBAAqB,CAAC,IAAgC,EAAE,OAA2B;;YAC/F,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9D,CAAC;KAAA;CACF;AAdD,wDAcC"}
|
|
1
|
+
{"version":3,"file":"credential-status.js","sourceRoot":"","sources":["../src/credential-status.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yDAAwD;AAGxD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,sBAAsB;IAIjC,YAAY,WAAyC,EAAE;QACrD,IAAI,CAAC,MAAM,GAAG,IAAI,0BAAM,CAAC,QAAQ,CAAC,CAAA;QAClC,IAAI,CAAC,OAAO,GAAG;YACb,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC;SAC7D,CAAA;IACH,CAAC;IAEa,qBAAqB,CAAC,IAAgC,EAAE,OAA2B;;YAC/F,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9D,CAAC;KAAA;CACF;AAdD,wDAcC"}
|
package/build/types.d.ts
CHANGED
|
@@ -1,15 +1,43 @@
|
|
|
1
|
-
import { IAgentContext, IPluginMethodMap } from '@veramo/core';
|
|
2
|
-
import {
|
|
1
|
+
import { IAgentContext, IPluginMethodMap, VerifiableCredential } from '@veramo/core';
|
|
2
|
+
import { CredentialStatus } from 'credential-status';
|
|
3
3
|
import { DIDDocument } from 'did-resolver';
|
|
4
|
+
/**
|
|
5
|
+
* Arguments for calling {@link ICheckCredentialStatus.checkCredentialStatus | checkCredentialStatus}.
|
|
6
|
+
*
|
|
7
|
+
* The credential whose status should be checked and the DID document of the credential issuer.
|
|
8
|
+
*
|
|
9
|
+
* See {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status}
|
|
10
|
+
*
|
|
11
|
+
* @beta This API may change without a BREAKING CHANGE notice.
|
|
12
|
+
*/
|
|
4
13
|
export interface ICheckCredentialStatusArgs {
|
|
5
|
-
credential:
|
|
14
|
+
credential: VerifiableCredential;
|
|
6
15
|
didDoc: DIDDocument;
|
|
7
16
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
/**
|
|
18
|
+
* This interface defines a plugin that can check the {@link https://www.w3.org/TR/vc-data-model/#status | status} of a
|
|
19
|
+
* {@link @veramo/core#VerifiableCredential | Verifiable Credential}.
|
|
20
|
+
*
|
|
21
|
+
* This is used for the discovery of information about the current status of a verifiable credential, such as whether
|
|
22
|
+
* it is suspended or revoked. The precise contents of the credential status information is determined by the specific
|
|
23
|
+
* `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if
|
|
24
|
+
* it is privacy-enhancing.
|
|
25
|
+
*
|
|
26
|
+
* The result provided by implementations of this plugin depend on whether the implementation of the StatusMethod is
|
|
27
|
+
* available.
|
|
28
|
+
*
|
|
29
|
+
* @see {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status} for data model documentation.
|
|
30
|
+
* @see {@link @veramo/credential-status#CredentialStatusPlugin | CredentialStatusPlugin } for an implementation.
|
|
31
|
+
*
|
|
32
|
+
* @beta This API may change without a BREAKING CHANGE notice.
|
|
33
|
+
*/
|
|
12
34
|
export interface ICheckCredentialStatus extends IPluginMethodMap {
|
|
35
|
+
/**
|
|
36
|
+
* Checks the status of a {@link @veramo/core#VerifiableCredential | Verifiable Credential}.
|
|
37
|
+
*
|
|
38
|
+
* @param args - The credential to be checked, along with the DID document of the issuer.
|
|
39
|
+
* @param context - *RESERVED* This is filled by the framework when the method is called.
|
|
40
|
+
*/
|
|
13
41
|
checkCredentialStatus(args: ICheckCredentialStatusArgs, context: IAgentContext<any>): Promise<CredentialStatus>;
|
|
14
42
|
}
|
|
15
43
|
//# sourceMappingURL=types.d.ts.map
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C;;;;;;;;GAQG;AACH,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,oBAAoB,CAAA;IAChC,MAAM,EAAE,WAAW,CAAA;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAE9D;;;;;OAKG;IACH,qBAAqB,CACnB,IAAI,EAAE,0BAA0B,EAChC,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,GAC1B,OAAO,CAAC,gBAAgB,CAAC,CAAA;CAC7B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veramo/credential-status",
|
|
3
3
|
"description": "Veramo plugin for resolving a credential status",
|
|
4
|
-
"version": "3.1.5-next.
|
|
4
|
+
"version": "3.1.5-next.125+ea4966a6",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@veramo/core": "^3.1.5-next.
|
|
17
|
+
"@veramo/core": "^3.1.5-next.125+ea4966a6",
|
|
18
18
|
"credential-status": "^2.0.2",
|
|
19
19
|
"did-jwt": "^5.12.4",
|
|
20
20
|
"did-resolver": "3.2.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/debug": "4.1.7",
|
|
24
|
-
"typescript": "4.7.
|
|
24
|
+
"typescript": "4.7.3"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
27
|
"build/**/*",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"contributors": [],
|
|
39
39
|
"license": "Apache-2.0",
|
|
40
40
|
"keywords": [],
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "ea4966a6b79dc4653a2aff9147c096ee22bb47df"
|
|
42
42
|
}
|
package/plugin.schema.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|
|
8
8
|
"credential": {
|
|
9
|
-
"$ref": "#/components/schemas/
|
|
9
|
+
"$ref": "#/components/schemas/VerifiableCredential"
|
|
10
10
|
},
|
|
11
11
|
"didDoc": {
|
|
12
12
|
"$ref": "#/components/schemas/DIDDocument"
|
|
@@ -15,39 +15,121 @@
|
|
|
15
15
|
"required": [
|
|
16
16
|
"credential",
|
|
17
17
|
"didDoc"
|
|
18
|
-
]
|
|
18
|
+
],
|
|
19
|
+
"description": "Arguments for calling {@link ICheckCredentialStatus.checkCredentialStatus | checkCredentialStatus } .\n\nThe credential whose status should be checked and the DID document of the credential issuer.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status }"
|
|
19
20
|
},
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
21
|
+
"VerifiableCredential": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"properties": {
|
|
24
|
+
"proof": {
|
|
25
|
+
"$ref": "#/components/schemas/ProofType"
|
|
26
|
+
},
|
|
27
|
+
"issuer": {
|
|
28
|
+
"$ref": "#/components/schemas/IssuerType"
|
|
29
|
+
},
|
|
30
|
+
"credentialSubject": {
|
|
31
|
+
"$ref": "#/components/schemas/CredentialSubject"
|
|
32
|
+
},
|
|
33
|
+
"type": {
|
|
34
|
+
"anyOf": [
|
|
35
|
+
{
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": {
|
|
38
|
+
"type": "string"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "string"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"@context": {
|
|
47
|
+
"anyOf": [
|
|
48
|
+
{
|
|
49
|
+
"type": "array",
|
|
50
|
+
"items": {
|
|
51
|
+
"type": "string"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"type": "string"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"issuanceDate": {
|
|
60
|
+
"type": "string"
|
|
61
|
+
},
|
|
62
|
+
"expirationDate": {
|
|
23
63
|
"type": "string"
|
|
24
64
|
},
|
|
65
|
+
"credentialStatus": {
|
|
66
|
+
"$ref": "#/components/schemas/CredentialStatus"
|
|
67
|
+
},
|
|
68
|
+
"id": {
|
|
69
|
+
"type": "string"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"required": [
|
|
73
|
+
"@context",
|
|
74
|
+
"credentialSubject",
|
|
75
|
+
"issuanceDate",
|
|
76
|
+
"issuer",
|
|
77
|
+
"proof"
|
|
78
|
+
],
|
|
79
|
+
"description": "Represents a signed Verifiable Credential payload (includes proof), using a JSON representation. See {@link https://www.w3.org/TR/vc-data-model/#credentials | VC data model }"
|
|
80
|
+
},
|
|
81
|
+
"ProofType": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"properties": {
|
|
84
|
+
"type": {
|
|
85
|
+
"type": "string"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"description": "A proof property of a Verifiable Credential or Presentation"
|
|
89
|
+
},
|
|
90
|
+
"IssuerType": {
|
|
91
|
+
"anyOf": [
|
|
25
92
|
{
|
|
26
93
|
"type": "object",
|
|
27
94
|
"properties": {
|
|
28
|
-
"
|
|
29
|
-
"
|
|
95
|
+
"id": {
|
|
96
|
+
"type": "string"
|
|
30
97
|
}
|
|
31
|
-
}
|
|
98
|
+
},
|
|
99
|
+
"required": [
|
|
100
|
+
"id"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"type": "string"
|
|
32
105
|
}
|
|
33
106
|
],
|
|
34
|
-
"description": "The
|
|
107
|
+
"description": "The issuer of a Credential or the holder of a Presentation.\n\nThe value of the issuer property MUST be either a URI or an object containing an id property. It is RECOMMENDED that the URI in the issuer or its id be one which, if de-referenced, results in a document containing machine-readable information about the issuer that can be used to verify the information expressed in the credential.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#issuer | Issuer data model }"
|
|
35
108
|
},
|
|
36
|
-
"
|
|
109
|
+
"CredentialSubject": {
|
|
37
110
|
"type": "object",
|
|
38
111
|
"properties": {
|
|
39
|
-
"
|
|
112
|
+
"id": {
|
|
40
113
|
"type": "string"
|
|
41
|
-
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"description": "The value of the credentialSubject property is defined as a set of objects that contain one or more properties that are each related to a subject of the verifiable credential. Each object MAY contain an id.\n\nSee {@link https://www.w3.org/TR/vc-data-model/#credential-subject | Credential Subject }"
|
|
117
|
+
},
|
|
118
|
+
"CredentialStatus": {
|
|
119
|
+
"type": "object",
|
|
120
|
+
"properties": {
|
|
42
121
|
"id": {
|
|
43
122
|
"type": "string"
|
|
123
|
+
},
|
|
124
|
+
"type": {
|
|
125
|
+
"type": "string"
|
|
44
126
|
}
|
|
45
127
|
},
|
|
46
128
|
"required": [
|
|
47
|
-
"
|
|
48
|
-
"
|
|
129
|
+
"id",
|
|
130
|
+
"type"
|
|
49
131
|
],
|
|
50
|
-
"description": "
|
|
132
|
+
"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 }"
|
|
51
133
|
},
|
|
52
134
|
"DIDDocument": {
|
|
53
135
|
"type": "object",
|
|
@@ -286,23 +368,11 @@
|
|
|
286
368
|
"type",
|
|
287
369
|
"serviceEndpoint"
|
|
288
370
|
]
|
|
289
|
-
},
|
|
290
|
-
"CredentialStatus": {
|
|
291
|
-
"type": "object",
|
|
292
|
-
"properties": {
|
|
293
|
-
"id": {
|
|
294
|
-
"type": "string"
|
|
295
|
-
},
|
|
296
|
-
"type": {
|
|
297
|
-
"type": "string"
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
"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 }"
|
|
301
371
|
}
|
|
302
372
|
},
|
|
303
373
|
"methods": {
|
|
304
374
|
"checkCredentialStatus": {
|
|
305
|
-
"description": "",
|
|
375
|
+
"description": "Checks the status of a ",
|
|
306
376
|
"arguments": {
|
|
307
377
|
"$ref": "#/components/schemas/ICheckCredentialStatusArgs"
|
|
308
378
|
},
|
package/src/credential-status.ts
CHANGED
|
@@ -2,6 +2,24 @@ import { IAgentContext, IAgentPlugin } from '@veramo/core'
|
|
|
2
2
|
import { Status, StatusMethod } from 'credential-status'
|
|
3
3
|
import { ICheckCredentialStatus, ICheckCredentialStatusArgs } from './types'
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* This plugin implements the {@link @veramo/credential-status#ICheckCredentialStatus | ICheckCredentialStatus}
|
|
7
|
+
* interface.
|
|
8
|
+
*
|
|
9
|
+
* This aggregates some {@link credential-status#StatusMethod | credential status implementations} to provide a second
|
|
10
|
+
* layer of validation when verifying Verifiable Credentials.
|
|
11
|
+
*
|
|
12
|
+
* This is used for the discovery of information about the current status of a verifiable credential, such as whether
|
|
13
|
+
* it is suspended or revoked. The precise contents of the credential status information is determined by the specific
|
|
14
|
+
* `credentialStatus` type definition.
|
|
15
|
+
*
|
|
16
|
+
* The results provided by this plugin depend on whether the {@link credential-status#StatusMethod | StatusMethod}
|
|
17
|
+
* required by the credential is installed.
|
|
18
|
+
*
|
|
19
|
+
* @see {@link credential-status#Status}
|
|
20
|
+
*
|
|
21
|
+
* @beta This API may change without a BREAKING CHANGE notice.
|
|
22
|
+
*/
|
|
5
23
|
export class CredentialStatusPlugin implements IAgentPlugin {
|
|
6
24
|
private readonly status: Status
|
|
7
25
|
readonly methods: ICheckCredentialStatus
|
package/src/types.ts
CHANGED
|
@@ -1,20 +1,46 @@
|
|
|
1
|
-
import { IAgentContext, IPluginMethodMap } from '@veramo/core'
|
|
2
|
-
import {
|
|
1
|
+
import { IAgentContext, IPluginMethodMap, VerifiableCredential } from '@veramo/core'
|
|
2
|
+
import { CredentialStatus } from 'credential-status'
|
|
3
3
|
import { DIDDocument } from 'did-resolver'
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Arguments for calling {@link ICheckCredentialStatus.checkCredentialStatus | checkCredentialStatus}.
|
|
7
|
+
*
|
|
8
|
+
* The credential whose status should be checked and the DID document of the credential issuer.
|
|
9
|
+
*
|
|
10
|
+
* See {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status}
|
|
11
|
+
*
|
|
12
|
+
* @beta This API may change without a BREAKING CHANGE notice.
|
|
13
|
+
*/
|
|
5
14
|
export interface ICheckCredentialStatusArgs {
|
|
6
|
-
credential:
|
|
15
|
+
credential: VerifiableCredential
|
|
7
16
|
didDoc: DIDDocument
|
|
8
17
|
}
|
|
9
18
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
/**
|
|
20
|
+
* This interface defines a plugin that can check the {@link https://www.w3.org/TR/vc-data-model/#status | status} of a
|
|
21
|
+
* {@link @veramo/core#VerifiableCredential | Verifiable Credential}.
|
|
22
|
+
*
|
|
23
|
+
* This is used for the discovery of information about the current status of a verifiable credential, such as whether
|
|
24
|
+
* it is suspended or revoked. The precise contents of the credential status information is determined by the specific
|
|
25
|
+
* `credentialStatus` type definition, and varies depending on factors such as whether it is simple to implement or if
|
|
26
|
+
* it is privacy-enhancing.
|
|
27
|
+
*
|
|
28
|
+
* The result provided by implementations of this plugin depend on whether the implementation of the StatusMethod is
|
|
29
|
+
* available.
|
|
30
|
+
*
|
|
31
|
+
* @see {@link https://www.w3.org/TR/vc-data-model/#status | Credential Status} for data model documentation.
|
|
32
|
+
* @see {@link @veramo/credential-status#CredentialStatusPlugin | CredentialStatusPlugin } for an implementation.
|
|
33
|
+
*
|
|
34
|
+
* @beta This API may change without a BREAKING CHANGE notice.
|
|
35
|
+
*/
|
|
17
36
|
export interface ICheckCredentialStatus extends IPluginMethodMap {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Checks the status of a {@link @veramo/core#VerifiableCredential | Verifiable Credential}.
|
|
40
|
+
*
|
|
41
|
+
* @param args - The credential to be checked, along with the DID document of the issuer.
|
|
42
|
+
* @param context - *RESERVED* This is filled by the framework when the method is called.
|
|
43
|
+
*/
|
|
18
44
|
checkCredentialStatus(
|
|
19
45
|
args: ICheckCredentialStatusArgs,
|
|
20
46
|
context: IAgentContext<any>,
|