@sphereon/oid4vci-client 0.10.4-unstable.81 → 0.12.0
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/README.md +7 -9
- package/dist/AccessTokenClient.d.ts.map +1 -1
- package/dist/AccessTokenClient.js +16 -22
- package/dist/AccessTokenClient.js.map +1 -1
- package/dist/AccessTokenClientV1_0_11.d.ts.map +1 -1
- package/dist/AccessTokenClientV1_0_11.js +4 -7
- package/dist/AccessTokenClientV1_0_11.js.map +1 -1
- package/dist/AuthorizationCodeClient.d.ts +4 -1
- package/dist/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/AuthorizationCodeClient.js +47 -8
- package/dist/AuthorizationCodeClient.js.map +1 -1
- package/dist/AuthorizationCodeClientV1_0_11.d.ts.map +1 -1
- package/dist/AuthorizationCodeClientV1_0_11.js +5 -3
- package/dist/AuthorizationCodeClientV1_0_11.js.map +1 -1
- package/dist/CredentialOfferClient.d.ts.map +1 -1
- package/dist/CredentialOfferClient.js +27 -11
- package/dist/CredentialOfferClient.js.map +1 -1
- package/dist/CredentialOfferClientV1_0_11.d.ts.map +1 -1
- package/dist/CredentialOfferClientV1_0_11.js +9 -11
- package/dist/CredentialOfferClientV1_0_11.js.map +1 -1
- package/dist/CredentialOfferClientV1_0_13.d.ts +10 -0
- package/dist/CredentialOfferClientV1_0_13.d.ts.map +1 -0
- package/dist/CredentialOfferClientV1_0_13.js +94 -0
- package/dist/CredentialOfferClientV1_0_13.js.map +1 -0
- package/dist/CredentialRequestClient.d.ts +22 -6
- package/dist/CredentialRequestClient.d.ts.map +1 -1
- package/dist/CredentialRequestClient.js +54 -26
- package/dist/CredentialRequestClient.js.map +1 -1
- package/dist/CredentialRequestClientBuilder.d.ts +10 -5
- package/dist/CredentialRequestClientBuilder.d.ts.map +1 -1
- package/dist/CredentialRequestClientBuilder.js +21 -7
- package/dist/CredentialRequestClientBuilder.js.map +1 -1
- package/dist/CredentialRequestClientBuilderV1_0_11.d.ts +3 -1
- package/dist/CredentialRequestClientBuilderV1_0_11.d.ts.map +1 -1
- package/dist/CredentialRequestClientBuilderV1_0_11.js +4 -0
- package/dist/CredentialRequestClientBuilderV1_0_11.js.map +1 -1
- package/dist/CredentialRequestClientV1_0_11.d.ts +9 -3
- package/dist/CredentialRequestClientV1_0_11.d.ts.map +1 -1
- package/dist/CredentialRequestClientV1_0_11.js +3 -3
- package/dist/CredentialRequestClientV1_0_11.js.map +1 -1
- package/dist/MetadataClient.d.ts +5 -5
- package/dist/MetadataClient.d.ts.map +1 -1
- package/dist/MetadataClient.js +30 -13
- package/dist/MetadataClient.js.map +1 -1
- package/dist/MetadataClientV1_0_13.d.ts +31 -0
- package/dist/MetadataClientV1_0_13.d.ts.map +1 -0
- package/dist/MetadataClientV1_0_13.js +181 -0
- package/dist/MetadataClientV1_0_13.js.map +1 -0
- package/dist/OpenID4VCIClient.d.ts +25 -23
- package/dist/OpenID4VCIClient.d.ts.map +1 -1
- package/dist/OpenID4VCIClient.js +157 -63
- package/dist/OpenID4VCIClient.js.map +1 -1
- package/dist/OpenID4VCIClientV1_0_11.d.ts +3 -2
- package/dist/OpenID4VCIClientV1_0_11.d.ts.map +1 -1
- package/dist/OpenID4VCIClientV1_0_11.js +5 -18
- package/dist/OpenID4VCIClientV1_0_11.js.map +1 -1
- package/dist/OpenID4VCIClientV1_0_13.d.ts +112 -0
- package/dist/OpenID4VCIClientV1_0_13.d.ts.map +1 -0
- package/dist/OpenID4VCIClientV1_0_13.js +478 -0
- package/dist/OpenID4VCIClientV1_0_13.js.map +1 -0
- package/dist/ProofOfPossessionBuilder.d.ts +14 -3
- package/dist/ProofOfPossessionBuilder.d.ts.map +1 -1
- package/dist/ProofOfPossessionBuilder.js +20 -21
- package/dist/ProofOfPossessionBuilder.js.map +1 -1
- package/dist/functions/index.d.ts +2 -3
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.js +2 -3
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/notifications.d.ts +4 -0
- package/dist/functions/notifications.d.ts.map +1 -0
- package/dist/functions/notifications.js +39 -0
- package/dist/functions/notifications.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -1
- package/lib/AccessTokenClient.ts +17 -24
- package/lib/AccessTokenClientV1_0_11.ts +5 -10
- package/lib/AuthorizationCodeClient.ts +47 -8
- package/lib/AuthorizationCodeClientV1_0_11.ts +8 -6
- package/lib/CredentialOfferClient.ts +32 -7
- package/lib/CredentialOfferClientV1_0_11.ts +8 -8
- package/lib/CredentialOfferClientV1_0_13.ts +103 -0
- package/lib/CredentialRequestClient.ts +80 -20
- package/lib/CredentialRequestClientBuilder.ts +29 -9
- package/lib/CredentialRequestClientBuilderV1_0_11.ts +7 -0
- package/lib/CredentialRequestClientV1_0_11.ts +11 -5
- package/lib/MetadataClient.ts +49 -14
- package/lib/MetadataClientV1_0_13.ts +188 -0
- package/lib/OpenID4VCIClient.ts +194 -81
- package/lib/OpenID4VCIClientV1_0_11.ts +9 -19
- package/lib/OpenID4VCIClientV1_0_13.ts +677 -0
- package/lib/ProofOfPossessionBuilder.ts +41 -11
- package/lib/__tests__/CredentialRequestClient.spec.ts +13 -81
- package/lib/__tests__/CredentialRequestClientBuilder.spec.ts +4 -41
- package/lib/__tests__/CredentialRequestClientV1_0_11.spec.ts +2 -98
- package/lib/__tests__/HttpUtils.spec.ts +1 -1
- package/lib/__tests__/IT.spec.ts +5 -135
- package/lib/__tests__/MetadataClient.spec.ts +3 -4
- package/lib/__tests__/MetadataMocks.ts +1 -0
- package/lib/__tests__/OpenID4VCIClient.spec.ts +42 -9
- package/lib/__tests__/OpenID4VCIClientV1_0_11.spec.ts +24 -0
- package/lib/__tests__/OpenID4VCIClientV1_0_13.spec.ts +204 -0
- package/lib/__tests__/ProofOfPossessionBuilder.spec.ts +1 -84
- package/lib/__tests__/SdJwt.spec.ts +10 -109
- package/lib/__tests__/SphereonE2E.spec.test.ts +5 -3
- package/lib/functions/index.ts +2 -3
- package/lib/functions/notifications.ts +32 -0
- package/lib/index.ts +8 -0
- package/lib/types/index.ts +6 -0
- package/package.json +4 -4
- package/dist/functions/ProofUtil.d.ts +0 -31
- package/dist/functions/ProofUtil.d.ts.map +0 -1
- package/dist/functions/ProofUtil.js +0 -103
- package/dist/functions/ProofUtil.js.map +0 -1
- package/lib/functions/ProofUtil.ts +0 -137
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialOfferClient.js","sourceRoot":"","sources":["../lib/CredentialOfferClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"CredentialOfferClient.js","sourceRoot":"","sources":["../lib/CredentialOfferClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAakC;AAClC,kDAA0B;AAE1B,mCAA8B;AAE9B,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,wBAAwB,CAAC,CAAC;AAE9C,MAAa,qBAAqB;IACzB,MAAM,CAAO,OAAO,CAAC,GAAW,EAAE,IAA4B;;;YACnE,KAAK,CAAC,yBAAyB,GAAG,EAAE,CAAC,CAAC;YACtC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC/C,KAAK,CAAC,iCAAiC,GAAG,EAAE,CAAC,CAAC;gBAC9C,MAAM,KAAK,CAAC,kCAAkC,CAAC,CAAC;YAClD,CAAC;YACD,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACnC,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAA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D,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,IAAA,iCAAgB,EAAC,MAAA,kBAAkB,CAAC,oBAAoB,mCAAI,kBAAkB,CAAC,yBAAyB,EAAE;YAC/G,OAAO;YACP,mBAAmB,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC;YACrD,iBAAiB,EAAE,KAAK;gBACtB,CAAC,CAAC,CAAC,sBAAsB,CAAC;gBAC1B,CAAC,CAAC,OAAO,IAAI,kCAAiB,CAAC,UAAU;oBACvC,CAAC,CAAC,CAAC,mBAAmB,EAAE,iBAAiB,CAAC;oBAC1C,CAAC,CAAC,CAAC,QAAQ,EAAE,iBAAiB,CAAC;YACnC,KAAK;YACL,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF;AAvGD,sDAuGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialOfferClientV1_0_11.d.ts","sourceRoot":"","sources":["../lib/CredentialOfferClientV1_0_11.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CredentialOfferClientV1_0_11.d.ts","sourceRoot":"","sources":["../lib/CredentialOfferClientV1_0_11.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,iCAAiC,EACjC,wCAAwC,EAIxC,iBAAiB,EAElB,MAAM,0BAA0B,CAAC;AAKlC,qBAAa,4BAA4B;WACnB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,wCAAwC,CAAC;WAiD3G,KAAK,CACjB,kBAAkB,EAAE,iCAAiC,EACrD,IAAI,CAAC,EAAE;QACL,OAAO,CAAC,EAAE,iBAAiB,CAAC;KAC7B,GACA,MAAM;CAsCV"}
|
|
@@ -15,7 +15,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.CredentialOfferClientV1_0_11 = void 0;
|
|
16
16
|
const oid4vci_common_1 = require("@sphereon/oid4vci-common");
|
|
17
17
|
const debug_1 = __importDefault(require("debug"));
|
|
18
|
-
const functions_1 = require("./functions");
|
|
19
18
|
const debug = (0, debug_1.default)('sphereon:oid4vci:offer');
|
|
20
19
|
class CredentialOfferClientV1_0_11 {
|
|
21
20
|
static fromURI(uri, opts) {
|
|
@@ -32,31 +31,30 @@ class CredentialOfferClientV1_0_11 {
|
|
|
32
31
|
let credentialOffer;
|
|
33
32
|
let credentialOfferPayload;
|
|
34
33
|
if (version < oid4vci_common_1.OpenId4VCIVersion.VER_1_0_11) {
|
|
35
|
-
credentialOfferPayload = (0,
|
|
34
|
+
credentialOfferPayload = (0, oid4vci_common_1.convertURIToJsonObject)(uri, {
|
|
36
35
|
arrayTypeProperties: ['credential_type'],
|
|
37
|
-
requiredProperties: uri.includes('credential_offer_uri=') ? ['credential_offer_uri'] : ['issuer', 'credential_type'],
|
|
36
|
+
requiredProperties: uri.includes('credential_offer_uri=') ? ['credential_offer_uri='] : ['issuer', 'credential_type='],
|
|
38
37
|
});
|
|
39
38
|
credentialOffer = {
|
|
40
39
|
credential_offer: credentialOfferPayload,
|
|
41
40
|
};
|
|
42
41
|
}
|
|
43
42
|
else {
|
|
44
|
-
credentialOffer = (0,
|
|
43
|
+
credentialOffer = (0, oid4vci_common_1.convertURIToJsonObject)(uri, {
|
|
45
44
|
arrayTypeProperties: ['credentials'],
|
|
46
|
-
requiredProperties: uri.includes('credential_offer_uri=') ? ['credential_offer_uri'] : ['credential_offer'],
|
|
45
|
+
requiredProperties: uri.includes('credential_offer_uri=') ? ['credential_offer_uri='] : ['credential_offer='],
|
|
47
46
|
});
|
|
48
47
|
if ((credentialOffer === null || credentialOffer === void 0 ? void 0 : credentialOffer.credential_offer_uri) === undefined && !(credentialOffer === null || credentialOffer === void 0 ? void 0 : credentialOffer.credential_offer)) {
|
|
49
48
|
throw Error('Either a credential_offer or credential_offer_uri should be present in ' + uri);
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
|
-
const request = yield (0, oid4vci_common_1.
|
|
51
|
+
const request = yield (0, oid4vci_common_1.toUniformCredentialOfferRequest)(credentialOffer, Object.assign(Object.assign({}, opts), { version }));
|
|
53
52
|
const clientId = (0, oid4vci_common_1.getClientIdFromCredentialOfferPayload)(request.credential_offer);
|
|
54
53
|
const grants = (_a = request.credential_offer) === null || _a === void 0 ? void 0 : _a.grants;
|
|
55
|
-
return Object.assign(Object.assign(Object.assign(Object.assign({ scheme,
|
|
56
|
-
baseUrl,
|
|
57
|
-
clientId }, request), (((_b = grants === null || grants === void 0 ? void 0 : grants.authorization_code) === null || _b === void 0 ? void 0 : _b.issuer_state) && { issuerState: grants.authorization_code.issuer_state })), (((_c = grants === null || grants === void 0 ? void 0 : grants['urn:ietf:params:oauth:grant-type:pre-authorized_code']) === null || _c === void 0 ? void 0 : _c['pre-authorized_code']) && {
|
|
54
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ scheme,
|
|
55
|
+
baseUrl }, (clientId && { clientId })), request), (((_b = grants === null || grants === void 0 ? void 0 : grants.authorization_code) === null || _b === void 0 ? void 0 : _b.issuer_state) && { issuerState: grants.authorization_code.issuer_state })), (((_c = grants === null || grants === void 0 ? void 0 : grants['urn:ietf:params:oauth:grant-type:pre-authorized_code']) === null || _c === void 0 ? void 0 : _c['pre-authorized_code']) && {
|
|
58
56
|
preAuthorizedCode: grants['urn:ietf:params:oauth:grant-type:pre-authorized_code']['pre-authorized_code'],
|
|
59
|
-
})), { userPinRequired: (_g = (_f = (_e = (_d = request.credential_offer) === null || _d === void 0 ? void 0 : _d.grants) === null || _e === void 0 ? void 0 : _e['urn:ietf:params:oauth:grant-type:pre-authorized_code']) === null || _f === void 0 ? void 0 : _f.user_pin_required) !== null && _g !== void 0 ? _g : false });
|
|
57
|
+
})), { userPinRequired: (_g = !!((_f = (_e = (_d = request.credential_offer) === null || _d === void 0 ? void 0 : _d.grants) === null || _e === void 0 ? void 0 : _e['urn:ietf:params:oauth:grant-type:pre-authorized_code']) === null || _f === void 0 ? void 0 : _f.user_pin_required)) !== null && _g !== void 0 ? _g : false });
|
|
60
58
|
});
|
|
61
59
|
}
|
|
62
60
|
static toURI(requestWithBaseUrl, opts) {
|
|
@@ -86,7 +84,7 @@ class CredentialOfferClientV1_0_11 {
|
|
|
86
84
|
}
|
|
87
85
|
}
|
|
88
86
|
}
|
|
89
|
-
return (0,
|
|
87
|
+
return (0, oid4vci_common_1.convertJsonToURI)((_b = requestWithBaseUrl.credential_offer_uri) !== null && _b !== void 0 ? _b : requestWithBaseUrl.original_credential_offer, {
|
|
90
88
|
baseUrl,
|
|
91
89
|
arrayTypeProperties: isUri ? [] : ['credential_type'],
|
|
92
90
|
uriTypeProperties: isUri
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialOfferClientV1_0_11.js","sourceRoot":"","sources":["../lib/CredentialOfferClientV1_0_11.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"CredentialOfferClientV1_0_11.js","sourceRoot":"","sources":["../lib/CredentialOfferClientV1_0_11.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAakC;AAClC,kDAA0B;AAE1B,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,wBAAwB,CAAC,CAAC;AAE9C,MAAa,4BAA4B;IAChC,MAAM,CAAO,OAAO,CAAC,GAAW,EAAE,IAA4B;;;YACnE,KAAK,CAAC,yBAAyB,GAAG,EAAE,CAAC,CAAC;YACtC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC/C,KAAK,CAAC,iCAAiC,GAAG,EAAE,CAAC,CAAC;gBAC9C,MAAM,KAAK,CAAC,kCAAkC,CAAC,CAAC;YAClD,CAAC;YACD,MAAM,MAAM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B,CAAC;gBAC1B,CAAC,CAAC,OAAO,IAAI,kCAAiB,CAAC,UAAU;oBACvC,CAAC,CAAC,CAAC,mBAAmB,EAAE,iBAAiB,CAAC;oBAC1C,CAAC,CAAC,CAAC,QAAQ,EAAE,iBAAiB,CAAC;YACnC,KAAK;YACL,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF;AA7FD,oEA6FC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CredentialOfferRequestWithBaseUrl, OpenId4VCIVersion } from '@sphereon/oid4vci-common';
|
|
2
|
+
export declare class CredentialOfferClientV1_0_13 {
|
|
3
|
+
static fromURI(uri: string, opts?: {
|
|
4
|
+
resolve?: boolean;
|
|
5
|
+
}): Promise<CredentialOfferRequestWithBaseUrl>;
|
|
6
|
+
static toURI(requestWithBaseUrl: CredentialOfferRequestWithBaseUrl, opts?: {
|
|
7
|
+
version?: OpenId4VCIVersion;
|
|
8
|
+
}): string;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=CredentialOfferClientV1_0_13.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CredentialOfferClientV1_0_13.d.ts","sourceRoot":"","sources":["../lib/CredentialOfferClientV1_0_13.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,iCAAiC,EAIjC,iBAAiB,EAElB,MAAM,0BAA0B,CAAC;AAKlC,qBAAa,4BAA4B;WACnB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,iCAAiC,CAAC;WA4CpG,KAAK,CACjB,kBAAkB,EAAE,iCAAiC,EACrD,IAAI,CAAC,EAAE;QACL,OAAO,CAAC,EAAE,iBAAiB,CAAC;KAC7B,GACA,MAAM;CAsCV"}
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.CredentialOfferClientV1_0_13 = void 0;
|
|
16
|
+
const oid4vci_common_1 = require("@sphereon/oid4vci-common");
|
|
17
|
+
const debug_1 = __importDefault(require("debug"));
|
|
18
|
+
const debug = (0, debug_1.default)('sphereon:oid4vci:offer');
|
|
19
|
+
class CredentialOfferClientV1_0_13 {
|
|
20
|
+
static fromURI(uri, opts) {
|
|
21
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
debug(`Credential Offer URI: ${uri}`);
|
|
24
|
+
if (!uri.includes('?') || !uri.includes('://')) {
|
|
25
|
+
debug(`Invalid Credential Offer URI: ${uri}`);
|
|
26
|
+
throw Error(`Invalid Credential Offer Request`);
|
|
27
|
+
}
|
|
28
|
+
const scheme = uri.split('://')[0];
|
|
29
|
+
const baseUrl = uri.split('?')[0];
|
|
30
|
+
const version = (0, oid4vci_common_1.determineSpecVersionFromURI)(uri);
|
|
31
|
+
const credentialOffer = (0, oid4vci_common_1.convertURIToJsonObject)(uri, {
|
|
32
|
+
// It must have the '=' sign after credential_offer otherwise the uri will get split at openid_credential_offer
|
|
33
|
+
arrayTypeProperties: uri.includes('credential_offer_uri=')
|
|
34
|
+
? ['credential_configuration_ids', 'credential_offer_uri=']
|
|
35
|
+
: ['credential_configuration_ids', 'credential_offer='],
|
|
36
|
+
requiredProperties: uri.includes('credential_offer_uri=') ? ['credential_offer_uri='] : ['credential_offer='],
|
|
37
|
+
});
|
|
38
|
+
if ((credentialOffer === null || credentialOffer === void 0 ? void 0 : credentialOffer.credential_offer_uri) === undefined && !(credentialOffer === null || credentialOffer === void 0 ? void 0 : credentialOffer.credential_offer)) {
|
|
39
|
+
throw Error('Either a credential_offer or credential_offer_uri should be present in ' + uri);
|
|
40
|
+
}
|
|
41
|
+
const request = yield (0, oid4vci_common_1.toUniformCredentialOfferRequest)(credentialOffer, Object.assign(Object.assign({}, opts), { version }));
|
|
42
|
+
const clientId = (0, oid4vci_common_1.getClientIdFromCredentialOfferPayload)(request.credential_offer);
|
|
43
|
+
const grants = (_a = request.credential_offer) === null || _a === void 0 ? void 0 : _a.grants;
|
|
44
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ scheme,
|
|
45
|
+
baseUrl }, (clientId && { clientId })), request), (((_b = grants === null || grants === void 0 ? void 0 : grants.authorization_code) === null || _b === void 0 ? void 0 : _b.issuer_state) && { issuerState: grants.authorization_code.issuer_state })), (((_c = grants === null || grants === void 0 ? void 0 : grants['urn:ietf:params:oauth:grant-type:pre-authorized_code']) === null || _c === void 0 ? void 0 : _c['pre-authorized_code']) && {
|
|
46
|
+
preAuthorizedCode: grants['urn:ietf:params:oauth:grant-type:pre-authorized_code']['pre-authorized_code'],
|
|
47
|
+
})), { userPinRequired: (_g = !!((_f = (_e = (_d = request.credential_offer) === null || _d === void 0 ? void 0 : _d.grants) === null || _e === void 0 ? void 0 : _e['urn:ietf:params:oauth:grant-type:pre-authorized_code']) === null || _f === void 0 ? void 0 : _f.tx_code)) !== null && _g !== void 0 ? _g : false }), (((_k = (_j = (_h = request.credential_offer) === null || _h === void 0 ? void 0 : _h.grants) === null || _j === void 0 ? void 0 : _j['urn:ietf:params:oauth:grant-type:pre-authorized_code']) === null || _k === void 0 ? void 0 : _k.tx_code) &&
|
|
48
|
+
{
|
|
49
|
+
// txCode: request.credential_offer?.grants?.['urn:ietf:params:oauth:grant-type:pre-authorized_code']?.tx_code,
|
|
50
|
+
}));
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
static toURI(requestWithBaseUrl, opts) {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
debug(`Credential Offer Request with base URL: ${JSON.stringify(requestWithBaseUrl)}`);
|
|
56
|
+
const version = (_a = opts === null || opts === void 0 ? void 0 : opts.version) !== null && _a !== void 0 ? _a : requestWithBaseUrl.version;
|
|
57
|
+
let baseUrl = requestWithBaseUrl.baseUrl.includes(requestWithBaseUrl.scheme)
|
|
58
|
+
? requestWithBaseUrl.baseUrl
|
|
59
|
+
: `${requestWithBaseUrl.scheme.replace('://', '')}://${requestWithBaseUrl.baseUrl}`;
|
|
60
|
+
let param;
|
|
61
|
+
const isUri = requestWithBaseUrl.credential_offer_uri !== undefined;
|
|
62
|
+
if (version.valueOf() >= oid4vci_common_1.OpenId4VCIVersion.VER_1_0_11.valueOf()) {
|
|
63
|
+
// v11 changed from encoding every param to a encoded json object with a credential_offer param key
|
|
64
|
+
if (!baseUrl.includes('?')) {
|
|
65
|
+
param = isUri ? 'credential_offer_uri' : 'credential_offer';
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const split = baseUrl.split('?');
|
|
69
|
+
if (split.length > 1 && split[1] !== '') {
|
|
70
|
+
if (baseUrl.endsWith('&')) {
|
|
71
|
+
param = isUri ? 'credential_offer_uri' : 'credential_offer';
|
|
72
|
+
}
|
|
73
|
+
else if (!baseUrl.endsWith('=')) {
|
|
74
|
+
baseUrl += `&`;
|
|
75
|
+
param = isUri ? 'credential_offer_uri' : 'credential_offer';
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return (0, oid4vci_common_1.convertJsonToURI)((_b = requestWithBaseUrl.credential_offer_uri) !== null && _b !== void 0 ? _b : requestWithBaseUrl.original_credential_offer, {
|
|
81
|
+
baseUrl,
|
|
82
|
+
arrayTypeProperties: isUri ? [] : ['credential_type'],
|
|
83
|
+
uriTypeProperties: isUri
|
|
84
|
+
? ['credential_offer_uri']
|
|
85
|
+
: version >= oid4vci_common_1.OpenId4VCIVersion.VER_1_0_13
|
|
86
|
+
? ['credential_issuer', 'credential_type']
|
|
87
|
+
: ['issuer', 'credential_type'],
|
|
88
|
+
param,
|
|
89
|
+
version,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.CredentialOfferClientV1_0_13 = CredentialOfferClientV1_0_13;
|
|
94
|
+
//# sourceMappingURL=CredentialOfferClientV1_0_13.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CredentialOfferClientV1_0_13.js","sourceRoot":"","sources":["../lib/CredentialOfferClientV1_0_13.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DASkC;AAClC,kDAA0B;AAE1B,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,wBAAwB,CAAC,CAAC;AAE9C,MAAa,4BAA4B;IAChC,MAAM,CAAO,OAAO,CAAC,GAAW,EAAE,IAA4B;;;YACnE,KAAK,CAAC,yBAAyB,GAAG,EAAE,CAAC,CAAC;YACtC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC/C,KAAK,CAAC,iCAAiC,GAAG,EAAE,CAAC,CAAC;gBAC9C,MAAM,KAAK,CAAC,kCAAkC,CAAC,CAAC;YAClD,CAAC;YACD,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACnC,MAAM,O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|
|
1
1
|
import { CredentialRequestV1_0_13, CredentialResponse, OID4VCICredentialFormat, OpenId4VCIVersion, OpenIDResponse, ProofOfPossession, UniformCredentialRequest } from '@sphereon/oid4vci-common';
|
|
2
|
+
import { ExperimentalSubjectIssuance } from '@sphereon/oid4vci-common/dist/experimental/holder-vci';
|
|
2
3
|
import { CredentialFormat } from '@sphereon/ssi-types';
|
|
3
4
|
import { CredentialRequestClientBuilder } from './CredentialRequestClientBuilder';
|
|
4
5
|
import { ProofOfPossessionBuilder } from './ProofOfPossessionBuilder';
|
|
@@ -6,12 +7,15 @@ export interface CredentialRequestOpts {
|
|
|
6
7
|
deferredCredentialAwait?: boolean;
|
|
7
8
|
deferredCredentialIntervalInMS?: number;
|
|
8
9
|
credentialEndpoint: string;
|
|
10
|
+
notificationEndpoint?: string;
|
|
9
11
|
deferredCredentialEndpoint?: string;
|
|
10
|
-
|
|
12
|
+
credentialTypes?: string[];
|
|
13
|
+
credentialIdentifier?: string;
|
|
11
14
|
format?: CredentialFormat | OID4VCICredentialFormat;
|
|
12
15
|
proof: ProofOfPossession;
|
|
13
16
|
token: string;
|
|
14
17
|
version: OpenId4VCIVersion;
|
|
18
|
+
subjectIssuance?: ExperimentalSubjectIssuance;
|
|
15
19
|
}
|
|
16
20
|
export declare function buildProof<DIDDoc>(proofInput: ProofOfPossessionBuilder<DIDDoc> | ProofOfPossession, opts: {
|
|
17
21
|
version: OpenId4VCIVersion;
|
|
@@ -27,17 +31,29 @@ export declare class CredentialRequestClient {
|
|
|
27
31
|
constructor(builder: CredentialRequestClientBuilder);
|
|
28
32
|
acquireCredentialsUsingProof<DIDDoc>(opts: {
|
|
29
33
|
proofInput: ProofOfPossessionBuilder<DIDDoc> | ProofOfPossession;
|
|
30
|
-
|
|
34
|
+
credentialIdentifier?: string;
|
|
35
|
+
credentialTypes?: string | string[];
|
|
36
|
+
context?: string[];
|
|
31
37
|
format?: CredentialFormat | OID4VCICredentialFormat;
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
subjectIssuance?: ExperimentalSubjectIssuance;
|
|
39
|
+
}): Promise<OpenIDResponse<CredentialResponse> & {
|
|
40
|
+
access_token: string;
|
|
41
|
+
}>;
|
|
42
|
+
acquireCredentialsUsingRequest(uniformRequest: UniformCredentialRequest): Promise<OpenIDResponse<CredentialResponse> & {
|
|
43
|
+
access_token: string;
|
|
44
|
+
}>;
|
|
34
45
|
acquireDeferredCredential(response: Pick<CredentialResponse, 'transaction_id' | 'acceptance_token' | 'c_nonce'>, opts?: {
|
|
35
46
|
bearerToken?: string;
|
|
36
|
-
}): Promise<OpenIDResponse<CredentialResponse
|
|
47
|
+
}): Promise<OpenIDResponse<CredentialResponse> & {
|
|
48
|
+
access_token: string;
|
|
49
|
+
}>;
|
|
37
50
|
createCredentialRequest<DIDDoc>(opts: {
|
|
38
51
|
proofInput: ProofOfPossessionBuilder<DIDDoc> | ProofOfPossession;
|
|
39
|
-
|
|
52
|
+
credentialIdentifier?: string;
|
|
53
|
+
credentialTypes?: string | string[];
|
|
54
|
+
context?: string[];
|
|
40
55
|
format?: CredentialFormat | OID4VCICredentialFormat;
|
|
56
|
+
subjectIssuance?: ExperimentalSubjectIssuance;
|
|
41
57
|
version: OpenId4VCIVersion;
|
|
42
58
|
}): Promise<CredentialRequestV1_0_13>;
|
|
43
59
|
private version;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialRequestClient.d.ts","sourceRoot":"","sources":["../lib/CredentialRequestClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,wBAAwB,EACxB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"CredentialRequestClient.d.ts","sourceRoot":"","sources":["../lib/CredentialRequestClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,wBAAwB,EACxB,kBAAkB,EAMlB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EAEd,iBAAiB,EACjB,wBAAwB,EAEzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,2BA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= void 0;
|
|
|
16
16
|
const oid4vci_common_1 = require("@sphereon/oid4vci-common");
|
|
17
17
|
const debug_1 = __importDefault(require("debug"));
|
|
18
18
|
const ProofOfPossessionBuilder_1 = require("./ProofOfPossessionBuilder");
|
|
19
|
-
const functions_1 = require("./functions");
|
|
20
19
|
const debug = (0, debug_1.default)('sphereon:oid4vci:credential');
|
|
21
20
|
function buildProof(proofInput, opts) {
|
|
22
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -52,30 +51,45 @@ class CredentialRequestClient {
|
|
|
52
51
|
}
|
|
53
52
|
acquireCredentialsUsingProof(opts) {
|
|
54
53
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
const {
|
|
56
|
-
const request = yield this.createCredentialRequest({
|
|
54
|
+
const { credentialIdentifier, credentialTypes, proofInput, format, context, subjectIssuance } = opts;
|
|
55
|
+
const request = yield this.createCredentialRequest({
|
|
56
|
+
proofInput,
|
|
57
|
+
credentialTypes,
|
|
58
|
+
context,
|
|
59
|
+
format,
|
|
60
|
+
version: this.version(),
|
|
61
|
+
credentialIdentifier,
|
|
62
|
+
subjectIssuance,
|
|
63
|
+
});
|
|
57
64
|
return yield this.acquireCredentialsUsingRequest(request);
|
|
58
65
|
});
|
|
59
66
|
}
|
|
60
67
|
acquireCredentialsUsingRequest(uniformRequest) {
|
|
68
|
+
var _a, _b;
|
|
61
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
62
70
|
if (this.version() < oid4vci_common_1.OpenId4VCIVersion.VER_1_0_13) {
|
|
63
|
-
throw new Error('Versions below v1.0.13 (draft 13) are not supported.');
|
|
71
|
+
throw new Error('Versions below v1.0.13 (draft 13) are not supported by the V13 credential request client.');
|
|
64
72
|
}
|
|
65
73
|
const request = (0, oid4vci_common_1.getCredentialRequestForVersion)(uniformRequest, this.version());
|
|
66
74
|
const credentialEndpoint = this.credentialRequestOpts.credentialEndpoint;
|
|
67
|
-
if (!(0,
|
|
75
|
+
if (!(0, oid4vci_common_1.isValidURL)(credentialEndpoint)) {
|
|
68
76
|
debug(`Invalid credential endpoint: ${credentialEndpoint}`);
|
|
69
77
|
throw new Error(oid4vci_common_1.URL_NOT_VALID);
|
|
70
78
|
}
|
|
71
79
|
debug(`Acquiring credential(s) from: ${credentialEndpoint}`);
|
|
72
80
|
debug(`request\n: ${JSON.stringify(request, null, 2)}`);
|
|
73
81
|
const requestToken = this.credentialRequestOpts.token;
|
|
74
|
-
let response = yield (0,
|
|
82
|
+
let response = (yield (0, oid4vci_common_1.post)(credentialEndpoint, JSON.stringify(request), { bearerToken: requestToken }));
|
|
75
83
|
this._isDeferred = (0, oid4vci_common_1.isDeferredCredentialResponse)(response);
|
|
76
84
|
if (this.isDeferred() && this.credentialRequestOpts.deferredCredentialAwait && response.successBody) {
|
|
77
85
|
response = yield this.acquireDeferredCredential(response.successBody, { bearerToken: this.credentialRequestOpts.token });
|
|
78
86
|
}
|
|
87
|
+
response.access_token = requestToken;
|
|
88
|
+
if ((uniformRequest.credential_subject_issuance && response.successBody) || ((_a = response.successBody) === null || _a === void 0 ? void 0 : _a.credential_subject_issuance)) {
|
|
89
|
+
if (JSON.stringify(uniformRequest.credential_subject_issuance) !== JSON.stringify((_b = response.successBody) === null || _b === void 0 ? void 0 : _b.credential_subject_issuance)) {
|
|
90
|
+
throw Error('Subject signing was requested, but issuer did not provide the options in its response');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
79
93
|
debug(`Credential endpoint ${credentialEndpoint} response:\r\n${JSON.stringify(response, null, 2)}`);
|
|
80
94
|
return response;
|
|
81
95
|
});
|
|
@@ -103,44 +117,58 @@ class CredentialRequestClient {
|
|
|
103
117
|
});
|
|
104
118
|
}
|
|
105
119
|
createCredentialRequest(opts) {
|
|
106
|
-
var _a
|
|
120
|
+
var _a;
|
|
107
121
|
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
-
const { proofInput } = opts;
|
|
122
|
+
const { proofInput, credentialIdentifier: credential_identifier } = opts;
|
|
123
|
+
const proof = yield buildProof(proofInput, opts);
|
|
124
|
+
if (credential_identifier) {
|
|
125
|
+
if (opts.format || opts.credentialTypes || opts.context) {
|
|
126
|
+
throw Error(`You cannot mix credential_identifier with format, credential types and/or context`);
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
credential_identifier,
|
|
130
|
+
proof,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
109
133
|
const formatSelection = (_a = opts.format) !== null && _a !== void 0 ? _a : this.credentialRequestOpts.format;
|
|
110
134
|
if (!formatSelection) {
|
|
111
135
|
throw Error(`Format of credential to be issued is missing`);
|
|
112
136
|
}
|
|
113
137
|
const format = (0, oid4vci_common_1.getUniformFormat)(formatSelection);
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
138
|
+
const typesSelection = (opts === null || opts === void 0 ? void 0 : opts.credentialTypes) && (typeof opts.credentialTypes === 'string' || opts.credentialTypes.length > 0)
|
|
139
|
+
? opts.credentialTypes
|
|
140
|
+
: this.credentialRequestOpts.credentialTypes;
|
|
141
|
+
if (!typesSelection) {
|
|
142
|
+
throw Error(`Credential type(s) need to be provided`);
|
|
143
|
+
}
|
|
144
|
+
const types = Array.isArray(typesSelection) ? typesSelection : [typesSelection];
|
|
145
|
+
if (types.length === 0) {
|
|
146
|
+
throw Error(`Credential type(s) need to be provided`);
|
|
117
147
|
}
|
|
118
|
-
const proof = yield buildProof(proofInput, opts);
|
|
119
148
|
// TODO: we should move format specific logic
|
|
120
149
|
if (format === 'jwt_vc_json' || format === 'jwt_vc') {
|
|
121
|
-
return {
|
|
122
|
-
credential_identifier: typeSelection,
|
|
150
|
+
return Object.assign({ types,
|
|
123
151
|
format,
|
|
124
|
-
proof,
|
|
125
|
-
};
|
|
152
|
+
proof }, opts.subjectIssuance);
|
|
126
153
|
}
|
|
127
154
|
else if (format === 'jwt_vc_json-ld' || format === 'ldp_vc') {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
155
|
+
if (this.version() >= oid4vci_common_1.OpenId4VCIVersion.VER_1_0_12 && !opts.context) {
|
|
156
|
+
throw Error('No @context value present, but it is required');
|
|
157
|
+
}
|
|
158
|
+
return Object.assign(Object.assign({ format,
|
|
159
|
+
proof }, opts.subjectIssuance), {
|
|
131
160
|
// Ignored because v11 does not have the context value, but it is required in v12
|
|
132
161
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
133
162
|
// @ts-ignore
|
|
134
|
-
|
|
135
|
-
};
|
|
163
|
+
credential_definition: Object.assign({ types }, (opts.context && { '@context': opts.context })) });
|
|
136
164
|
}
|
|
137
165
|
else if (format === 'vc+sd-jwt') {
|
|
166
|
+
if (types.length > 1) {
|
|
167
|
+
throw Error(`Only a single credential type is supported for ${format}`);
|
|
168
|
+
}
|
|
138
169
|
// fixme: this isn't up to the CredentialRequest that we see in the version v1_0_13
|
|
139
|
-
return {
|
|
140
|
-
|
|
141
|
-
proof,
|
|
142
|
-
vct: typeSelection,
|
|
143
|
-
};
|
|
170
|
+
return Object.assign({ format,
|
|
171
|
+
proof, vct: types[0] }, opts.subjectIssuance);
|
|
144
172
|
}
|
|
145
173
|
throw new Error(`Unsupported format: ${format}`);
|
|
146
174
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialRequestClient.js","sourceRoot":"","sources":["../lib/CredentialRequestClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"CredentialRequestClient.js","sourceRoot":"","sources":["../lib/CredentialRequestClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAgBkC;AAGlC,kDAA0B;AAG1B,yEAAsE;AAEtE,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,6BAA6B,CAAC,CAAC;AAiBnD,SAAsB,UAAU,CAC9B,UAAgE,EAChE,IAGC;;QAED,IAAI,YAAY,IAAI,UAAU,EAAE,CAAC;YAC/B,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,M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@
|
|
|
1
|
-
import { AccessTokenResponse, CredentialIssuerMetadataV1_0_13, CredentialOfferRequestWithBaseUrl, EndpointMetadata, OID4VCICredentialFormat, OpenId4VCIVersion, UniformCredentialOfferRequest } from '@sphereon/oid4vci-common';
|
|
1
|
+
import { AccessTokenResponse, CredentialIssuerMetadataV1_0_13, CredentialOfferRequestWithBaseUrl, EndpointMetadata, ExperimentalSubjectIssuance, OID4VCICredentialFormat, OpenId4VCIVersion, UniformCredentialOfferRequest } from '@sphereon/oid4vci-common';
|
|
2
2
|
import { CredentialFormat } from '@sphereon/ssi-types';
|
|
3
3
|
import { CredentialRequestClient } from './CredentialRequestClient';
|
|
4
4
|
export declare class CredentialRequestClientBuilder {
|
|
@@ -6,15 +6,18 @@ export declare class CredentialRequestClientBuilder {
|
|
|
6
6
|
deferredCredentialEndpoint?: string;
|
|
7
7
|
deferredCredentialAwait: boolean;
|
|
8
8
|
deferredCredentialIntervalInMS: number;
|
|
9
|
-
|
|
9
|
+
credentialIdentifier?: string;
|
|
10
|
+
credentialTypes?: string[];
|
|
10
11
|
format?: CredentialFormat | OID4VCICredentialFormat;
|
|
11
12
|
token?: string;
|
|
12
13
|
version?: OpenId4VCIVersion;
|
|
13
|
-
|
|
14
|
+
subjectIssuance?: ExperimentalSubjectIssuance;
|
|
15
|
+
static fromCredentialIssuer({ credentialIssuer, metadata, version, credentialIdentifier, credentialTypes, }: {
|
|
14
16
|
credentialIssuer: string;
|
|
15
17
|
metadata?: EndpointMetadata;
|
|
16
18
|
version?: OpenId4VCIVersion;
|
|
17
|
-
|
|
19
|
+
credentialIdentifier?: string;
|
|
20
|
+
credentialTypes?: string | string[];
|
|
18
21
|
}): CredentialRequestClientBuilder;
|
|
19
22
|
static fromURI({ uri, metadata }: {
|
|
20
23
|
uri: string;
|
|
@@ -36,8 +39,10 @@ export declare class CredentialRequestClientBuilder {
|
|
|
36
39
|
withDeferredCredentialEndpointFromMetadata(metadata: CredentialIssuerMetadataV1_0_13): this;
|
|
37
40
|
withDeferredCredentialEndpoint(deferredCredentialEndpoint: string): this;
|
|
38
41
|
withDeferredCredentialAwait(deferredCredentialAwait: boolean, deferredCredentialIntervalInMS?: number): this;
|
|
39
|
-
|
|
42
|
+
withCredentialIdentifier(credentialIdentifier: string): this;
|
|
43
|
+
withCredentialType(credentialTypes: string | string[]): this;
|
|
40
44
|
withFormat(format: CredentialFormat | OID4VCICredentialFormat): this;
|
|
45
|
+
withSubjectIssuance(subjectIssuance: ExperimentalSubjectIssuance): this;
|
|
41
46
|
withToken(accessToken: string): this;
|
|
42
47
|
withTokenFromResponse(response: AccessTokenResponse): this;
|
|
43
48
|
withVersion(version: OpenId4VCIVersion): this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialRequestClientBuilder.d.ts","sourceRoot":"","sources":["../lib/CredentialRequestClientBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAE/B,iCAAiC,EAEjC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"CredentialRequestClientBuilder.d.ts","sourceRoot":"","sources":["../lib/CredentialRequestClientBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,+BAA+B,EAE/B,iCAAiC,EAEjC,gBAAgB,EAChB,2BAA2B,EAE3B,uBAAuB,EACvB,iBAAiB,EACjB,6BAA6B,EAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,qBAAa,8BAA8B;IACzC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,uBAAuB,UAAS;IAChC,8BAA8B,SAAQ;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAM;IAChC,MAAM,CAAC,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AM,GAAG,IAAI;IAKxE,2BAA2B,CAAC,uBAAuB,EAAE,OAAO,EAAE,8BAA8B,CAAC,EAAE,MAAM,GAAG,IAAI;IAM5G,wBAAwB,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI;IAK5D,kBAAkB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAK5D,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,uBAAuB,GAAG,IAAI;IAKpE,mBAAmB,CAAC,eAAe,EAAE,2BAA2B,GAAG,IAAI;IAKvE,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAKpC,qBAAqB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,IAAI;IAK1D,WAAW,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;IAK7C,KAAK,IAAI,uBAAuB;CAMxC"}
|
|
@@ -17,8 +17,9 @@ class CredentialRequestClientBuilder {
|
|
|
17
17
|
constructor() {
|
|
18
18
|
this.deferredCredentialAwait = false;
|
|
19
19
|
this.deferredCredentialIntervalInMS = 5000;
|
|
20
|
+
this.credentialTypes = [];
|
|
20
21
|
}
|
|
21
|
-
static fromCredentialIssuer({ credentialIssuer, metadata, version,
|
|
22
|
+
static fromCredentialIssuer({ credentialIssuer, metadata, version, credentialIdentifier, credentialTypes, }) {
|
|
22
23
|
var _a;
|
|
23
24
|
const issuer = credentialIssuer;
|
|
24
25
|
const builder = new CredentialRequestClientBuilder();
|
|
@@ -27,7 +28,12 @@ class CredentialRequestClientBuilder {
|
|
|
27
28
|
if (metadata === null || metadata === void 0 ? void 0 : metadata.deferred_credential_endpoint) {
|
|
28
29
|
builder.withDeferredCredentialEndpoint(metadata.deferred_credential_endpoint);
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
+
if (credentialIdentifier) {
|
|
32
|
+
builder.withCredentialIdentifier(credentialIdentifier);
|
|
33
|
+
}
|
|
34
|
+
if (credentialTypes) {
|
|
35
|
+
builder.withCredentialType(credentialTypes);
|
|
36
|
+
}
|
|
31
37
|
return builder;
|
|
32
38
|
}
|
|
33
39
|
static fromURI({ uri, metadata }) {
|
|
@@ -50,10 +56,10 @@ class CredentialRequestClientBuilder {
|
|
|
50
56
|
if (metadata === null || metadata === void 0 ? void 0 : metadata.deferred_credential_endpoint) {
|
|
51
57
|
builder.withDeferredCredentialEndpoint(metadata.deferred_credential_endpoint);
|
|
52
58
|
}
|
|
53
|
-
const
|
|
59
|
+
const ids = request.credential_offer.credential_configuration_ids;
|
|
54
60
|
// if there's only one in the offer, we pre-select it. if not, you should provide the credentialType
|
|
55
|
-
if (
|
|
56
|
-
builder.
|
|
61
|
+
if (ids.length && ids.length === 1) {
|
|
62
|
+
builder.withCredentialIdentifier(ids[0]);
|
|
57
63
|
}
|
|
58
64
|
return builder;
|
|
59
65
|
}
|
|
@@ -85,14 +91,22 @@ class CredentialRequestClientBuilder {
|
|
|
85
91
|
this.deferredCredentialIntervalInMS = deferredCredentialIntervalInMS !== null && deferredCredentialIntervalInMS !== void 0 ? deferredCredentialIntervalInMS : 5000;
|
|
86
92
|
return this;
|
|
87
93
|
}
|
|
88
|
-
|
|
89
|
-
this.
|
|
94
|
+
withCredentialIdentifier(credentialIdentifier) {
|
|
95
|
+
this.credentialIdentifier = credentialIdentifier;
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
withCredentialType(credentialTypes) {
|
|
99
|
+
this.credentialTypes = Array.isArray(credentialTypes) ? credentialTypes : [credentialTypes];
|
|
90
100
|
return this;
|
|
91
101
|
}
|
|
92
102
|
withFormat(format) {
|
|
93
103
|
this.format = format;
|
|
94
104
|
return this;
|
|
95
105
|
}
|
|
106
|
+
withSubjectIssuance(subjectIssuance) {
|
|
107
|
+
this.subjectIssuance = subjectIssuance;
|
|
108
|
+
return this;
|
|
109
|
+
}
|
|
96
110
|
withToken(accessToken) {
|
|
97
111
|
this.token = accessToken;
|
|
98
112
|
return this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialRequestClientBuilder.js","sourceRoot":"","sources":["../lib/CredentialRequestClientBuilder.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"CredentialRequestClientBuilder.js","sourceRoot":"","sources":["../lib/CredentialRequestClientBuilder.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAYkC;AAGlC,mEAAgE;AAChE,uEAAoE;AAEpE,MAAa,8BAA8B;IAA3C;QAGE,4BAAuB,GAAG,KAAK,CAAC;QAChC,mCAA8B,GAAG,IAAI,CAAC;QAEtC,oBAAe,GAAc,EAAE,CAAC;IAoJlC,CAAC;IA9IQ,MAAM,CAAC,oBAAoB,CAAC,EACjC,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,oBAAoB,EACpB,eAAe,GAOhB;;QACC,MAAM,MAAM,GAAG,gBAAgB,CAAC;QAChC,MAAM,OAAO,GAAG,IAAI,8BAA8B,EAAE,CAAC;QACrD,OAAO,CAAC,WAAW,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,kCAAiB,CAAC,UAAU,CAAC,CAAC;QAC7D,OAAO,CAAC,sBAAsB,CAAC,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,mBAAmB,mCAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,YAAY,CAAC,CAAC,CAAC,GAAG,MAAM,aAAa,CAAC,CAAC,CAAC;QACzI,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,4BAA4B,EAAE,CAAC;YAC3C,OAAO,CAAC,8BAA8B,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC;QAChF,CAAC;QACD,IAAI,oBAAoB,EAAE,CAAC;YACzB,OAAO,CAAC,wBAAwB,CAAC,oBAAoB,CAAC,CAAC;QACzD,CAAC;QACD,IAAI,eAAe,EAAE,CAAC;YACpB,OAAO,CAAC,kBAA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