@sphereon/ssi-sdk.oid4vci-issuer 0.33.0 → 0.33.1-feature.vcdm2.4
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/IssuerInstance.js +18 -28
- package/dist/IssuerInstance.js.map +1 -1
- package/dist/agent/OID4VCIIssuer.js +149 -185
- package/dist/agent/OID4VCIIssuer.js.map +1 -1
- package/dist/functions.js +240 -266
- package/dist/functions.js.map +1 -1
- package/dist/index.js +5 -23
- package/dist/index.js.map +1 -1
- package/dist/state-manager/oid4vcState/IAbstractMachineStateStore.js +1 -2
- package/dist/types/IOID4VCIIssuer.js +1 -2
- package/package.json +12 -12
package/dist/IssuerInstance.js
CHANGED
|
@@ -1,36 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.IssuerInstance = void 0;
|
|
13
|
-
const functions_1 = require("./functions");
|
|
14
|
-
class IssuerInstance {
|
|
1
|
+
import { createVciIssuerBuilder } from './functions';
|
|
2
|
+
export class IssuerInstance {
|
|
3
|
+
_issuer;
|
|
4
|
+
_metadataOptions;
|
|
5
|
+
_issuerOptions;
|
|
6
|
+
_issuerMetadata;
|
|
7
|
+
_authorizationServerMetadata;
|
|
15
8
|
constructor({ issuerOpts, metadataOpts, issuerMetadata, authorizationServerMetadata, }) {
|
|
16
9
|
this._issuerOptions = issuerOpts;
|
|
17
10
|
this._metadataOptions = metadataOpts;
|
|
18
11
|
this._issuerMetadata = issuerMetadata;
|
|
19
12
|
this._authorizationServerMetadata = authorizationServerMetadata;
|
|
20
13
|
}
|
|
21
|
-
get(opts) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return this._issuer;
|
|
33
|
-
});
|
|
14
|
+
async get(opts) {
|
|
15
|
+
if (!this._issuer) {
|
|
16
|
+
const builder = await createVciIssuerBuilder({
|
|
17
|
+
issuerOpts: this.issuerOptions,
|
|
18
|
+
issuerMetadata: this.issuerMetadata,
|
|
19
|
+
authorizationServerMetadata: this.authorizationServerMetadata,
|
|
20
|
+
credentialDataSupplier: opts?.credentialDataSupplier,
|
|
21
|
+
}, opts.context);
|
|
22
|
+
this._issuer = builder.build();
|
|
23
|
+
}
|
|
24
|
+
return this._issuer;
|
|
34
25
|
}
|
|
35
26
|
get issuerOptions() {
|
|
36
27
|
return this._issuerOptions;
|
|
@@ -48,5 +39,4 @@ class IssuerInstance {
|
|
|
48
39
|
return this._authorizationServerMetadata;
|
|
49
40
|
}
|
|
50
41
|
}
|
|
51
|
-
exports.IssuerInstance = IssuerInstance;
|
|
52
42
|
//# sourceMappingURL=IssuerInstance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IssuerInstance.js","sourceRoot":"","sources":["../src/IssuerInstance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IssuerInstance.js","sourceRoot":"","sources":["../src/IssuerInstance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIpD,MAAM,OAAO,cAAc;IACjB,OAAO,CAAsB;IACpB,gBAAgB,CAAkB;IAClC,cAAc,CAAgB;IACvC,eAAe,CAAgB;IACtB,4BAA4B,CAA6B;IAE1E,YAAmB,EACjB,UAAU,EACV,YAAY,EACZ,cAAc,EACd,2BAA2B,GAM5B;QACC,IAAI,CAAC,cAAc,GAAG,UAAU,CAAA;QAChC,IAAI,CAAC,gBAAgB,GAAG,YAAY,CAAA;QACpC,IAAI,CAAC,eAAe,GAAG,cAAc,CAAA;QACrC,IAAI,CAAC,4BAA4B,GAAG,2BAA2B,CAAA;IACjE,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,IAAoF;QACnG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,OAAO,GAAG,MAAM,sBAAsB,CAC1C;gBACE,UAAU,EAAE,IAAI,CAAC,aAAa;gBAC9B,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,2BAA2B,EAAE,IAAI,CAAC,2BAA2B;gBAC7D,sBAAsB,EAAE,IAAI,EAAE,sBAAsB;aACrD,EACD,IAAI,CAAC,OAAO,CACb,CAAA;YACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,CAAA;QAChC,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,cAAc,CAAA;IAC5B,CAAC;IAED,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAA;IAC9B,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,eAAe,CAAA;IAC7B,CAAC;IAED,IAAI,cAAc,CAAC,KAAqB;QACtC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAA;IAC9B,CAAC;IAED,IAAI,2BAA2B;QAC7B,OAAO,IAAI,CAAC,4BAA4B,CAAA;IAC1C,CAAC;CACF"}
|
|
@@ -1,76 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const IssuerInstance_1 = require("../IssuerInstance");
|
|
20
|
-
class OID4VCIIssuer {
|
|
1
|
+
import { WellKnownEndpoints, } from '@sphereon/oid4vci-common';
|
|
2
|
+
import { assertValidAccessTokenRequest, createAccessTokenResponse } from '@sphereon/oid4vci-issuer';
|
|
3
|
+
import { retrieveWellknown } from '@sphereon/oid4vci-client';
|
|
4
|
+
import { getAgentResolver } from '@sphereon/ssi-sdk-ext.did-utils';
|
|
5
|
+
import { getAccessTokenSignerCallback } from '../functions';
|
|
6
|
+
import { schema, } from '../index';
|
|
7
|
+
import { IssuerInstance } from '../IssuerInstance';
|
|
8
|
+
export class OID4VCIIssuer {
|
|
9
|
+
static _DEFAULT_OPTS_KEY = '_default';
|
|
10
|
+
instances = new Map();
|
|
11
|
+
schema = schema.IDidAuthSiopOpAuthenticator;
|
|
12
|
+
methods = {
|
|
13
|
+
oid4vciCreateOfferURI: this.oid4vciCreateOfferURI.bind(this),
|
|
14
|
+
oid4vciIssueCredential: this.oid4vciIssueCredential.bind(this),
|
|
15
|
+
oid4vciCreateAccessTokenResponse: this.oid4vciCreateAccessTokenResponse.bind(this),
|
|
16
|
+
oid4vciGetInstance: this.oid4vciGetInstance.bind(this),
|
|
17
|
+
};
|
|
18
|
+
_opts;
|
|
21
19
|
constructor(opts) {
|
|
22
|
-
this.
|
|
23
|
-
this.schema = index_1.schema.IDidAuthSiopOpAuthenticator;
|
|
24
|
-
this.methods = {
|
|
25
|
-
oid4vciCreateOfferURI: this.oid4vciCreateOfferURI.bind(this),
|
|
26
|
-
oid4vciIssueCredential: this.oid4vciIssueCredential.bind(this),
|
|
27
|
-
oid4vciCreateAccessTokenResponse: this.oid4vciCreateAccessTokenResponse.bind(this),
|
|
28
|
-
oid4vciGetInstance: this.oid4vciGetInstance.bind(this),
|
|
29
|
-
};
|
|
30
|
-
this._opts = opts !== null && opts !== void 0 ? opts : {};
|
|
20
|
+
this._opts = opts ?? {};
|
|
31
21
|
}
|
|
32
|
-
oid4vciCreateOfferURI(createArgs, context) {
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}));
|
|
43
|
-
});
|
|
22
|
+
async oid4vciCreateOfferURI(createArgs, context) {
|
|
23
|
+
return await this.oid4vciGetInstance(createArgs, context)
|
|
24
|
+
.then((instance) => instance.get({ context }))
|
|
25
|
+
.then((issuer) => issuer.createCredentialOfferURI(createArgs).then((response) => {
|
|
26
|
+
const result = response;
|
|
27
|
+
if (this._opts.returnSessions === false) {
|
|
28
|
+
delete result.session;
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
}));
|
|
44
32
|
}
|
|
45
|
-
oid4vciIssueCredential(issueArgs, context) {
|
|
46
|
-
return
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
.then((issuer) => issuer.issueCredential(issueArgs));
|
|
50
|
-
});
|
|
33
|
+
async oid4vciIssueCredential(issueArgs, context) {
|
|
34
|
+
return await this.oid4vciGetInstance(issueArgs, context)
|
|
35
|
+
.then((instance) => instance.get({ context }))
|
|
36
|
+
.then((issuer) => issuer.issueCredential(issueArgs));
|
|
51
37
|
}
|
|
52
|
-
oid4vciCreateAccessTokenResponse(accessTokenArgs, context) {
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
accessTokenSignerCallback: yield (0, functions_1.getAccessTokenSignerCallback)(instance.issuerOptions, context),
|
|
72
|
-
});
|
|
73
|
-
}));
|
|
38
|
+
async oid4vciCreateAccessTokenResponse(accessTokenArgs, context) {
|
|
39
|
+
return await this.oid4vciGetInstance(accessTokenArgs, context).then(async (instance) => {
|
|
40
|
+
const issuer = await instance.get({ context });
|
|
41
|
+
await assertValidAccessTokenRequest(accessTokenArgs.request, {
|
|
42
|
+
credentialOfferSessions: issuer.credentialOfferSessions,
|
|
43
|
+
expirationDuration: accessTokenArgs.expirationDuration,
|
|
44
|
+
});
|
|
45
|
+
const accessTokenIssuer = instance.issuerOptions.idOpts?.issuer ?? instance.issuerOptions.didOpts?.idOpts.identifier.toString(); // last part is legacy
|
|
46
|
+
if (!accessTokenIssuer) {
|
|
47
|
+
return Promise.reject(Error(`Could not determine access token issuer`));
|
|
48
|
+
}
|
|
49
|
+
return createAccessTokenResponse(accessTokenArgs.request, {
|
|
50
|
+
accessTokenIssuer,
|
|
51
|
+
tokenExpiresIn: accessTokenArgs.expirationDuration,
|
|
52
|
+
cNonceExpiresIn: accessTokenArgs.expirationDuration,
|
|
53
|
+
cNonces: issuer.cNonces,
|
|
54
|
+
credentialOfferSessions: issuer.credentialOfferSessions,
|
|
55
|
+
accessTokenSignerCallback: await getAccessTokenSignerCallback(instance.issuerOptions, context),
|
|
56
|
+
});
|
|
74
57
|
});
|
|
75
58
|
}
|
|
76
59
|
getExternalAS(issuerMetadata) {
|
|
@@ -79,132 +62,113 @@ class OID4VCIIssuer {
|
|
|
79
62
|
}
|
|
80
63
|
return undefined;
|
|
81
64
|
}
|
|
82
|
-
createIssuerInstance(args, context) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
65
|
+
async createIssuerInstance(args, context) {
|
|
66
|
+
const credentialIssuer = args.credentialIssuer ?? OID4VCIIssuer._DEFAULT_OPTS_KEY;
|
|
67
|
+
//todo: prob doesn't make sense as credentialIssuer is mandatory anyway
|
|
68
|
+
const metadataOpts = await this.getMetadataOpts({ ...args, credentialIssuer }, context);
|
|
69
|
+
const issuerMetadata = await this.getIssuerMetadata({ ...args, credentialIssuer }, context);
|
|
70
|
+
const externalAS = this.getExternalAS(issuerMetadata);
|
|
71
|
+
let asMetadataResponse = undefined;
|
|
72
|
+
if (externalAS) {
|
|
73
|
+
// Let's try OIDC first and then fallback to OAuth2
|
|
74
|
+
asMetadataResponse = await retrieveWellknown(externalAS, WellKnownEndpoints.OPENID_CONFIGURATION, {
|
|
75
|
+
errorOnNotFound: false,
|
|
76
|
+
});
|
|
77
|
+
if (!asMetadataResponse) {
|
|
78
|
+
asMetadataResponse = await retrieveWellknown(externalAS, WellKnownEndpoints.OAUTH_AS, {
|
|
79
|
+
errorOnNotFound: true,
|
|
95
80
|
});
|
|
96
|
-
if (!asMetadataResponse) {
|
|
97
|
-
asMetadataResponse = yield (0, oid4vci_client_1.retrieveWellknown)(externalAS, oid4vci_common_1.WellKnownEndpoints.OAUTH_AS, {
|
|
98
|
-
errorOnNotFound: true,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
81
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
82
|
+
}
|
|
83
|
+
const authorizationServerMetadata = asMetadataResponse?.successBody
|
|
84
|
+
? asMetadataResponse.successBody
|
|
85
|
+
: await this.getAuthorizationServerMetadataFromStore({
|
|
86
|
+
...args,
|
|
87
|
+
credentialIssuer,
|
|
88
|
+
}, context);
|
|
89
|
+
const issuerOpts = await this.getIssuerOptsFromStore({ ...args, credentialIssuer }, context);
|
|
90
|
+
if (!issuerOpts.resolveOpts) {
|
|
91
|
+
issuerOpts.resolveOpts = { ...issuerOpts.didOpts?.resolveOpts, ...this._opts.resolveOpts };
|
|
92
|
+
}
|
|
93
|
+
if (!issuerOpts.resolveOpts?.resolver) {
|
|
94
|
+
issuerOpts.resolveOpts.resolver = getAgentResolver(context);
|
|
95
|
+
}
|
|
96
|
+
this.instances.set(credentialIssuer, new IssuerInstance({
|
|
97
|
+
issuerOpts,
|
|
98
|
+
metadataOpts,
|
|
99
|
+
issuerMetadata,
|
|
100
|
+
authorizationServerMetadata,
|
|
101
|
+
}));
|
|
102
|
+
return this.oid4vciGetInstance(args, context);
|
|
120
103
|
}
|
|
121
|
-
oid4vciGetInstance(args, context) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
return this.instances.get(credentialIssuer);
|
|
130
|
-
});
|
|
104
|
+
async oid4vciGetInstance(args, context) {
|
|
105
|
+
const credentialIssuer = args.credentialIssuer ?? OID4VCIIssuer._DEFAULT_OPTS_KEY;
|
|
106
|
+
//todo: prob doesn't make sense as credentialIssuer is mandatory anyway
|
|
107
|
+
if (!this.instances.has(credentialIssuer)) {
|
|
108
|
+
await this.createIssuerInstance(args, context);
|
|
109
|
+
}
|
|
110
|
+
return this.instances.get(credentialIssuer);
|
|
131
111
|
}
|
|
132
|
-
getIssuerOptsFromStore(opts, context) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
namespace,
|
|
142
|
-
});
|
|
143
|
-
if (!options) {
|
|
144
|
-
throw Error(`Could not get specific nor default options for definition ${credentialIssuer}`);
|
|
145
|
-
}
|
|
146
|
-
return options;
|
|
112
|
+
async getIssuerOptsFromStore(opts, context) {
|
|
113
|
+
const credentialIssuer = opts.credentialIssuer;
|
|
114
|
+
const storeId = await this.storeId(opts, context);
|
|
115
|
+
const namespace = await this.namespace(opts, context);
|
|
116
|
+
const options = await context.agent.oid4vciStoreGetIssuerOpts({
|
|
117
|
+
metadataType: 'issuer',
|
|
118
|
+
correlationId: credentialIssuer,
|
|
119
|
+
storeId,
|
|
120
|
+
namespace,
|
|
147
121
|
});
|
|
122
|
+
if (!options) {
|
|
123
|
+
throw Error(`Could not get specific nor default options for definition ${credentialIssuer}`);
|
|
124
|
+
}
|
|
125
|
+
return options;
|
|
148
126
|
}
|
|
149
|
-
getMetadataOpts(opts, context) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return { credentialIssuer, storeId, storeNamespace };
|
|
155
|
-
});
|
|
127
|
+
async getMetadataOpts(opts, context) {
|
|
128
|
+
const credentialIssuer = opts.credentialIssuer;
|
|
129
|
+
const storeId = await this.storeId(opts, context);
|
|
130
|
+
const storeNamespace = await this.namespace(opts, context);
|
|
131
|
+
return { credentialIssuer, storeId, storeNamespace };
|
|
156
132
|
}
|
|
157
|
-
getIssuerMetadata(opts, context) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
return metadata;
|
|
170
|
-
});
|
|
133
|
+
async getIssuerMetadata(opts, context) {
|
|
134
|
+
const metadataOpts = await this.getMetadataOpts(opts, context);
|
|
135
|
+
const metadata = (await context.agent.oid4vciStoreGetMetadata({
|
|
136
|
+
metadataType: 'issuer',
|
|
137
|
+
correlationId: metadataOpts.credentialIssuer,
|
|
138
|
+
namespace: metadataOpts.storeNamespace,
|
|
139
|
+
storeId: metadataOpts.storeId,
|
|
140
|
+
}));
|
|
141
|
+
if (!metadata) {
|
|
142
|
+
throw Error(`Issuer metadata not found for issuer ${opts.credentialIssuer}, namespace ${opts.namespace} and store ${opts.storeId}`);
|
|
143
|
+
}
|
|
144
|
+
return metadata;
|
|
171
145
|
}
|
|
172
|
-
getAuthorizationServerMetadataFromStore(opts, context) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
return metadata;
|
|
185
|
-
});
|
|
146
|
+
async getAuthorizationServerMetadataFromStore(opts, context) {
|
|
147
|
+
const metadataOpts = await this.getMetadataOpts(opts, context);
|
|
148
|
+
const metadata = (await context.agent.oid4vciStoreGetMetadata({
|
|
149
|
+
metadataType: 'authorizationServer',
|
|
150
|
+
correlationId: metadataOpts.credentialIssuer,
|
|
151
|
+
namespace: metadataOpts.storeNamespace,
|
|
152
|
+
storeId: metadataOpts.storeId,
|
|
153
|
+
}));
|
|
154
|
+
if (!metadata) {
|
|
155
|
+
throw Error(`Authorization server ${opts.credentialIssuer} metadata not found for namespace ${metadataOpts.storeNamespace} and store ${metadataOpts.storeId}`);
|
|
156
|
+
}
|
|
157
|
+
return metadata;
|
|
186
158
|
}
|
|
187
|
-
storeId(opts, context) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
return storeId;
|
|
195
|
-
});
|
|
159
|
+
async storeId(opts, context) {
|
|
160
|
+
const storeId = opts?.storeId ?? this._opts?.defaultStoreId ?? (await context?.agent.oid4vciStoreDefaultStoreId());
|
|
161
|
+
if (!storeId) {
|
|
162
|
+
throw Error('Please provide a store id a default value, or provide the context for a global default store id');
|
|
163
|
+
}
|
|
164
|
+
return storeId;
|
|
196
165
|
}
|
|
197
|
-
namespace(opts, context) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
return namespace;
|
|
205
|
-
});
|
|
166
|
+
async namespace(opts, context) {
|
|
167
|
+
const namespace = opts?.namespace ?? this._opts?.defaultNamespace ?? (await context?.agent.oid4vciStoreDefaultNamespace());
|
|
168
|
+
if (!namespace) {
|
|
169
|
+
throw Error('Please provide a namespace a default value, or provide the context for a global default namespace');
|
|
170
|
+
}
|
|
171
|
+
return namespace;
|
|
206
172
|
}
|
|
207
173
|
}
|
|
208
|
-
exports.OID4VCIIssuer = OID4VCIIssuer;
|
|
209
|
-
OID4VCIIssuer._DEFAULT_OPTS_KEY = '_default';
|
|
210
174
|
//# sourceMappingURL=OID4VCIIssuer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OID4VCIIssuer.js","sourceRoot":"","sources":["../../src/agent/OID4VCIIssuer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OID4VCIIssuer.js","sourceRoot":"","sources":["../../src/agent/OID4VCIIssuer.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,6BAA6B,EAAE,yBAAyB,EAAY,MAAM,0BAA0B,CAAA;AAC7G,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAGlE,OAAO,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EASL,MAAM,GACP,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAIlD,MAAM,OAAO,aAAa;IAChB,MAAM,CAAU,iBAAiB,GAAG,UAAU,CAAA;IACrC,SAAS,GAAgC,IAAI,GAAG,EAAE,CAAA;IAC1D,MAAM,GAAG,MAAM,CAAC,2BAA2B,CAAA;IAE3C,OAAO,GAAmB;QACjC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5D,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9D,gCAAgC,EAAE,IAAI,CAAC,gCAAgC,CAAC,IAAI,CAAC,IAAI,CAAC;QAClF,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;KACvD,CAAA;IACO,KAAK,CAAoB;IAEjC,YAAY,IAAyB;QACnC,IAAI,CAAC,KAAK,GAAG,IAAI,IAAI,EAAE,CAAA;IACzB,CAAC;IAEO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|
15
|
-
exports.getJwtVerifyCallback = getJwtVerifyCallback;
|
|
16
|
-
exports.getAccessTokenKeyRef = getAccessTokenKeyRef;
|
|
17
|
-
exports.getAccessTokenSignerCallback = getAccessTokenSignerCallback;
|
|
18
|
-
exports.getCredentialSignerCallback = getCredentialSignerCallback;
|
|
19
|
-
exports.createVciIssuerBuilder = createVciIssuerBuilder;
|
|
20
|
-
exports.createVciIssuer = createVciIssuer;
|
|
21
|
-
exports.createAuthRequestUriCallback = createAuthRequestUriCallback;
|
|
22
|
-
exports.createVerifyAuthResponseCallback = createVerifyAuthResponseCallback;
|
|
23
|
-
const oid4vci_issuer_1 = require("@sphereon/oid4vci-issuer");
|
|
24
|
-
const ssi_sdk_ext_did_utils_1 = require("@sphereon/ssi-sdk-ext.did-utils");
|
|
25
|
-
const ssi_sdk_ext_identifier_resolution_1 = require("@sphereon/ssi-sdk-ext.identifier-resolution");
|
|
26
|
-
const ssi_sdk_agent_config_1 = require("@sphereon/ssi-sdk.agent-config");
|
|
27
|
-
const ssi_types_1 = require("@sphereon/ssi-types");
|
|
28
|
-
const utils_1 = require("@veramo/utils");
|
|
29
|
-
const did_jwt_1 = require("did-jwt");
|
|
30
|
-
const jwt_decode_1 = require("jwt-decode");
|
|
31
|
-
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
|
32
|
-
const did_auth_siop_1 = require("@sphereon/did-auth-siop");
|
|
33
|
-
function getJwtVerifyCallback({ verifyOpts }, _context) {
|
|
34
|
-
return (args) => __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
var _a, _b, _c;
|
|
36
|
-
const resolver = (0, ssi_sdk_ext_did_utils_1.getAgentResolver)(_context, {
|
|
1
|
+
import { VcIssuerBuilder } from '@sphereon/oid4vci-issuer';
|
|
2
|
+
import { getAgentResolver } from '@sphereon/ssi-sdk-ext.did-utils';
|
|
3
|
+
import { legacyKeyRefsToIdentifierOpts } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
4
|
+
import { contextHasPlugin } from '@sphereon/ssi-sdk.agent-config';
|
|
5
|
+
import { CredentialMapper } from '@sphereon/ssi-types';
|
|
6
|
+
import { bytesToBase64 } from '@veramo/utils';
|
|
7
|
+
import { createJWT, decodeJWT, verifyJWT } from 'did-jwt';
|
|
8
|
+
import { jwtDecode } from 'jwt-decode';
|
|
9
|
+
import fetch from 'cross-fetch';
|
|
10
|
+
import { AuthorizationResponseStateStatus } from '@sphereon/did-auth-siop';
|
|
11
|
+
export function getJwtVerifyCallback({ verifyOpts }, _context) {
|
|
12
|
+
return async (args) => {
|
|
13
|
+
const resolver = getAgentResolver(_context, {
|
|
37
14
|
resolverResolution: true,
|
|
38
15
|
uniresolverResolution: true,
|
|
39
16
|
localResolution: true,
|
|
40
17
|
});
|
|
41
|
-
verifyOpts =
|
|
42
|
-
if (!
|
|
18
|
+
verifyOpts = { ...verifyOpts, resolver: verifyOpts?.resolver }; // Resolver separately as that is a function
|
|
19
|
+
if (!verifyOpts?.resolver || typeof verifyOpts?.resolver?.resolve !== 'function') {
|
|
43
20
|
verifyOpts.resolver = resolver;
|
|
44
21
|
}
|
|
45
|
-
const result =
|
|
22
|
+
const result = await _context.agent.jwtVerifyJwsSignature({ jws: args.jwt });
|
|
46
23
|
if (!result.error) {
|
|
47
24
|
const identifier = result.jws.signatures[0].identifier;
|
|
48
25
|
if (!identifier) {
|
|
@@ -53,15 +30,21 @@ function getJwtVerifyCallback({ verifyOpts }, _context) {
|
|
|
53
30
|
return Promise.reject(Error(`the identifier of type ${identifier.method} is missing jwks (ExternalJwkInfo)`));
|
|
54
31
|
}
|
|
55
32
|
const { alg } = jwkInfo.jwk;
|
|
56
|
-
const header =
|
|
57
|
-
const payload =
|
|
58
|
-
const kid =
|
|
33
|
+
const header = jwtDecode(args.jwt, { header: true });
|
|
34
|
+
const payload = jwtDecode(args.jwt, { header: false });
|
|
35
|
+
const kid = args.kid ?? header.kid;
|
|
59
36
|
//const jwk = !kid ? jwkInfo.jwk : undefined // TODO double-check if this is correct
|
|
60
37
|
const jwk = jwkInfo.jwk; // FIXME workaround IATAB2B-57
|
|
61
|
-
return
|
|
38
|
+
return {
|
|
39
|
+
alg,
|
|
40
|
+
...identifier,
|
|
41
|
+
jwt: { header, payload },
|
|
42
|
+
...(kid && { kid }),
|
|
43
|
+
...(jwk && { jwk }),
|
|
44
|
+
};
|
|
62
45
|
}
|
|
63
|
-
const decodedJwt = (
|
|
64
|
-
const kid =
|
|
46
|
+
const decodedJwt = (await decodeJWT(args.jwt));
|
|
47
|
+
const kid = args.kid ?? decodedJwt.header.kid;
|
|
65
48
|
if (!kid || !kid.startsWith('did:')) {
|
|
66
49
|
// No DID method present in header. We already performed the validation above. So return that
|
|
67
50
|
return {
|
|
@@ -70,14 +53,14 @@ function getJwtVerifyCallback({ verifyOpts }, _context) {
|
|
|
70
53
|
};
|
|
71
54
|
}
|
|
72
55
|
const did = kid.split('#')[0];
|
|
73
|
-
const didResult =
|
|
56
|
+
const didResult = await verifyJWT(args.jwt, verifyOpts);
|
|
74
57
|
if (!didResult.verified) {
|
|
75
58
|
console.log(`JWT invalid: ${args.jwt}`);
|
|
76
59
|
throw Error('JWT did not verify successfully');
|
|
77
60
|
}
|
|
78
|
-
const didResolution =
|
|
61
|
+
const didResolution = await resolver.resolve(did);
|
|
79
62
|
if (!didResolution || !didResolution.didDocument) {
|
|
80
|
-
throw Error(`Could not resolve did: ${did}, metadata: ${didResolution
|
|
63
|
+
throw Error(`Could not resolve did: ${did}, metadata: ${didResolution?.didResolutionMetadata}`);
|
|
81
64
|
}
|
|
82
65
|
const alg = decodedJwt.header.alg;
|
|
83
66
|
return {
|
|
@@ -87,242 +70,233 @@ function getJwtVerifyCallback({ verifyOpts }, _context) {
|
|
|
87
70
|
didDocument: didResolution.didDocument,
|
|
88
71
|
jwt: decodedJwt,
|
|
89
72
|
};
|
|
90
|
-
}
|
|
73
|
+
};
|
|
91
74
|
}
|
|
92
|
-
function getAccessTokenKeyRef(opts, context) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return yield context.agent.identifierManagedGet(identifier);
|
|
96
|
-
});
|
|
75
|
+
export async function getAccessTokenKeyRef(opts, context) {
|
|
76
|
+
let identifier = legacyKeyRefsToIdentifierOpts(opts);
|
|
77
|
+
return await context.agent.identifierManagedGet(identifier);
|
|
97
78
|
}
|
|
98
|
-
function getAccessTokenSignerCallback(opts, context) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
79
|
+
export async function getAccessTokenSignerCallback(opts, context) {
|
|
80
|
+
const signer = async (data) => {
|
|
81
|
+
let dataString, encoding;
|
|
82
|
+
const resolution = await legacyKeyRefsToIdentifierOpts(opts);
|
|
83
|
+
const keyRef = resolution.kmsKeyRef;
|
|
84
|
+
if (!keyRef) {
|
|
85
|
+
throw Error('Cannot sign access tokens without a key ref');
|
|
86
|
+
}
|
|
87
|
+
if (typeof data === 'string') {
|
|
88
|
+
dataString = data;
|
|
89
|
+
encoding = undefined;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
dataString = bytesToBase64(data);
|
|
93
|
+
encoding = 'base64';
|
|
94
|
+
}
|
|
95
|
+
return context.agent.keyManagerSign({ keyRef, data: dataString, encoding });
|
|
96
|
+
};
|
|
97
|
+
async function accessTokenSignerCallback(jwt, kid) {
|
|
98
|
+
const issuer = opts.idOpts?.issuer ??
|
|
99
|
+
(typeof opts.idOpts?.identifier === 'string' ? opts.idOpts.identifier : (opts.didOpts?.idOpts?.identifier?.toString() ?? opts?.iss));
|
|
100
|
+
if (!issuer) {
|
|
101
|
+
throw Error('No issuer configured for access tokens');
|
|
102
|
+
}
|
|
103
|
+
let kidHeader = jwt?.header?.kid ?? kid;
|
|
104
|
+
if (!kidHeader) {
|
|
105
|
+
if (opts.idOpts?.method === 'did' ||
|
|
106
|
+
opts.idOpts?.method === 'kid' ||
|
|
107
|
+
(typeof opts.didOpts?.idOpts.identifier === 'string' && opts.didOpts?.idOpts?.identifier?.startsWith('did:'))) {
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
kidHeader = opts.idOpts?.kid ?? opts.didOpts?.idOpts?.kid ?? opts?.didOpts?.identifierOpts?.kid;
|
|
106
110
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
}
|
|
112
|
+
return await createJWT(jwt.payload, { signer, issuer }, { ...jwt.header, ...(kidHeader && { kid: kidHeader }), typ: 'JWT' });
|
|
113
|
+
}
|
|
114
|
+
return accessTokenSignerCallback;
|
|
115
|
+
}
|
|
116
|
+
export async function getCredentialSignerCallback(idOpts, context) {
|
|
117
|
+
async function issueVCCallback(args) {
|
|
118
|
+
const { jwtVerifyResult, format, statusLists } = args;
|
|
119
|
+
const credential = args.credential; // TODO: SDJWT
|
|
120
|
+
let proofFormat;
|
|
121
|
+
const resolution = await context.agent.identifierManagedGet(idOpts);
|
|
122
|
+
proofFormat = format?.includes('ld') ? 'lds' : 'jwt';
|
|
123
|
+
const issuer = resolution.issuer ?? resolution.kmsKeyRef;
|
|
124
|
+
if (CredentialMapper.isW3cCredential(credential)) {
|
|
125
|
+
if (!credential.issuer) {
|
|
126
|
+
credential.issuer = { id: issuer };
|
|
110
127
|
}
|
|
111
|
-
else {
|
|
112
|
-
|
|
113
|
-
encoding = 'base64';
|
|
128
|
+
else if (typeof credential.issuer === 'object' && !credential.issuer.id) {
|
|
129
|
+
credential.issuer.id = issuer;
|
|
114
130
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const issuer = (_b = (_a = opts.idOpts) === null || _a === void 0 ? void 0 : _a.issuer) !== null && _b !== void 0 ? _b : (typeof ((_c = opts.idOpts) === null || _c === void 0 ? void 0 : _c.identifier) === 'string' ? opts.idOpts.identifier : ((_g = (_f = (_e = (_d = opts.didOpts) === null || _d === void 0 ? void 0 : _d.idOpts) === null || _e === void 0 ? void 0 : _e.identifier) === null || _f === void 0 ? void 0 : _f.toString()) !== null && _g !== void 0 ? _g : opts === null || opts === void 0 ? void 0 : opts.iss));
|
|
121
|
-
if (!issuer) {
|
|
122
|
-
throw Error('No issuer configured for access tokens');
|
|
131
|
+
const subjectIsArray = Array.isArray(credential.credentialSubject);
|
|
132
|
+
let credentialSubjects = Array.isArray(credential.credentialSubject) ? credential.credentialSubject : [credential.credentialSubject];
|
|
133
|
+
credentialSubjects = credentialSubjects.map((subject) => {
|
|
134
|
+
if (!subject.id) {
|
|
135
|
+
subject.id = jwtVerifyResult.did;
|
|
123
136
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
137
|
+
return subject;
|
|
138
|
+
});
|
|
139
|
+
credential.credentialSubject = subjectIsArray ? credentialSubjects : credentialSubjects[0];
|
|
140
|
+
// TODO: We should extend the plugin capabilities of issuance so we do not have to tuck this into the sign callback
|
|
141
|
+
if (contextHasPlugin(context, 'slAddStatusToCredential')) {
|
|
142
|
+
// Add status list if enabled (and when the input has a credentialStatus object (can be empty))
|
|
143
|
+
const credentialStatusVC = await context.agent.slAddStatusToCredential({ credential, statusLists });
|
|
144
|
+
if (credential.credentialStatus && !credential.credentialStatus.statusListCredential) {
|
|
145
|
+
credential.credentialStatus = credentialStatusVC.credentialStatus;
|
|
146
|
+
// TODO update statusLists somehow?
|
|
132
147
|
}
|
|
133
|
-
|
|
148
|
+
}
|
|
149
|
+
const result = await context.agent.createVerifiableCredential({
|
|
150
|
+
credential: credential,
|
|
151
|
+
proofFormat,
|
|
152
|
+
removeOriginalFields: false,
|
|
153
|
+
fetchRemoteContexts: true,
|
|
154
|
+
domain: typeof credential.issuer === 'object' ? credential.issuer.id : credential.issuer,
|
|
155
|
+
...(resolution.kid && { header: { kid: resolution.kid } }),
|
|
134
156
|
});
|
|
157
|
+
return (proofFormat === 'jwt' && 'jwt' in result.proof ? result.proof.jwt : result);
|
|
135
158
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
else if (CredentialMapper.isSdJwtDecodedCredentialPayload(credential)) {
|
|
160
|
+
const sdJwtPayload = credential;
|
|
161
|
+
if (sdJwtPayload.iss === undefined) {
|
|
162
|
+
sdJwtPayload.iss = issuer;
|
|
163
|
+
}
|
|
164
|
+
if (sdJwtPayload.iat === undefined) {
|
|
165
|
+
sdJwtPayload.iat = Math.floor(new Date().getTime() / 1000);
|
|
166
|
+
}
|
|
167
|
+
let disclosureFrame;
|
|
168
|
+
if ('disclosureFrame' in credential) {
|
|
169
|
+
disclosureFrame = credential['disclosureFrame'];
|
|
170
|
+
delete credential['disclosureFrame'];
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
disclosureFrame = {
|
|
174
|
+
_sd: credential['_sd'],
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
if (contextHasPlugin(context, 'slAddStatusToSdJwtCredential')) {
|
|
178
|
+
if ((sdJwtPayload.status && sdJwtPayload.status.status_list) || (statusLists && statusLists.length > 0)) {
|
|
179
|
+
// Add status list if enabled (and when the input has a credentialStatus object (can be empty))
|
|
180
|
+
const sdJwtPayloadWithStatus = await context.agent.slAddStatusToSdJwtCredential({ credential: sdJwtPayload, statusLists });
|
|
181
|
+
if (sdJwtPayload.status?.status_list?.idx) {
|
|
182
|
+
if (!sdJwtPayloadWithStatus.status || !sdJwtPayloadWithStatus.status.status_list) {
|
|
183
|
+
// sdJwtPayload and sdJwtPayloadWithStatus is the same for now, but we should use the result anyway as this could be subject to change
|
|
184
|
+
return Promise.reject(Error('slAddStatusToSdJwtCredential did not return a status_list'));
|
|
162
185
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
// Add status list if enabled (and when the input has a credentialStatus object (can be empty))
|
|
169
|
-
const credentialStatusVC = yield context.agent.slAddStatusToCredential({ credential, statusLists });
|
|
170
|
-
if (credential.credentialStatus && !credential.credentialStatus.statusListCredential) {
|
|
171
|
-
credential.credentialStatus = credentialStatusVC.credentialStatus;
|
|
172
|
-
// TODO update statusLists somehow?
|
|
186
|
+
// Update statusListId & statusListIndex back to the credential session TODO SSISDK-4 This is not a clean way to do this.
|
|
187
|
+
if (statusLists && statusLists.length > 0) {
|
|
188
|
+
const statusList = statusLists[0];
|
|
189
|
+
statusList.statusListId = sdJwtPayloadWithStatus.status.status_list.uri;
|
|
190
|
+
statusList.statusListIndex = sdJwtPayloadWithStatus.status.status_list.idx;
|
|
173
191
|
}
|
|
192
|
+
sdJwtPayload.status.status_list.idx = sdJwtPayloadWithStatus.status.status_list.idx;
|
|
174
193
|
}
|
|
175
|
-
const result = yield context.agent.createVerifiableCredential(Object.assign({ credential: credential, proofFormat, removeOriginalFields: false, fetchRemoteContexts: true, domain: typeof credential.issuer === 'object' ? credential.issuer.id : credential.issuer }, (resolution.kid && { header: { kid: resolution.kid } })));
|
|
176
|
-
return (proofFormat === 'jwt' && 'jwt' in result.proof ? result.proof.jwt : result);
|
|
177
194
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
if (sdJwtPayload.iat === undefined) {
|
|
184
|
-
sdJwtPayload.iat = Math.floor(new Date().getTime() / 1000);
|
|
185
|
-
}
|
|
186
|
-
let disclosureFrame;
|
|
187
|
-
if ('disclosureFrame' in credential) {
|
|
188
|
-
disclosureFrame = credential['disclosureFrame'];
|
|
189
|
-
delete credential['disclosureFrame'];
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
disclosureFrame = {
|
|
193
|
-
_sd: credential['_sd'],
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
if ((0, ssi_sdk_agent_config_1.contextHasPlugin)(context, 'slAddStatusToSdJwtCredential')) {
|
|
197
|
-
if ((sdJwtPayload.status && sdJwtPayload.status.status_list) || (statusLists && statusLists.length > 0)) {
|
|
198
|
-
// Add status list if enabled (and when the input has a credentialStatus object (can be empty))
|
|
199
|
-
const sdJwtPayloadWithStatus = yield context.agent.slAddStatusToSdJwtCredential({ credential: sdJwtPayload, statusLists });
|
|
200
|
-
if ((_c = (_b = sdJwtPayload.status) === null || _b === void 0 ? void 0 : _b.status_list) === null || _c === void 0 ? void 0 : _c.idx) {
|
|
201
|
-
if (!sdJwtPayloadWithStatus.status || !sdJwtPayloadWithStatus.status.status_list) {
|
|
202
|
-
// sdJwtPayload and sdJwtPayloadWithStatus is the same for now, but we should use the result anyway as this could be subject to change
|
|
203
|
-
return Promise.reject(Error('slAddStatusToSdJwtCredential did not return a status_list'));
|
|
204
|
-
}
|
|
205
|
-
// Update statusListId & statusListIndex back to the credential session TODO SSISDK-4 This is not a clean way to do this.
|
|
206
|
-
if (statusLists && statusLists.length > 0) {
|
|
207
|
-
const statusList = statusLists[0];
|
|
208
|
-
statusList.statusListId = sdJwtPayloadWithStatus.status.status_list.uri;
|
|
209
|
-
statusList.statusListIndex = sdJwtPayloadWithStatus.status.status_list.idx;
|
|
210
|
-
}
|
|
211
|
-
sdJwtPayload.status.status_list.idx = sdJwtPayloadWithStatus.status.status_list.idx;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
const result = yield context.agent.createSdJwtVc({
|
|
216
|
-
credentialPayload: sdJwtPayload,
|
|
217
|
-
disclosureFrame: disclosureFrame,
|
|
218
|
-
resolution,
|
|
219
|
-
});
|
|
220
|
-
return result.credential;
|
|
221
|
-
} /*else if (CredentialMapper.isMsoMdocDecodedCredential(credential)) {
|
|
222
|
-
TODO
|
|
223
|
-
}*/
|
|
224
|
-
return Promise.reject('VC issuance failed, an incorrect or unsupported credential was supplied');
|
|
195
|
+
}
|
|
196
|
+
const result = await context.agent.createSdJwtVc({
|
|
197
|
+
credentialPayload: sdJwtPayload,
|
|
198
|
+
disclosureFrame: disclosureFrame,
|
|
199
|
+
resolution,
|
|
225
200
|
});
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
201
|
+
return result.credential;
|
|
202
|
+
} /*else if (CredentialMapper.isMsoMdocDecodedCredential(credential)) {
|
|
203
|
+
TODO
|
|
204
|
+
}*/
|
|
205
|
+
return Promise.reject('VC issuance failed, an incorrect or unsupported credential was supplied');
|
|
206
|
+
}
|
|
207
|
+
return issueVCCallback;
|
|
229
208
|
}
|
|
230
|
-
function createVciIssuerBuilder(args, context) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
209
|
+
export async function createVciIssuerBuilder(args, context) {
|
|
210
|
+
const { issuerOpts, issuerMetadata, authorizationServerMetadata } = args;
|
|
211
|
+
const builder = new VcIssuerBuilder();
|
|
212
|
+
// @ts-ignore
|
|
213
|
+
const resolver = args.resolver ??
|
|
214
|
+
args?.issuerOpts?.didOpts?.resolveOpts?.resolver ??
|
|
215
|
+
args.issuerOpts?.didOpts?.resolveOpts?.jwtVerifyOpts?.resolver ??
|
|
216
|
+
getAgentResolver(context);
|
|
217
|
+
if (!resolver) {
|
|
218
|
+
throw Error('A Resolver is necessary to verify DID JWTs');
|
|
219
|
+
}
|
|
220
|
+
const idOpts = legacyKeyRefsToIdentifierOpts({ didOpts: issuerOpts.didOpts, idOpts: issuerOpts.idOpts });
|
|
221
|
+
const jwtVerifyOpts = {
|
|
222
|
+
...issuerOpts?.didOpts?.resolveOpts?.jwtVerifyOpts,
|
|
223
|
+
...args?.issuerOpts?.resolveOpts?.jwtVerifyOpts,
|
|
224
|
+
resolver,
|
|
225
|
+
audience: issuerMetadata.credential_issuer, // FIXME legacy version had {display: NameAndLocale | NameAndLocale[]} as credential_issuer
|
|
226
|
+
};
|
|
227
|
+
builder.withIssuerMetadata(issuerMetadata);
|
|
228
|
+
builder.withAuthorizationMetadata(authorizationServerMetadata);
|
|
229
|
+
// builder.withUserPinRequired(issuerOpts.userPinRequired ?? false) was removed from implementers draft v1
|
|
230
|
+
builder.withCredentialSignerCallback(await getCredentialSignerCallback(idOpts, context));
|
|
231
|
+
if (issuerOpts.asClientOpts) {
|
|
232
|
+
builder.withASClientMetadata(issuerOpts.asClientOpts);
|
|
235
233
|
// @ts-ignore
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
builder.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
// const authorizationServer = issuerMetadata.authorization_servers[0] as string
|
|
250
|
-
// Set the OIDC verifier
|
|
251
|
-
// builder.withJWTVerifyCallback(oidcAccessTokenVerifyCallback({clientMetadata: issuerOpts.asClientOpts, credentialIssuer: issuerMetadata.credential_issuer as string, authorizationServer}))
|
|
252
|
-
}
|
|
253
|
-
// Do not use it when asClient is used
|
|
254
|
-
builder.withJWTVerifyCallback(getJwtVerifyCallback({ verifyOpts: jwtVerifyOpts }, context));
|
|
255
|
-
if (args.credentialDataSupplier) {
|
|
256
|
-
builder.withCredentialDataSupplier(args.credentialDataSupplier);
|
|
257
|
-
}
|
|
258
|
-
builder.withInMemoryCNonceState();
|
|
259
|
-
builder.withInMemoryCredentialOfferState();
|
|
260
|
-
builder.withInMemoryCredentialOfferURIState();
|
|
261
|
-
return builder;
|
|
262
|
-
});
|
|
234
|
+
// const authorizationServer = issuerMetadata.authorization_servers[0] as string
|
|
235
|
+
// Set the OIDC verifier
|
|
236
|
+
// builder.withJWTVerifyCallback(oidcAccessTokenVerifyCallback({clientMetadata: issuerOpts.asClientOpts, credentialIssuer: issuerMetadata.credential_issuer as string, authorizationServer}))
|
|
237
|
+
}
|
|
238
|
+
// Do not use it when asClient is used
|
|
239
|
+
builder.withJWTVerifyCallback(getJwtVerifyCallback({ verifyOpts: jwtVerifyOpts }, context));
|
|
240
|
+
if (args.credentialDataSupplier) {
|
|
241
|
+
builder.withCredentialDataSupplier(args.credentialDataSupplier);
|
|
242
|
+
}
|
|
243
|
+
builder.withInMemoryCNonceState();
|
|
244
|
+
builder.withInMemoryCredentialOfferState();
|
|
245
|
+
builder.withInMemoryCredentialOfferURIState();
|
|
246
|
+
return builder;
|
|
263
247
|
}
|
|
264
|
-
function createVciIssuer(
|
|
265
|
-
return
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}, context)).build();
|
|
272
|
-
});
|
|
248
|
+
export async function createVciIssuer({ issuerOpts, issuerMetadata, authorizationServerMetadata, credentialDataSupplier, }, context) {
|
|
249
|
+
return (await createVciIssuerBuilder({
|
|
250
|
+
issuerOpts,
|
|
251
|
+
issuerMetadata,
|
|
252
|
+
authorizationServerMetadata,
|
|
253
|
+
credentialDataSupplier,
|
|
254
|
+
}, context)).build();
|
|
273
255
|
}
|
|
274
|
-
function createAuthRequestUriCallback(opts) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
return authRequestUriCallback;
|
|
299
|
-
});
|
|
256
|
+
export async function createAuthRequestUriCallback(opts) {
|
|
257
|
+
async function authRequestUriCallback() {
|
|
258
|
+
const path = opts.path.replace(':definitionId', opts.presentationDefinitionId);
|
|
259
|
+
return fetch(path, {
|
|
260
|
+
method: 'POST',
|
|
261
|
+
headers: {
|
|
262
|
+
'Content-Type': 'application/json',
|
|
263
|
+
},
|
|
264
|
+
}).then(async (response) => {
|
|
265
|
+
if (response.status >= 400) {
|
|
266
|
+
return Promise.reject(Error(await response.text()));
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
const responseData = await response.json();
|
|
270
|
+
if (!responseData.authRequestURI) {
|
|
271
|
+
return Promise.reject(Error('Missing auth request uri in response body'));
|
|
272
|
+
}
|
|
273
|
+
return responseData.authRequestURI;
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
return authRequestUriCallback;
|
|
300
278
|
}
|
|
301
|
-
function createVerifyAuthResponseCallback(opts) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
return verifyAuthResponseCallback;
|
|
326
|
-
});
|
|
279
|
+
export async function createVerifyAuthResponseCallback(opts) {
|
|
280
|
+
async function verifyAuthResponseCallback(correlationId) {
|
|
281
|
+
return fetch(opts.path, {
|
|
282
|
+
method: 'POST',
|
|
283
|
+
headers: {
|
|
284
|
+
'Content-Type': 'application/json',
|
|
285
|
+
},
|
|
286
|
+
body: JSON.stringify({ definitionId: opts.presentationDefinitionId, correlationId }),
|
|
287
|
+
}).then(async (response) => {
|
|
288
|
+
if (response.status >= 400) {
|
|
289
|
+
return Promise.reject(Error(await response.text()));
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
const responseData = await response.json();
|
|
293
|
+
if (!responseData.status) {
|
|
294
|
+
return Promise.reject(Error('Missing status in response body'));
|
|
295
|
+
}
|
|
296
|
+
return responseData.status === AuthorizationResponseStateStatus.VERIFIED;
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
return verifyAuthResponseCallback;
|
|
327
301
|
}
|
|
328
302
|
//# sourceMappingURL=functions.js.map
|
package/dist/functions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AA2BA,oDAoEC;AAED,oDAuBC;AAED,oEA8DC;AAED,kEA6GC;AAED,wDAoDC;AAED,0CAyBC;AAED,oEAwBC;AAED,4EA2BC;AApaD,6DAA+I;AAC/I,2EAA+E;AAC/E,mGAA0H;AAC1H,yEAAiE;AAGjE,mDAA4G;AAE5G,yCAA6C;AAC7C,qCAA2E;AAE3E,2CAAsC;AAEtC,8DAA+B;AAC/B,2DAA0E;AAE1E,SAAgB,oBAAoB,CAAC,EAAE,UAAU,EAAqC,EAAE,QAA0B;IAChH,OAAO,CAAO,IAAmC,EAA4B,EAAE;;QAC7E,MAAM,QAAQ,GAAG,IAAA,wCAAgB,EAAC,QAAQ,EAAE;YAC1C,kBAAkB,EAAE,IAAI;YACxB,qBAAqB,EAAE,IAAI;YAC3B,eAAe,EAAE,IAAI;SACtB,CAAC,CAAA;QACF,UAAU,mCAAQ,UAAU,KAAE,QAAQ,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,GAAE,CAAA,CAAC,4CAA4C;QAC3G,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,CAAA,IAAI,OAAO,CAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,0CAAE,OAAO,CAAA,KAAK,UAAU,EAAE,CAAC;YACjF,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAA;QAChC,CAAC;QACD,MAAM,MAAM,GAAG,MA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M,QAAQ,CAAC,IAAI,EAAE,CAAA;gBAE1C,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;oBACzB,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC,CAAA;gBACjE,CAAC;gBAED,OAAO,YAAY,CAAC,MAAM,KAAK,gCAAgC,CAAC,QAAQ,CAAA;YAC1E,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,0BAA0B,CAAA;AACnC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,28 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.OID4VCIIssuer = exports.schema = void 0;
|
|
18
1
|
/**
|
|
19
2
|
* @public
|
|
20
3
|
*/
|
|
21
4
|
const schema = require('../plugin.schema.json');
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
__exportStar(require("./types/IOID4VCIIssuer"), exports);
|
|
5
|
+
export { schema };
|
|
6
|
+
export { OID4VCIIssuer } from './agent/OID4VCIIssuer';
|
|
7
|
+
export * from './functions';
|
|
8
|
+
export * from './IssuerInstance';
|
|
9
|
+
export * from './types/IOID4VCIIssuer';
|
|
28
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.oid4vci-issuer",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"@sphereon/ssi-sdk-ext.did-utils": "0.28.0",
|
|
21
21
|
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.28.0",
|
|
22
22
|
"@sphereon/ssi-sdk-ext.jwt-service": "0.28.0",
|
|
23
|
-
"@sphereon/ssi-sdk.agent-config": "0.33.
|
|
24
|
-
"@sphereon/ssi-sdk.core": "0.33.
|
|
25
|
-
"@sphereon/ssi-sdk.data-store": "0.33.
|
|
26
|
-
"@sphereon/ssi-sdk.kv-store-temp": "0.33.
|
|
27
|
-
"@sphereon/ssi-sdk.mdl-mdoc": "0.33.
|
|
28
|
-
"@sphereon/ssi-sdk.oid4vci-issuer-store": "0.33.
|
|
29
|
-
"@sphereon/ssi-sdk.sd-jwt": "0.33.
|
|
30
|
-
"@sphereon/ssi-sdk.vc-status-list": "0.33.
|
|
31
|
-
"@sphereon/ssi-sdk.vc-status-list-issuer": "0.33.
|
|
32
|
-
"@sphereon/ssi-types": "0.33.
|
|
23
|
+
"@sphereon/ssi-sdk.agent-config": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
24
|
+
"@sphereon/ssi-sdk.core": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
25
|
+
"@sphereon/ssi-sdk.data-store": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
26
|
+
"@sphereon/ssi-sdk.kv-store-temp": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
27
|
+
"@sphereon/ssi-sdk.mdl-mdoc": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
28
|
+
"@sphereon/ssi-sdk.oid4vci-issuer-store": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
29
|
+
"@sphereon/ssi-sdk.sd-jwt": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
30
|
+
"@sphereon/ssi-sdk.vc-status-list": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
31
|
+
"@sphereon/ssi-sdk.vc-status-list-issuer": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
32
|
+
"@sphereon/ssi-types": "0.33.1-feature.vcdm2.4+9f634bdb",
|
|
33
33
|
"@types/uuid": "^9.0.8",
|
|
34
34
|
"@veramo/core": "4.2.0",
|
|
35
35
|
"@veramo/credential-w3c": "4.2.0",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"Authenticator"
|
|
75
75
|
],
|
|
76
76
|
"nx": {},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "9f634bdb714061141e277508c124b08d626f6036"
|
|
78
78
|
}
|