@sphereon/ssi-sdk.vc-status-list 0.33.1-next.3 → 0.33.1-next.68
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/dist/index.cjs +979 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +275 -0
- package/dist/index.d.ts +273 -3
- package/dist/index.js +946 -19
- package/dist/index.js.map +1 -1
- package/package.json +28 -17
- package/src/functions.ts +9 -7
- package/src/impl/IStatusList.ts +3 -3
- package/src/impl/OAuthStatusList.ts +7 -7
- package/src/impl/StatusList2021.ts +17 -9
- package/src/impl/StatusListFactory.ts +1 -1
- package/src/impl/encoding/cbor.ts +53 -42
- package/src/impl/encoding/common.ts +1 -1
- package/src/impl/encoding/jwt.ts +6 -6
- package/src/types/index.ts +19 -19
- package/src/utils.ts +6 -6
- package/dist/functions.d.ts +0 -69
- package/dist/functions.d.ts.map +0 -1
- package/dist/functions.js +0 -200
- package/dist/functions.js.map +0 -1
- package/dist/impl/IStatusList.d.ts +0 -26
- package/dist/impl/IStatusList.d.ts.map +0 -1
- package/dist/impl/IStatusList.js +0 -3
- package/dist/impl/IStatusList.js.map +0 -1
- package/dist/impl/OAuthStatusList.d.ts +0 -21
- package/dist/impl/OAuthStatusList.d.ts.map +0 -1
- package/dist/impl/OAuthStatusList.js +0 -155
- package/dist/impl/OAuthStatusList.js.map +0 -1
- package/dist/impl/StatusList2021.d.ts +0 -16
- package/dist/impl/StatusList2021.d.ts.map +0 -1
- package/dist/impl/StatusList2021.js +0 -186
- package/dist/impl/StatusList2021.js.map +0 -1
- package/dist/impl/StatusListFactory.d.ts +0 -11
- package/dist/impl/StatusListFactory.d.ts.map +0 -1
- package/dist/impl/StatusListFactory.js +0 -32
- package/dist/impl/StatusListFactory.js.map +0 -1
- package/dist/impl/encoding/cbor.d.ts +0 -6
- package/dist/impl/encoding/cbor.d.ts.map +0 -1
- package/dist/impl/encoding/cbor.js +0 -140
- package/dist/impl/encoding/cbor.js.map +0 -1
- package/dist/impl/encoding/common.d.ts +0 -12
- package/dist/impl/encoding/common.d.ts.map +0 -1
- package/dist/impl/encoding/common.js +0 -17
- package/dist/impl/encoding/common.js.map +0 -1
- package/dist/impl/encoding/jwt.d.ts +0 -9
- package/dist/impl/encoding/jwt.d.ts.map +0 -1
- package/dist/impl/encoding/jwt.js +0 -74
- package/dist/impl/encoding/jwt.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -209
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -15
- package/dist/types/index.js.map +0 -1
- package/dist/utils.d.ts +0 -17
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -88
- package/dist/utils.js.map +0 -1
package/src/impl/encoding/jwt.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CompactJWT, JoseSignatureAlgorithm } from '@sphereon/ssi-types'
|
|
2
|
-
import { createHeaderAndPayload, StatusList, StatusListJWTHeaderParameters, StatusListJWTPayload } from '@sd-jwt/jwt-status-list'
|
|
1
|
+
import { type CompactJWT, JoseSignatureAlgorithm } from '@sphereon/ssi-types'
|
|
2
|
+
import { createHeaderAndPayload, StatusList, type StatusListJWTHeaderParameters, type StatusListJWTPayload } from '@sd-jwt/jwt-status-list'
|
|
3
3
|
import base64url from 'base64url'
|
|
4
|
-
import { JWTPayload } from 'did-jwt'
|
|
5
|
-
import { IRequiredContext, SignedStatusListData } from '../../types'
|
|
6
|
-
import { DecodedStatusListPayload, resolveIdentifier } from './common'
|
|
7
|
-
import { TKeyType } from '@veramo/core'
|
|
4
|
+
import type { JWTPayload } from 'did-jwt'
|
|
5
|
+
import type { IRequiredContext, SignedStatusListData } from '../../types'
|
|
6
|
+
import { type DecodedStatusListPayload, resolveIdentifier } from './common'
|
|
7
|
+
import type { TKeyType } from '@veramo/core'
|
|
8
8
|
import { ensureManagedIdentifierResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'
|
|
9
9
|
|
|
10
10
|
const STATUS_LIST_JWT_TYP = 'statuslist+jwt'
|
package/src/types/index.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution'
|
|
1
|
+
import type { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution'
|
|
2
2
|
import {
|
|
3
|
-
ICredential,
|
|
4
|
-
ICredentialStatus,
|
|
5
|
-
IIssuer,
|
|
6
|
-
IVerifiableCredential,
|
|
7
|
-
OrPromise,
|
|
8
|
-
|
|
9
|
-
StatusListCredential,
|
|
3
|
+
type ICredential,
|
|
4
|
+
type ICredentialStatus,
|
|
5
|
+
type IIssuer,
|
|
6
|
+
type IVerifiableCredential,
|
|
7
|
+
type OrPromise,
|
|
8
|
+
type CredentialProofFormat,
|
|
9
|
+
type StatusListCredential,
|
|
10
10
|
StatusListCredentialIdMode,
|
|
11
11
|
StatusListDriverType,
|
|
12
|
-
StatusListIndexingDirection,
|
|
12
|
+
type StatusListIndexingDirection,
|
|
13
13
|
StatusListType,
|
|
14
|
-
StatusPurpose2021,
|
|
14
|
+
type StatusPurpose2021,
|
|
15
15
|
} from '@sphereon/ssi-types'
|
|
16
|
-
import {
|
|
16
|
+
import type {
|
|
17
17
|
CredentialPayload,
|
|
18
18
|
IAgentContext,
|
|
19
19
|
ICredentialIssuer,
|
|
@@ -23,9 +23,9 @@ import {
|
|
|
23
23
|
IPluginMethodMap,
|
|
24
24
|
} from '@veramo/core'
|
|
25
25
|
import { DataSource } from 'typeorm'
|
|
26
|
-
import { BitsPerStatus } from '@sd-jwt/jwt-status-list
|
|
27
|
-
import { SdJwtVcPayload } from '@sd-jwt/sd-jwt-vc'
|
|
28
|
-
import { StatusListOpts } from '@sphereon/oid4vci-common'
|
|
26
|
+
import type { BitsPerStatus } from '@sd-jwt/jwt-status-list'
|
|
27
|
+
import type { SdJwtVcPayload } from '@sd-jwt/sd-jwt-vc'
|
|
28
|
+
import type { StatusListOpts } from '@sphereon/oid4vci-common'
|
|
29
29
|
|
|
30
30
|
export enum StatusOAuth {
|
|
31
31
|
Valid = 0,
|
|
@@ -55,7 +55,7 @@ export type BaseCreateNewStatusListArgs = {
|
|
|
55
55
|
issuer: string | IIssuer
|
|
56
56
|
correlationId?: string
|
|
57
57
|
length?: number
|
|
58
|
-
proofFormat?:
|
|
58
|
+
proofFormat?: CredentialProofFormat
|
|
59
59
|
keyRef?: string
|
|
60
60
|
statusList2021?: StatusList2021Args
|
|
61
61
|
oauthStatusList?: OAuthStatusListArgs
|
|
@@ -75,7 +75,7 @@ export interface UpdateStatusListFromEncodedListArgs {
|
|
|
75
75
|
type?: StatusListType
|
|
76
76
|
statusListIndex: number | string
|
|
77
77
|
value: boolean
|
|
78
|
-
proofFormat?:
|
|
78
|
+
proofFormat?: CredentialProofFormat
|
|
79
79
|
keyRef?: string
|
|
80
80
|
correlationId?: string
|
|
81
81
|
encodedList: string
|
|
@@ -97,7 +97,7 @@ export interface StatusListResult {
|
|
|
97
97
|
statusListCredential: StatusListCredential
|
|
98
98
|
length: number
|
|
99
99
|
type: StatusListType
|
|
100
|
-
proofFormat:
|
|
100
|
+
proofFormat: CredentialProofFormat
|
|
101
101
|
id: string
|
|
102
102
|
statuslistContentType: string
|
|
103
103
|
issuer: string | IIssuer
|
|
@@ -139,7 +139,7 @@ export interface StatusList2021ToVerifiableCredentialArgs {
|
|
|
139
139
|
issuer: string | IIssuer
|
|
140
140
|
id: string
|
|
141
141
|
type?: StatusListType
|
|
142
|
-
proofFormat?:
|
|
142
|
+
proofFormat?: CredentialProofFormat
|
|
143
143
|
keyRef?: string
|
|
144
144
|
encodedList: string
|
|
145
145
|
statusPurpose: StatusPurpose2021
|
|
@@ -148,7 +148,7 @@ export interface StatusList2021ToVerifiableCredentialArgs {
|
|
|
148
148
|
export interface CreateStatusListArgs {
|
|
149
149
|
issuer: string | IIssuer
|
|
150
150
|
id: string
|
|
151
|
-
proofFormat?:
|
|
151
|
+
proofFormat?: CredentialProofFormat
|
|
152
152
|
keyRef?: string
|
|
153
153
|
correlationId?: string
|
|
154
154
|
length?: number
|
package/src/utils.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CredentialMapper,
|
|
3
|
-
IIssuer,
|
|
4
|
-
|
|
3
|
+
type IIssuer,
|
|
4
|
+
type CredentialProofFormat,
|
|
5
5
|
StatusListType,
|
|
6
6
|
StatusListType as StatusListTypeW3C,
|
|
7
|
-
StatusListCredential,
|
|
7
|
+
type StatusListCredential,
|
|
8
8
|
DocumentFormat,
|
|
9
9
|
} from '@sphereon/ssi-types'
|
|
10
10
|
import { jwtDecode } from 'jwt-decode'
|
|
@@ -38,12 +38,12 @@ export function getAssertedProperty<T extends object>(propertyName: string, obj:
|
|
|
38
38
|
return getAssertedValue(propertyName, (obj as any)[propertyName])
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
const ValidProofTypeMap = new Map<StatusListType,
|
|
41
|
+
const ValidProofTypeMap = new Map<StatusListType, CredentialProofFormat[]>([
|
|
42
42
|
[StatusListType.StatusList2021, ['jwt', 'lds', 'EthereumEip712Signature2021']],
|
|
43
43
|
[StatusListType.OAuthStatusList, ['jwt', 'cbor']],
|
|
44
44
|
])
|
|
45
45
|
|
|
46
|
-
export function assertValidProofType(type: StatusListType, proofFormat:
|
|
46
|
+
export function assertValidProofType(type: StatusListType, proofFormat: CredentialProofFormat) {
|
|
47
47
|
const validProofTypes = ValidProofTypeMap.get(type)
|
|
48
48
|
if (!validProofTypes?.includes(proofFormat)) {
|
|
49
49
|
throw Error(`Invalid proof format '${proofFormat}' for status list type ${type}`)
|
|
@@ -79,7 +79,7 @@ export function determineStatusListType(credential: StatusListCredential): Statu
|
|
|
79
79
|
throw new Error('Cannot determine status list type from credential payload')
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
export function determineProofFormat(credential: StatusListCredential):
|
|
82
|
+
export function determineProofFormat(credential: StatusListCredential): CredentialProofFormat {
|
|
83
83
|
const type: DocumentFormat = CredentialMapper.detectDocumentType(credential)
|
|
84
84
|
switch (type) {
|
|
85
85
|
case DocumentFormat.JWT:
|
package/dist/functions.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
2
|
-
import { StatusListCredential, StatusListDriverType, StatusListType, StatusPurpose2021 } from '@sphereon/ssi-types';
|
|
3
|
-
import { IAgentContext, ICredentialPlugin } from '@veramo/core';
|
|
4
|
-
import { StatusMethod } from 'credential-status';
|
|
5
|
-
import { CreateNewStatusListFuncArgs, Status2021, StatusList2021ToVerifiableCredentialArgs, StatusListResult, StatusOAuth, UpdateStatusListFromEncodedListArgs, UpdateStatusListIndexArgs } from './types';
|
|
6
|
-
export declare function fetchStatusListCredential(args: {
|
|
7
|
-
statusListCredential: string;
|
|
8
|
-
}): Promise<StatusListCredential>;
|
|
9
|
-
export declare function statusPluginStatusFunction(args: {
|
|
10
|
-
documentLoader: any;
|
|
11
|
-
suite: any;
|
|
12
|
-
mandatoryCredentialStatus?: boolean;
|
|
13
|
-
verifyStatusListCredential?: boolean;
|
|
14
|
-
verifyMatchingIssuers?: boolean;
|
|
15
|
-
errorUnknownListType?: boolean;
|
|
16
|
-
}): StatusMethod;
|
|
17
|
-
/**
|
|
18
|
-
* Function that can be used together with @digitalbazar/vc and @digitialcredentials/vc
|
|
19
|
-
* @param args
|
|
20
|
-
*/
|
|
21
|
-
export declare function vcLibCheckStatusFunction(args: {
|
|
22
|
-
mandatoryCredentialStatus?: boolean;
|
|
23
|
-
verifyStatusListCredential?: boolean;
|
|
24
|
-
verifyMatchingIssuers?: boolean;
|
|
25
|
-
errorUnknownListType?: boolean;
|
|
26
|
-
}): (args: {
|
|
27
|
-
credential: StatusListCredential;
|
|
28
|
-
documentLoader: any;
|
|
29
|
-
suite: any;
|
|
30
|
-
}) => Promise<{
|
|
31
|
-
verified: boolean;
|
|
32
|
-
error?: any;
|
|
33
|
-
}>;
|
|
34
|
-
export declare function checkStatusForCredential(args: {
|
|
35
|
-
credential: StatusListCredential;
|
|
36
|
-
documentLoader: any;
|
|
37
|
-
suite: any;
|
|
38
|
-
mandatoryCredentialStatus?: boolean;
|
|
39
|
-
verifyStatusListCredential?: boolean;
|
|
40
|
-
verifyMatchingIssuers?: boolean;
|
|
41
|
-
errorUnknownListType?: boolean;
|
|
42
|
-
}): Promise<{
|
|
43
|
-
verified: boolean;
|
|
44
|
-
error?: any;
|
|
45
|
-
}>;
|
|
46
|
-
export declare function simpleCheckStatusFromStatusListUrl(args: {
|
|
47
|
-
statusListCredential: string;
|
|
48
|
-
statusPurpose?: StatusPurpose2021;
|
|
49
|
-
type?: StatusListType | 'StatusList2021Entry';
|
|
50
|
-
id?: string;
|
|
51
|
-
statusListIndex: string;
|
|
52
|
-
}): Promise<number | Status2021 | StatusOAuth>;
|
|
53
|
-
export declare function checkStatusIndexFromStatusListCredential(args: {
|
|
54
|
-
statusListCredential: StatusListCredential;
|
|
55
|
-
statusPurpose?: StatusPurpose2021;
|
|
56
|
-
type?: StatusListType | 'StatusList2021Entry';
|
|
57
|
-
id?: string;
|
|
58
|
-
statusListIndex: string | number;
|
|
59
|
-
}): Promise<number | Status2021 | StatusOAuth>;
|
|
60
|
-
export declare function createNewStatusList(args: CreateNewStatusListFuncArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
61
|
-
export declare function updateStatusIndexFromStatusListCredential(args: UpdateStatusListIndexArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
62
|
-
export declare function statusListCredentialToDetails(args: {
|
|
63
|
-
statusListCredential: StatusListCredential;
|
|
64
|
-
correlationId?: string;
|
|
65
|
-
driverType?: StatusListDriverType;
|
|
66
|
-
}): Promise<StatusListResult>;
|
|
67
|
-
export declare function updateStatusListIndexFromEncodedList(args: UpdateStatusListFromEncodedListArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
68
|
-
export declare function statusList2021ToVerifiableCredential(args: StatusList2021ToVerifiableCredentialArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListCredential>;
|
|
69
|
-
//# sourceMappingURL=functions.d.ts.map
|
package/dist/functions.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AACnF,OAAO,EAIL,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EAClB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAiC,aAAa,EAAE,iBAAiB,EAAoC,MAAM,cAAc,CAAA;AAGhI,OAAO,EAAuB,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,EACL,2BAA2B,EAC3B,UAAU,EACV,wCAAwC,EACxC,gBAAgB,EAChB,WAAW,EACX,mCAAmC,EACnC,yBAAyB,EAC1B,MAAM,SAAS,CAAA;AAIhB,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IAAE,oBAAoB,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAgBrH;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,cAAc,EAAE,GAAG,CAAA;IACnB,KAAK,EAAE,GAAG,CAAA;IACV,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,0BAA0B,CAAC,EAAE,OAAO,CAAA;IACpC,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B,GAAG,YAAY,CAcf;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAC7C,yBAAyB,CAAC,EAAE,OAAO,CAAA;IACnC,0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AAE,MAAM,GAAG,MAAM,CAAA;CACjC,GAAG,OAAO,CAAC,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC,CAI7C;AAED,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,2BAA2B,EACjC,OAAO,EAAE,aAAa,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,GAChE,OAAO,CAAC,gBAAgB,CAAC,CAI3B;AAED,wBAAsB,yCAAyC,CAC7D,IAAI,EAAE,yBAAyB,EAC/B,OAAO,EAAE,aAAa,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,GAChE,OAAO,CAAC,gBAAgB,CAAC,CAK3B;AAGD,wBAAsB,6BAA6B,CAAC,IAAI,EAAE;IACxD,oBAAoB,EAAE,oBAAoB,CAAA;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,oBAAoB,CAAA;CAClC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA+B5B;AAED,wBAAsB,oCAAoC,CACxD,IAAI,EAAE,mCAAmC,EACzC,OAAO,EAAE,aAAa,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,GAChE,OAAO,CAAC,gBAAgB,CAAC,CAI3B;AAED,wBAAsB,oCAAoC,CACxD,IAAI,EAAE,wCAAwC,EAC9C,OAAO,EAAE,aAAa,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,GAChE,OAAO,CAAC,oBAAoB,CAAC,CAmC/B"}
|
package/dist/functions.js
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.fetchStatusListCredential = fetchStatusListCredential;
|
|
13
|
-
exports.statusPluginStatusFunction = statusPluginStatusFunction;
|
|
14
|
-
exports.vcLibCheckStatusFunction = vcLibCheckStatusFunction;
|
|
15
|
-
exports.checkStatusForCredential = checkStatusForCredential;
|
|
16
|
-
exports.simpleCheckStatusFromStatusListUrl = simpleCheckStatusFromStatusListUrl;
|
|
17
|
-
exports.checkStatusIndexFromStatusListCredential = checkStatusIndexFromStatusListCredential;
|
|
18
|
-
exports.createNewStatusList = createNewStatusList;
|
|
19
|
-
exports.updateStatusIndexFromStatusListCredential = updateStatusIndexFromStatusListCredential;
|
|
20
|
-
exports.statusListCredentialToDetails = statusListCredentialToDetails;
|
|
21
|
-
exports.updateStatusListIndexFromEncodedList = updateStatusListIndexFromEncodedList;
|
|
22
|
-
exports.statusList2021ToVerifiableCredential = statusList2021ToVerifiableCredential;
|
|
23
|
-
const ssi_types_1 = require("@sphereon/ssi-types");
|
|
24
|
-
const vc_status_list_1 = require("@sphereon/vc-status-list");
|
|
25
|
-
const utils_1 = require("./utils");
|
|
26
|
-
const StatusListFactory_1 = require("./impl/StatusListFactory");
|
|
27
|
-
function fetchStatusListCredential(args) {
|
|
28
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
const url = (0, utils_1.getAssertedValue)('statusListCredential', args.statusListCredential);
|
|
30
|
-
try {
|
|
31
|
-
const response = yield fetch(url);
|
|
32
|
-
if (!response.ok) {
|
|
33
|
-
throw Error(`Fetching status list ${url} resulted in an error: ${response.status} : ${response.statusText}`);
|
|
34
|
-
}
|
|
35
|
-
const responseAsText = yield response.text();
|
|
36
|
-
if (responseAsText.trim().startsWith('{')) {
|
|
37
|
-
return JSON.parse(responseAsText);
|
|
38
|
-
}
|
|
39
|
-
return responseAsText;
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
console.error(`Fetching status list ${url} resulted in an unexpected error: ${error instanceof Error ? error.message : JSON.stringify(error)}`);
|
|
43
|
-
throw error;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
function statusPluginStatusFunction(args) {
|
|
48
|
-
return (credential, didDoc) => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
const result = yield checkStatusForCredential(Object.assign(Object.assign({}, args), { documentLoader: args.documentLoader, credential: credential, errorUnknownListType: args.errorUnknownListType }));
|
|
50
|
-
return Object.assign({ revoked: !result.verified || result.error }, (result.error && { error: result.error }));
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Function that can be used together with @digitalbazar/vc and @digitialcredentials/vc
|
|
55
|
-
* @param args
|
|
56
|
-
*/
|
|
57
|
-
function vcLibCheckStatusFunction(args) {
|
|
58
|
-
const { mandatoryCredentialStatus, verifyStatusListCredential, verifyMatchingIssuers, errorUnknownListType } = args;
|
|
59
|
-
return (args) => {
|
|
60
|
-
return checkStatusForCredential(Object.assign(Object.assign({}, args), { mandatoryCredentialStatus,
|
|
61
|
-
verifyStatusListCredential,
|
|
62
|
-
verifyMatchingIssuers,
|
|
63
|
-
errorUnknownListType }));
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function checkStatusForCredential(args) {
|
|
67
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
var _a, _b;
|
|
69
|
-
const verifyStatusListCredential = (_a = args.verifyStatusListCredential) !== null && _a !== void 0 ? _a : true;
|
|
70
|
-
const verifyMatchingIssuers = (_b = args.verifyMatchingIssuers) !== null && _b !== void 0 ? _b : true;
|
|
71
|
-
const uniform = ssi_types_1.CredentialMapper.toUniformCredential(args.credential);
|
|
72
|
-
if (!('credentialStatus' in uniform) || !uniform.credentialStatus) {
|
|
73
|
-
if (args.mandatoryCredentialStatus) {
|
|
74
|
-
const error = 'No credential status object found in the Verifiable Credential and it is mandatory';
|
|
75
|
-
console.log(error);
|
|
76
|
-
return { verified: false, error };
|
|
77
|
-
}
|
|
78
|
-
return { verified: true };
|
|
79
|
-
}
|
|
80
|
-
if ('credentialStatus' in uniform && uniform.credentialStatus) {
|
|
81
|
-
if (uniform.credentialStatus.type === 'StatusList2021Entry') {
|
|
82
|
-
return (0, vc_status_list_1.checkStatus)(Object.assign(Object.assign({}, args), { verifyStatusListCredential, verifyMatchingIssuers }));
|
|
83
|
-
}
|
|
84
|
-
else if (args === null || args === void 0 ? void 0 : args.errorUnknownListType) {
|
|
85
|
-
const error = `Credential status type ${uniform.credentialStatus.type} is not supported, and check status has been configured to not allow for that`;
|
|
86
|
-
console.log(error);
|
|
87
|
-
return { verified: false, error };
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
console.log(`Skipped verification of status type ${uniform.credentialStatus.type} as we do not support it (yet)`);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return { verified: true };
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
function simpleCheckStatusFromStatusListUrl(args) {
|
|
97
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
return checkStatusIndexFromStatusListCredential(Object.assign(Object.assign({}, args), { statusListCredential: yield fetchStatusListCredential(args) }));
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
function checkStatusIndexFromStatusListCredential(args) {
|
|
102
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
-
const statusListType = (0, utils_1.determineStatusListType)(args.statusListCredential);
|
|
104
|
-
const implementation = (0, StatusListFactory_1.getStatusListImplementation)(statusListType);
|
|
105
|
-
return implementation.checkStatusIndex(args);
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
function createNewStatusList(args, context) {
|
|
109
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
const { type } = (0, utils_1.getAssertedValues)(args);
|
|
111
|
-
const implementation = (0, StatusListFactory_1.getStatusListImplementation)(type);
|
|
112
|
-
return implementation.createNewStatusList(args, context);
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
function updateStatusIndexFromStatusListCredential(args, context) {
|
|
116
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
-
const credential = (0, utils_1.getAssertedValue)('statusListCredential', args.statusListCredential);
|
|
118
|
-
const statusListType = (0, utils_1.determineStatusListType)(credential);
|
|
119
|
-
const implementation = (0, StatusListFactory_1.getStatusListImplementation)(statusListType);
|
|
120
|
-
return implementation.updateStatusListIndex(args, context);
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
// Keeping helper function for backward compatibility
|
|
124
|
-
function statusListCredentialToDetails(args) {
|
|
125
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
-
const credential = (0, utils_1.getAssertedValue)('statusListCredential', args.statusListCredential);
|
|
127
|
-
let statusListType;
|
|
128
|
-
const documentFormat = ssi_types_1.CredentialMapper.detectDocumentType(credential);
|
|
129
|
-
if (documentFormat === 0 /* DocumentFormat.JWT */) {
|
|
130
|
-
const [header] = credential.split('.');
|
|
131
|
-
const decodedHeader = JSON.parse(Buffer.from(header, 'base64').toString());
|
|
132
|
-
if (decodedHeader.typ === 'statuslist+jwt') {
|
|
133
|
-
statusListType = ssi_types_1.StatusListType.OAuthStatusList;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
else if (documentFormat === 4 /* DocumentFormat.MSO_MDOC */) {
|
|
137
|
-
statusListType = ssi_types_1.StatusListType.OAuthStatusList;
|
|
138
|
-
// TODO check CBOR content?
|
|
139
|
-
}
|
|
140
|
-
if (!statusListType) {
|
|
141
|
-
const uniform = ssi_types_1.CredentialMapper.toUniformCredential(credential);
|
|
142
|
-
const type = uniform.type.find((t) => t.includes('StatusList2021') || t.includes('OAuth2StatusList'));
|
|
143
|
-
if (!type) {
|
|
144
|
-
throw new Error('Invalid status list credential type');
|
|
145
|
-
}
|
|
146
|
-
statusListType = type.replace('Credential', '');
|
|
147
|
-
}
|
|
148
|
-
const implementation = (0, StatusListFactory_1.getStatusListImplementation)(statusListType);
|
|
149
|
-
return yield implementation.toStatusListDetails({
|
|
150
|
-
statusListPayload: credential,
|
|
151
|
-
correlationId: args.correlationId,
|
|
152
|
-
driverType: args.driverType,
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
function updateStatusListIndexFromEncodedList(args, context) {
|
|
157
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
-
const { type } = (0, utils_1.getAssertedValue)('type', args);
|
|
159
|
-
const implementation = (0, StatusListFactory_1.getStatusListImplementation)(type);
|
|
160
|
-
return implementation.updateStatusListFromEncodedList(args, context);
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
function statusList2021ToVerifiableCredential(args, context) {
|
|
164
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
-
var _a;
|
|
166
|
-
const { issuer, id, type } = (0, utils_1.getAssertedValues)(args);
|
|
167
|
-
const identifier = yield context.agent.identifierManagedGet({
|
|
168
|
-
identifier: typeof issuer === 'string' ? issuer : issuer.id,
|
|
169
|
-
vmRelationship: 'assertionMethod',
|
|
170
|
-
offlineWhenNoDIDRegistered: true, // FIXME Fix identifier resolution for EBSI
|
|
171
|
-
});
|
|
172
|
-
const proofFormat = (_a = args === null || args === void 0 ? void 0 : args.proofFormat) !== null && _a !== void 0 ? _a : 'lds';
|
|
173
|
-
(0, utils_1.assertValidProofType)(ssi_types_1.StatusListType.StatusList2021, proofFormat);
|
|
174
|
-
const veramoProofFormat = proofFormat;
|
|
175
|
-
const encodedList = (0, utils_1.getAssertedValue)('encodedList', args.encodedList);
|
|
176
|
-
const statusPurpose = (0, utils_1.getAssertedValue)('statusPurpose', args.statusPurpose);
|
|
177
|
-
const credential = {
|
|
178
|
-
'@context': ['https://www.w3.org/2018/credentials/v1', 'https://w3id.org/vc/status-list/2021/v1'],
|
|
179
|
-
id,
|
|
180
|
-
issuer,
|
|
181
|
-
// issuanceDate: "2021-03-10T04:24:12.164Z",
|
|
182
|
-
type: ['VerifiableCredential', `${type}Credential`],
|
|
183
|
-
credentialSubject: {
|
|
184
|
-
id,
|
|
185
|
-
type,
|
|
186
|
-
statusPurpose,
|
|
187
|
-
encodedList,
|
|
188
|
-
},
|
|
189
|
-
};
|
|
190
|
-
// TODO copy statuslist schema to local and disable fetching remote contexts
|
|
191
|
-
const verifiableCredential = yield context.agent.createVerifiableCredential({
|
|
192
|
-
credential,
|
|
193
|
-
keyRef: identifier.kmsKeyRef,
|
|
194
|
-
proofFormat: veramoProofFormat,
|
|
195
|
-
fetchRemoteContexts: true,
|
|
196
|
-
});
|
|
197
|
-
return ssi_types_1.CredentialMapper.toWrappedVerifiableCredential(verifiableCredential).original;
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
//# sourceMappingURL=functions.js.map
|
package/dist/functions.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":";;;;;;;;;;;AA0BA,8DAgBC;AAED,gEAqBC;AAMD,4DAuBC;AAED,4DAgCC;AAED,gFAWC;AAED,4FAUC;AAED,kDAOC;AAED,8FAQC;AAGD,sEAmCC;AAED,oFAOC;AAED,oFAsCC;AAlQD,mDAQ4B;AAG5B,6DAAsD;AAWtD,mCAA4G;AAC5G,gEAAsE;AAEtE,SAAsB,yBAAyB,CAAC,IAAsC;;QACpF,MAAM,GAAG,GAAG,IAAA,wBAAgB,EAAC,sBAAsB,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAA;QAC/E,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;YACjC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,MAAM,KAAK,CAAC,w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,CAAC,CAAA;QACrE,MAAM,aAAa,GAAG,IAAA,wBAAgB,EAAC,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,CAAA;QAC3E,MAAM,UAAU,GAAG;YACjB,UAAU,EAAE,CAAC,wCAAwC,EAAE,yCAAyC,CAAC;YACjG,EAAE;YACF,MAAM;YACN,4CAA4C;YAC5C,IAAI,EAAE,CAAC,sBAAsB,EAAE,GAAG,IAAI,YAAY,CAAC;YACnD,iBAAiB,EAAE;gBACjB,EAAE;gBACF,IAAI;gBACJ,aAAa;gBACb,WAAW;aACZ;SACF,CAAA;QACD,4EAA4E;QAC5E,MAAM,oBAAoB,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC;YAC1E,UAAU;YACV,MAAM,EAAE,UAAU,CAAC,SAAS;YAC5B,WAAW,EAAE,iBAAiB;YAC9B,mBAAmB,EAAE,IAAI;SAC1B,CAAC,CAAA;QAEF,OAAO,4BAAgB,CAAC,6BAA6B,CAAC,oBAA4C,CAAC,CAAC,QAAgC,CAAA;IACtI,CAAC;CAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { IAgentContext, ICredentialPlugin } from '@veramo/core';
|
|
2
|
-
import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
3
|
-
import { CheckStatusIndexArgs, CreateStatusListArgs, Status2021, StatusListResult, StatusOAuth, ToStatusListDetailsArgs, UpdateStatusListFromEncodedListArgs, UpdateStatusListIndexArgs } from '../types';
|
|
4
|
-
export interface IStatusList {
|
|
5
|
-
/**
|
|
6
|
-
* Creates a new status list of the specific type
|
|
7
|
-
*/
|
|
8
|
-
createNewStatusList(args: CreateStatusListArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
9
|
-
/**
|
|
10
|
-
* Updates a status at the given index in the status list
|
|
11
|
-
*/
|
|
12
|
-
updateStatusListIndex(args: UpdateStatusListIndexArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
13
|
-
/**
|
|
14
|
-
* Updates a status list using a base64 encoded list of statuses
|
|
15
|
-
*/
|
|
16
|
-
updateStatusListFromEncodedList(args: UpdateStatusListFromEncodedListArgs, context: IAgentContext<ICredentialPlugin & IIdentifierResolution>): Promise<StatusListResult>;
|
|
17
|
-
/**
|
|
18
|
-
* Checks the status at a given index in the status list
|
|
19
|
-
*/
|
|
20
|
-
checkStatusIndex(args: CheckStatusIndexArgs): Promise<number | Status2021 | StatusOAuth>;
|
|
21
|
-
/**
|
|
22
|
-
* Collects the status list details
|
|
23
|
-
*/
|
|
24
|
-
toStatusListDetails(args: ToStatusListDetailsArgs): Promise<StatusListResult>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=IStatusList.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IStatusList.d.ts","sourceRoot":"","sources":["../../src/impl/IStatusList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AACnF,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,uBAAuB,EACvB,mCAAmC,EACnC,yBAAyB,EAC1B,MAAM,UAAU,CAAA;AAEjB,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,mBAAmB,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,aAAa,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAE7I;;OAEG;IACH,qBAAqB,CAAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,aAAa,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAEpJ;;OAEG;IACH,+BAA+B,CAC7B,IAAI,EAAE,mCAAmC,EACzC,OAAO,EAAE,aAAa,CAAC,iBAAiB,GAAG,qBAAqB,CAAC,GAChE,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAE5B;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC,CAAA;IAExF;;OAEG;IACH,mBAAmB,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;CAC9E"}
|
package/dist/impl/IStatusList.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IStatusList.js","sourceRoot":"","sources":["../../src/impl/IStatusList.ts"],"names":[],"mappings":""}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { IAgentContext, ICredentialPlugin, IKeyManager } from '@veramo/core';
|
|
2
|
-
import { ProofFormat } from '@sphereon/ssi-types';
|
|
3
|
-
import { CheckStatusIndexArgs, CreateStatusListArgs, StatusListResult, StatusOAuth, ToStatusListDetailsArgs, UpdateStatusListFromEncodedListArgs, UpdateStatusListIndexArgs } from '../types';
|
|
4
|
-
import { IStatusList } from './IStatusList';
|
|
5
|
-
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
6
|
-
import { IIdentifierResolution } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
7
|
-
type IRequiredContext = IAgentContext<ICredentialPlugin & IJwtService & IIdentifierResolution & IKeyManager>;
|
|
8
|
-
export declare const DEFAULT_BITS_PER_STATUS = 1;
|
|
9
|
-
export declare const DEFAULT_LIST_LENGTH = 250000;
|
|
10
|
-
export declare const DEFAULT_PROOF_FORMAT: ProofFormat;
|
|
11
|
-
export declare class OAuthStatusListImplementation implements IStatusList {
|
|
12
|
-
createNewStatusList(args: CreateStatusListArgs, context: IRequiredContext): Promise<StatusListResult>;
|
|
13
|
-
updateStatusListIndex(args: UpdateStatusListIndexArgs, context: IRequiredContext): Promise<StatusListResult>;
|
|
14
|
-
updateStatusListFromEncodedList(args: UpdateStatusListFromEncodedListArgs, context: IRequiredContext): Promise<StatusListResult>;
|
|
15
|
-
private buildContentType;
|
|
16
|
-
checkStatusIndex(args: CheckStatusIndexArgs): Promise<number | StatusOAuth>;
|
|
17
|
-
toStatusListDetails(args: ToStatusListDetailsArgs): Promise<StatusListResult>;
|
|
18
|
-
private createSignedStatusList;
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=OAuthStatusList.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OAuthStatusList.d.ts","sourceRoot":"","sources":["../../src/impl/OAuthStatusList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC5E,OAAO,EAAmB,WAAW,EAAkB,MAAM,qBAAqB,CAAA;AAClF,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EAEpB,gBAAgB,EAChB,WAAW,EACX,uBAAuB,EACvB,mCAAmC,EACnC,yBAAyB,EAC1B,MAAM,UAAU,CAAA;AAEjB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAInF,KAAK,gBAAgB,GAAG,aAAa,CAAC,iBAAiB,GAAG,WAAW,GAAG,qBAAqB,GAAG,WAAW,CAAC,CAAA;AAE5G,eAAO,MAAM,uBAAuB,IAAI,CAAA;AACxC,eAAO,MAAM,mBAAmB,SAAS,CAAA;AACzC,eAAO,MAAM,oBAAoB,EAAY,WAAW,CAAA;AAExD,qBAAa,6BAA8B,YAAW,WAAW;IACzD,mBAAmB,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAg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