@sphereon/ssi-sdk-ext.identifier-resolution 0.24.1-next.97 → 0.24.1-unstable.111
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/agent/IdentifierResolution.d.ts +3 -0
- package/dist/agent/IdentifierResolution.d.ts.map +1 -1
- package/dist/agent/IdentifierResolution.js +19 -1
- package/dist/agent/IdentifierResolution.js.map +1 -1
- package/dist/functions/LegacySupport.d.ts +12 -0
- package/dist/functions/LegacySupport.d.ts.map +1 -0
- package/dist/functions/LegacySupport.js +40 -0
- package/dist/functions/LegacySupport.js.map +1 -0
- package/dist/functions/externalIdentifierFunctions.d.ts +17 -1
- package/dist/functions/externalIdentifierFunctions.d.ts.map +1 -1
- package/dist/functions/externalIdentifierFunctions.js +82 -2
- package/dist/functions/externalIdentifierFunctions.js.map +1 -1
- package/dist/functions/index.d.ts +1 -11
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.js +1 -36
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/managedIdentifierFunctions.d.ts +16 -5
- package/dist/functions/managedIdentifierFunctions.d.ts.map +1 -1
- package/dist/functions/managedIdentifierFunctions.js +66 -6
- package/dist/functions/managedIdentifierFunctions.js.map +1 -1
- package/dist/types/IIdentifierResolution.d.ts +10 -3
- package/dist/types/IIdentifierResolution.d.ts.map +1 -1
- package/dist/types/IIdentifierResolution.js +3 -0
- package/dist/types/IIdentifierResolution.js.map +1 -1
- package/dist/types/common.d.ts +2 -1
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +5 -1
- package/dist/types/common.js.map +1 -1
- package/dist/types/externalIdentifierTypes.d.ts +23 -6
- package/dist/types/externalIdentifierTypes.d.ts.map +1 -1
- package/dist/types/externalIdentifierTypes.js +6 -1
- package/dist/types/externalIdentifierTypes.js.map +1 -1
- package/dist/types/managedIdentifierTypes.d.ts +29 -7
- package/dist/types/managedIdentifierTypes.d.ts.map +1 -1
- package/dist/types/managedIdentifierTypes.js +10 -1
- package/dist/types/managedIdentifierTypes.js.map +1 -1
- package/package.json +12 -12
- package/plugin.schema.json +2126 -222
- package/src/agent/IdentifierResolution.ts +56 -10
- package/src/functions/LegacySupport.ts +54 -0
- package/src/functions/externalIdentifierFunctions.ts +94 -4
- package/src/functions/index.ts +1 -51
- package/src/functions/managedIdentifierFunctions.ts +79 -10
- package/src/types/IIdentifierResolution.ts +24 -2
- package/src/types/common.ts +5 -1
- package/src/types/externalIdentifierTypes.ts +54 -13
- package/src/types/managedIdentifierTypes.ts +47 -8
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.managedIdentifierToJwk = exports.managedIdentifierToKeyResult = exports.getManagedIdentifier = exports.getManagedX5cIdentifier = exports.getManagedJwkIdentifier = exports.getManagedDidIdentifier = exports.getManagedKeyIdentifier = exports.ensureManagedIdentifierResult = exports.getManagedKidIdentifier = void 0;
|
|
12
|
+
exports.managedIdentifierToJwk = exports.managedIdentifierToKeyResult = exports.getManagedIdentifier = exports.getManagedX5cIdentifier = exports.getManagedJwkIdentifier = exports.getManagedDidIdentifier = exports.getManagedCoseKeyIdentifier = exports.getManagedKeyIdentifier = exports.ensureManagedIdentifierResult = exports.isManagedIdentifierResult = exports.getManagedKidIdentifier = void 0;
|
|
13
13
|
const ssi_sdk_ext_did_utils_1 = require("@sphereon/ssi-sdk-ext.did-utils");
|
|
14
14
|
const ssi_sdk_ext_key_utils_1 = require("@sphereon/ssi-sdk-ext.key-utils");
|
|
15
15
|
const ssi_sdk_ext_x509_utils_1 = require("@sphereon/ssi-sdk-ext.x509-utils");
|
|
@@ -23,6 +23,9 @@ function getManagedKidIdentifier(opts, context) {
|
|
|
23
23
|
if (!(0, ssi_sdk_agent_config_1.contextHasKeyManager)(context)) {
|
|
24
24
|
return Promise.reject(Error(`Cannot get Key/JWK identifier if KeyManager plugin is not enabled!`));
|
|
25
25
|
}
|
|
26
|
+
else if (opts.identifier.startsWith('did:')) {
|
|
27
|
+
return Promise.reject(Error(`managed kid resolution called but a did url was passed in. Please call the did resolution method`));
|
|
28
|
+
}
|
|
26
29
|
const key = yield context.agent.keyManagerGet({ kid: (_a = opts.kmsKeyRef) !== null && _a !== void 0 ? _a : opts.identifier });
|
|
27
30
|
const jwk = (0, ssi_sdk_ext_key_utils_1.toJwk)(key.publicKeyHex, key.type, { key });
|
|
28
31
|
const jwkThumbprint = (_c = (_b = key.meta) === null || _b === void 0 ? void 0 : _b.jwkThumbprint) !== null && _c !== void 0 ? _c : (0, ssi_sdk_ext_key_utils_1.calculateJwkThumbprint)({ jwk });
|
|
@@ -31,9 +34,12 @@ function getManagedKidIdentifier(opts, context) {
|
|
|
31
34
|
return {
|
|
32
35
|
method,
|
|
33
36
|
key,
|
|
37
|
+
identifier: opts.identifier,
|
|
34
38
|
jwk,
|
|
35
39
|
jwkThumbprint,
|
|
36
40
|
kid,
|
|
41
|
+
clientId: opts.clientId,
|
|
42
|
+
clientIdScheme: opts.clientIdScheme,
|
|
37
43
|
issuer,
|
|
38
44
|
kmsKeyRef: key.kid,
|
|
39
45
|
opts,
|
|
@@ -41,6 +47,10 @@ function getManagedKidIdentifier(opts, context) {
|
|
|
41
47
|
});
|
|
42
48
|
}
|
|
43
49
|
exports.getManagedKidIdentifier = getManagedKidIdentifier;
|
|
50
|
+
function isManagedIdentifierResult(identifier) {
|
|
51
|
+
return 'key' in identifier && 'kmsKeyRef' in identifier && 'method' in identifier && 'opts' in identifier && 'jwkThumbprint' in identifier;
|
|
52
|
+
}
|
|
53
|
+
exports.isManagedIdentifierResult = isManagedIdentifierResult;
|
|
44
54
|
/**
|
|
45
55
|
* Allows to get a managed identifier result in case identifier options are passed in, but returns the identifier directly in case results are passed in. This means resolution can have happened before, or happens in this method
|
|
46
56
|
* @param identifier
|
|
@@ -48,9 +58,8 @@ exports.getManagedKidIdentifier = getManagedKidIdentifier;
|
|
|
48
58
|
*/
|
|
49
59
|
function ensureManagedIdentifierResult(identifier, context) {
|
|
50
60
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
: yield context.agent.identifierManagedGet(identifier);
|
|
61
|
+
const { lazyDisabled = false } = identifier;
|
|
62
|
+
return !lazyDisabled && isManagedIdentifierResult(identifier) ? identifier : yield getManagedIdentifier(identifier, context);
|
|
54
63
|
});
|
|
55
64
|
}
|
|
56
65
|
exports.ensureManagedIdentifierResult = ensureManagedIdentifierResult;
|
|
@@ -74,16 +83,53 @@ function getManagedKeyIdentifier(opts, _context) {
|
|
|
74
83
|
return {
|
|
75
84
|
method,
|
|
76
85
|
key,
|
|
86
|
+
identifier: key,
|
|
77
87
|
jwk,
|
|
78
88
|
jwkThumbprint,
|
|
79
89
|
kid,
|
|
80
90
|
issuer,
|
|
81
91
|
kmsKeyRef: key.kid,
|
|
92
|
+
clientId: opts.clientId,
|
|
93
|
+
clientIdScheme: opts.clientIdScheme,
|
|
82
94
|
opts,
|
|
83
95
|
};
|
|
84
96
|
});
|
|
85
97
|
}
|
|
86
98
|
exports.getManagedKeyIdentifier = getManagedKeyIdentifier;
|
|
99
|
+
/**
|
|
100
|
+
* This function is just a convenience function to get a common result. The user already apparently had a key, so could have called the kid version as well
|
|
101
|
+
* @param opts
|
|
102
|
+
* @param context
|
|
103
|
+
*/
|
|
104
|
+
function getManagedCoseKeyIdentifier(opts, context) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
var _a, _b, _c;
|
|
107
|
+
const method = 'cose_key';
|
|
108
|
+
const coseKey = opts.identifier;
|
|
109
|
+
if (!(0, ssi_sdk_agent_config_1.contextHasKeyManager)(context)) {
|
|
110
|
+
return Promise.reject(Error(`Cannot get Cose Key identifier if KeyManager plugin is not enabled!`));
|
|
111
|
+
}
|
|
112
|
+
const jwk = (0, ssi_sdk_ext_key_utils_1.coseKeyToJwk)(coseKey);
|
|
113
|
+
const jwkThumbprint = (0, ssi_sdk_ext_key_utils_1.calculateJwkThumbprint)({ jwk });
|
|
114
|
+
const key = yield context.agent.keyManagerGet({ kid: (_a = opts.kmsKeyRef) !== null && _a !== void 0 ? _a : jwkThumbprint });
|
|
115
|
+
const kid = (_c = (_b = opts.kid) !== null && _b !== void 0 ? _b : coseKey.kid) !== null && _c !== void 0 ? _c : jwkThumbprint;
|
|
116
|
+
const issuer = opts.issuer;
|
|
117
|
+
return {
|
|
118
|
+
method,
|
|
119
|
+
key,
|
|
120
|
+
identifier: opts.identifier,
|
|
121
|
+
jwk,
|
|
122
|
+
jwkThumbprint,
|
|
123
|
+
kid,
|
|
124
|
+
issuer,
|
|
125
|
+
kmsKeyRef: key.kid,
|
|
126
|
+
clientId: opts.clientId,
|
|
127
|
+
clientIdScheme: opts.clientIdScheme,
|
|
128
|
+
opts,
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
exports.getManagedCoseKeyIdentifier = getManagedCoseKeyIdentifier;
|
|
87
133
|
function getManagedDidIdentifier(opts, context) {
|
|
88
134
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
135
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -124,6 +170,8 @@ function getManagedDidIdentifier(opts, context) {
|
|
|
124
170
|
keys,
|
|
125
171
|
issuer,
|
|
126
172
|
identifier,
|
|
173
|
+
clientId: opts.clientId,
|
|
174
|
+
clientIdScheme: opts.clientIdScheme,
|
|
127
175
|
opts,
|
|
128
176
|
};
|
|
129
177
|
});
|
|
@@ -145,10 +193,13 @@ function getManagedJwkIdentifier(opts, context) {
|
|
|
145
193
|
method,
|
|
146
194
|
key,
|
|
147
195
|
kmsKeyRef: key.kid,
|
|
196
|
+
identifier: jwk,
|
|
148
197
|
jwk,
|
|
149
198
|
jwkThumbprint,
|
|
150
199
|
kid,
|
|
151
200
|
issuer,
|
|
201
|
+
clientId: opts.clientId,
|
|
202
|
+
clientIdScheme: opts.clientIdScheme,
|
|
152
203
|
opts,
|
|
153
204
|
};
|
|
154
205
|
});
|
|
@@ -178,6 +229,7 @@ function getManagedX5cIdentifier(opts, context) {
|
|
|
178
229
|
return {
|
|
179
230
|
method,
|
|
180
231
|
x5c,
|
|
232
|
+
identifier: x5c,
|
|
181
233
|
certificate,
|
|
182
234
|
jwk,
|
|
183
235
|
jwkThumbprint,
|
|
@@ -185,6 +237,8 @@ function getManagedX5cIdentifier(opts, context) {
|
|
|
185
237
|
kmsKeyRef: key.kid,
|
|
186
238
|
kid,
|
|
187
239
|
issuer,
|
|
240
|
+
clientId: opts.clientId,
|
|
241
|
+
clientIdScheme: opts.clientIdScheme,
|
|
188
242
|
opts,
|
|
189
243
|
};
|
|
190
244
|
});
|
|
@@ -193,6 +247,9 @@ exports.getManagedX5cIdentifier = getManagedX5cIdentifier;
|
|
|
193
247
|
function getManagedIdentifier(opts, context) {
|
|
194
248
|
return __awaiter(this, void 0, void 0, function* () {
|
|
195
249
|
let resolutionResult;
|
|
250
|
+
if (isManagedIdentifierResult(opts)) {
|
|
251
|
+
opts;
|
|
252
|
+
}
|
|
196
253
|
if ((0, types_1.isManagedIdentifierKidOpts)(opts)) {
|
|
197
254
|
resolutionResult = yield getManagedKidIdentifier(opts, context);
|
|
198
255
|
}
|
|
@@ -208,6 +265,9 @@ function getManagedIdentifier(opts, context) {
|
|
|
208
265
|
else if ((0, types_1.isManagedIdentifierKeyOpts)(opts)) {
|
|
209
266
|
resolutionResult = yield getManagedKeyIdentifier(opts, context);
|
|
210
267
|
}
|
|
268
|
+
else if ((0, types_1.isManagedIdentifierCoseKeyOpts)(opts)) {
|
|
269
|
+
resolutionResult = yield getManagedCoseKeyIdentifier(opts, context);
|
|
270
|
+
}
|
|
211
271
|
else {
|
|
212
272
|
return Promise.reject(Error(`Could not determine identifier method. Please provide explicitly`));
|
|
213
273
|
}
|
|
@@ -226,7 +286,7 @@ function managedIdentifierToKeyResult(identifier, context) {
|
|
|
226
286
|
if ((0, types_1.isManagedIdentifierKeyResult)(resolved)) {
|
|
227
287
|
return resolved;
|
|
228
288
|
}
|
|
229
|
-
return Object.assign(Object.assign({}, resolved), { method: 'key' });
|
|
289
|
+
return Object.assign(Object.assign({}, resolved), { method: 'key', identifier: resolved.key });
|
|
230
290
|
});
|
|
231
291
|
}
|
|
232
292
|
exports.managedIdentifierToKeyResult = managedIdentifierToKeyResult;
|
|
@@ -236,7 +296,7 @@ function managedIdentifierToJwk(identifier, context) {
|
|
|
236
296
|
if ((0, types_1.isManagedIdentifierJwkResult)(resolved)) {
|
|
237
297
|
return resolved;
|
|
238
298
|
}
|
|
239
|
-
return Object.assign(Object.assign({}, resolved), { method: 'jwk' });
|
|
299
|
+
return Object.assign(Object.assign({}, resolved), { method: 'jwk', identifier: resolved.jwk });
|
|
240
300
|
});
|
|
241
301
|
}
|
|
242
302
|
exports.managedIdentifierToJwk = managedIdentifierToJwk;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managedIdentifierFunctions.js","sourceRoot":"","sources":["../../src/functions/managedIdentifierFunctions.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2EAAyE;AACzE,
|
|
1
|
+
{"version":3,"file":"managedIdentifierFunctions.js","sourceRoot":"","sources":["../../src/functions/managedIdentifierFunctions.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2EAAyE;AACzE,2EAA6F;AAC7F,6EAA4E;AAC5E,yEAA2F;AAG3F,iCAA+C;AAC/C,oCAyBiB;AAEjB,SAAsB,uBAAuB,CAC3C,IAA8B,EAC9B,OAAmC;;;QAEnC,MAAM,MAAM,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,IAAA,2CAAoB,EAAC,OAAO,CAAC,EAAE,CAAC;YACnC,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC,CAAA;QACpG,CAAC;aAAM,IAAI,IAAI,CAAC,UAAU,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CACF,QAAQ,KACX,MAAM,EAAE,KAAK,EACb,UAAU,EAAE,QAAQ,CAAC,GAAG,GACY,CAAA;IACxC,CAAC;CAAA;AAbD,oEAaC;AAED,SAAsB,sBAAsB,CAC1C,UAAyC,EACzC,OAA2D;;QAE3D,MAAM,QAAQ,GAAG,MAAM,6BAA6B,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;QACzE,IAAI,IAAA,oCAA4B,EAAC,QAAQ,CAAC,EAAE,CAAC;YAC3C,OAAO,QAAQ,CAAA;QACjB,CAAC;QACD,OAAO,gCACF,QAAQ,KACX,MAAM,EAAE,KAAK,EACb,UAAU,EAAE,QAAQ,CAAC,GAAG,GACY,CAAA;IACxC,CAAC;CAAA;AAbD,wDAaC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IAgentContext, IDIDManager, IKeyManager, IPluginMethodMap } from '@veramo/core';
|
|
2
|
-
import { ExternalIdentifierDidOpts, ExternalIdentifierDidResult, ExternalIdentifierOpts, ExternalIdentifierResult, ExternalIdentifierX5cOpts, ExternalIdentifierX5cResult } from './externalIdentifierTypes';
|
|
3
|
-
import { ManagedIdentifierDidOpts, ManagedIdentifierDidResult, ManagedIdentifierJwkOpts, ManagedIdentifierJwkResult, ManagedIdentifierKeyOpts, ManagedIdentifierKeyResult, ManagedIdentifierKidOpts, ManagedIdentifierKidResult,
|
|
2
|
+
import { ExternalIdentifierCoseKeyOpts, ExternalIdentifierCoseKeyResult, ExternalIdentifierDidOpts, ExternalIdentifierDidResult, ExternalIdentifierJwkOpts, ExternalIdentifierJwkResult, ExternalIdentifierOpts, ExternalIdentifierResult, ExternalIdentifierX5cOpts, ExternalIdentifierX5cResult } from './externalIdentifierTypes';
|
|
3
|
+
import { ManagedIdentifierCoseKeyOpts, ManagedIdentifierCoseKeyResult, ManagedIdentifierDidOpts, ManagedIdentifierDidResult, ManagedIdentifierJwkOpts, ManagedIdentifierJwkResult, ManagedIdentifierKeyOpts, ManagedIdentifierKeyResult, ManagedIdentifierKidOpts, ManagedIdentifierKidResult, ManagedIdentifierOptsOrResult, ManagedIdentifierResult, ManagedIdentifierX5cOpts, ManagedIdentifierX5cResult } from './managedIdentifierTypes';
|
|
4
4
|
export declare const identifierResolutionContextMethods: Array<string>;
|
|
5
5
|
/**
|
|
6
6
|
* @public
|
|
@@ -10,16 +10,21 @@ export interface IIdentifierResolution extends IPluginMethodMap {
|
|
|
10
10
|
* Main method for managed identifiers. We always go through this method (also the others) as we want to integrate a plugin for anomaly detection. Having a single method helps
|
|
11
11
|
*
|
|
12
12
|
* The end result of all these methods is a common baseline response that allows to use a key from the registered KMS systems. It also provides kid and iss(uer) values that can be used in a JWT/JWS for instance
|
|
13
|
+
* Allows to get a managed identifier result in case identifier options are passed in, but returns the identifier directly in case results are passed in. This means resolution can have happened before, or happens in this method
|
|
14
|
+
*
|
|
15
|
+
* We use the opts or result type almost everywhere, as it allows for just in time resolution whenever this method is called and afterwards we have the result, so resolution doesn't have to hit the DB, or external endpoints.
|
|
16
|
+
* Also use this method in the local agent, not using REST. If case the identifier needs to be resolved, you can always have the above methods using REST
|
|
13
17
|
* @param args
|
|
14
18
|
* @param context
|
|
15
19
|
* @public
|
|
16
20
|
*/
|
|
17
|
-
identifierManagedGet(args:
|
|
21
|
+
identifierManagedGet(args: ManagedIdentifierOptsOrResult, context: IAgentContext<IKeyManager>): Promise<ManagedIdentifierResult>;
|
|
18
22
|
identifierManagedGetByDid(args: ManagedIdentifierDidOpts, context: IAgentContext<IKeyManager & IDIDManager>): Promise<ManagedIdentifierDidResult>;
|
|
19
23
|
identifierManagedGetByKid(args: ManagedIdentifierKidOpts, context: IAgentContext<IKeyManager>): Promise<ManagedIdentifierKidResult>;
|
|
20
24
|
identifierManagedGetByJwk(args: ManagedIdentifierJwkOpts, context: IAgentContext<IKeyManager>): Promise<ManagedIdentifierJwkResult>;
|
|
21
25
|
identifierManagedGetByX5c(args: ManagedIdentifierX5cOpts, context: IAgentContext<IKeyManager>): Promise<ManagedIdentifierX5cResult>;
|
|
22
26
|
identifierManagedGetByKey(args: ManagedIdentifierKeyOpts, context: IAgentContext<IKeyManager>): Promise<ManagedIdentifierKeyResult>;
|
|
27
|
+
identifierManagedGetByCoseKey(args: ManagedIdentifierCoseKeyOpts, context: IAgentContext<IKeyManager & IIdentifierResolution>): Promise<ManagedIdentifierCoseKeyResult>;
|
|
23
28
|
/**
|
|
24
29
|
* Main method for external identifiers. We always go through this method (also the others) as we want to integrate a plugin for anomaly detection. Having a single method helps
|
|
25
30
|
* @param args
|
|
@@ -28,6 +33,8 @@ export interface IIdentifierResolution extends IPluginMethodMap {
|
|
|
28
33
|
*/
|
|
29
34
|
identifierExternalResolve(args: ExternalIdentifierOpts, context: IAgentContext<any>): Promise<ExternalIdentifierResult>;
|
|
30
35
|
identifierExternalResolveByDid(args: ExternalIdentifierDidOpts, context: IAgentContext<any>): Promise<ExternalIdentifierDidResult>;
|
|
36
|
+
identifierExternalResolveByJwk(args: ExternalIdentifierJwkOpts, context: IAgentContext<any>): Promise<ExternalIdentifierJwkResult>;
|
|
37
|
+
identifierExternalResolveByCoseKey(args: ExternalIdentifierCoseKeyOpts, context: IAgentContext<any>): Promise<ExternalIdentifierCoseKeyResult>;
|
|
31
38
|
identifierExternalResolveByX5c(args: ExternalIdentifierX5cOpts, context: IAgentContext<any>): Promise<ExternalIdentifierX5cResult>;
|
|
32
39
|
}
|
|
33
40
|
//# sourceMappingURL=IIdentifierResolution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IIdentifierResolution.d.ts","sourceRoot":"","sources":["../../src/types/IIdentifierResolution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACxF,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC5B,MAAM,2BAA2B,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ContextMethods = [
|
|
|
9
9
|
'identifierManagedGetByJwk',
|
|
10
10
|
'identifierManagedGetByX5c',
|
|
11
11
|
'identifierManagedGetByKey',
|
|
12
|
+
'identifierGetManagedByCoseKey',
|
|
12
13
|
'identifierExternalResolve',
|
|
13
14
|
'identifierExternalResolveByDid',
|
|
14
15
|
'identifierExternalResolveByX5c',
|
|
16
|
+
'identifierExternalResolveByJwk',
|
|
17
|
+
'identifierExternalResolveByCoseKey',
|
|
15
18
|
];
|
|
16
19
|
//# sourceMappingURL=IIdentifierResolution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IIdentifierResolution.js","sourceRoot":"","sources":["../../src/types/IIdentifierResolution.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"IIdentifierResolution.js","sourceRoot":"","sources":["../../src/types/IIdentifierResolution.ts"],"names":[],"mappings":";;;AA8BA,wDAAwD;AAC3C,QAAA,kCAAkC,GAAkB;IAC/D,sBAAsB;IACtB,2BAA2B;IAC3B,2BAA2B;IAC3B,2BAA2B;IAC3B,2BAA2B;IAC3B,2BAA2B;IAC3B,+BAA+B;IAC/B,2BAA2B;IAC3B,gCAAgC;IAChC,gCAAgC;IAChC,gCAAgC;IAChC,oCAAoC;CACrC,CAAA"}
|
package/dist/types/common.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JWK } from '@sphereon/ssi-
|
|
1
|
+
import { ICoseKeyJson, JWK } from '@sphereon/ssi-types';
|
|
2
2
|
import { IIdentifier, IKey } from '@veramo/core';
|
|
3
3
|
import { ExternalIdentifierType } from './externalIdentifierTypes';
|
|
4
4
|
import { ManagedIdentifierType } from './managedIdentifierTypes';
|
|
@@ -13,5 +13,6 @@ export declare function isOidcDiscoveryIdentifier(identifier: ManagedIdentifierT
|
|
|
13
13
|
export declare function isJwksUrlIdentifier(identifier: ManagedIdentifierType | ExternalIdentifierType): identifier is string;
|
|
14
14
|
export declare function isKidIdentifier(identifier: ManagedIdentifierType | ExternalIdentifierType): identifier is string;
|
|
15
15
|
export declare function isKeyIdentifier(identifier: ManagedIdentifierType): identifier is IKey;
|
|
16
|
+
export declare function isCoseKeyIdentifier(identifier: ManagedIdentifierType): identifier is ICoseKeyJson;
|
|
16
17
|
export declare function isX5cIdentifier(identifier: ManagedIdentifierType | ExternalIdentifierType): identifier is string[];
|
|
17
18
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,GAAG,CAAA;IACR,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,qBAAqB,GAAG,sBAAsB,GAAG,UAAU,IAAI,WAAW,GAAG,MAAM,CAE9H;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,qBAAqB,GAAG,sBAAsB,GAAG,UAAU,IAAI,WAAW,CAEnH;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,qBAAqB,GAAG,sBAAsB,GAAG,UAAU,IAAI,GAAG,CAE7G;AAED,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,qBAAqB,GAAG,sBAAsB,GAAG,UAAU,IAAI,MAAM,CAE1H;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,qBAAqB,GAAG,sBAAsB,GAAG,UAAU,IAAI,MAAM,CAEpH;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,qBAAqB,GAAG,sBAAsB,GAAG,UAAU,IAAI,MAAM,CAEhH;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,qBAAqB,GAAG,UAAU,IAAI,IAAI,CAQrF;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,qBAAqB,GAAG,UAAU,IAAI,YAAY,CAEjG;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,qBAAqB,GAAG,sBAAsB,GAAG,UAAU,IAAI,MAAM,EAAE,CAElH"}
|
package/dist/types/common.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isX5cIdentifier = exports.isKeyIdentifier = exports.isKidIdentifier = exports.isJwksUrlIdentifier = exports.isOidcDiscoveryIdentifier = exports.isJwkIdentifier = exports.isIIdentifier = exports.isDidIdentifier = void 0;
|
|
3
|
+
exports.isX5cIdentifier = exports.isCoseKeyIdentifier = exports.isKeyIdentifier = exports.isKidIdentifier = exports.isJwksUrlIdentifier = exports.isOidcDiscoveryIdentifier = exports.isJwkIdentifier = exports.isIIdentifier = exports.isDidIdentifier = void 0;
|
|
4
4
|
function isDidIdentifier(identifier) {
|
|
5
5
|
return isIIdentifier(identifier) || (typeof identifier === 'string' && identifier.startsWith('did:'));
|
|
6
6
|
}
|
|
@@ -33,6 +33,10 @@ function isKeyIdentifier(identifier) {
|
|
|
33
33
|
'publicKeyHex' in identifier);
|
|
34
34
|
}
|
|
35
35
|
exports.isKeyIdentifier = isKeyIdentifier;
|
|
36
|
+
function isCoseKeyIdentifier(identifier) {
|
|
37
|
+
return typeof identifier === 'object' && `kty` in identifier && ('baseIV' in identifier || 'x5chain' in identifier) && !('x5c' in identifier);
|
|
38
|
+
}
|
|
39
|
+
exports.isCoseKeyIdentifier = isCoseKeyIdentifier;
|
|
36
40
|
function isX5cIdentifier(identifier) {
|
|
37
41
|
return Array.isArray(identifier) && identifier.length > 0; // todo: Do we want to do additional validation? We know it must be DER and thus hex for instance
|
|
38
42
|
}
|
package/dist/types/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":";;;AAUA,SAAgB,eAAe,CAAC,UAA0D;IACxF,OAAO,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAA;AACvG,CAAC;AAFD,0CAEC;AAED,SAAgB,aAAa,CAAC,UAA0D;IACtF,OAAO,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,KAAK,IAAI,UAAU,IAAI,MAAM,IAAI,UAAU,CAAA;AACpH,CAAC;AAFD,sCAEC;AAED,SAAgB,eAAe,CAAC,UAA0D;IACxF,OAAO,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,KAAK,IAAI,UAAU,CAAA;AAC5F,CAAC;AAFD,0CAEC;AAED,SAAgB,yBAAyB,CAAC,UAA0D;IAClG,OAAO,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,mCAAmC,CAAC,CAAA;AACpI,CAAC;AAFD,8DAEC;AAED,SAAgB,mBAAmB,CAAC,UAA0D;IAC5F,OAAO,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;AAC5G,CAAC;AAFD,kDAEC;AAED,SAAgB,eAAe,CAAC,UAA0D;IACxF,OAAO,OAAO,UAAU,K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ils';
|
|
2
|
+
import { ICoseKeyJson, JWK } from '@sphereon/ssi-types';
|
|
3
|
+
import { X509CertificateChainValidationOpts, X509ValidationResult } from '@sphereon/ssi-sdk-ext.x509-utils';
|
|
4
4
|
import { IParsedDID } from '@sphereon/ssi-types';
|
|
5
5
|
import { DIDDocument, DIDDocumentSection, DIDResolutionResult } from '@veramo/core';
|
|
6
6
|
import { JwkInfo } from './common';
|
|
@@ -24,7 +24,7 @@ export type ExternalIdentifierDidOpts = Omit<ExternalIdentifierOptsBase, 'method
|
|
|
24
24
|
resolverResolution?: boolean;
|
|
25
25
|
};
|
|
26
26
|
export declare function isExternalIdentifierDidOpts(opts: ExternalIdentifierOptsBase): opts is ExternalIdentifierDidOpts;
|
|
27
|
-
export type ExternalIdentifierOpts = (ExternalIdentifierJwkOpts | ExternalIdentifierX5cOpts | ExternalIdentifierDidOpts | ExternalIdentifierKidOpts) & ExternalIdentifierOptsBase;
|
|
27
|
+
export type ExternalIdentifierOpts = (ExternalIdentifierJwkOpts | ExternalIdentifierX5cOpts | ExternalIdentifierDidOpts | ExternalIdentifierKidOpts | ExternalIdentifierCoseKeyOpts) & ExternalIdentifierOptsBase;
|
|
28
28
|
export type ExternalIdentifierKidOpts = Omit<ExternalIdentifierOptsBase, 'method'> & {
|
|
29
29
|
method?: 'kid';
|
|
30
30
|
identifier: string;
|
|
@@ -33,8 +33,14 @@ export declare function isExternalIdentifierKidOpts(opts: ExternalIdentifierOpts
|
|
|
33
33
|
export type ExternalIdentifierJwkOpts = Omit<ExternalIdentifierOptsBase, 'method'> & {
|
|
34
34
|
method?: 'jwk';
|
|
35
35
|
identifier: JWK;
|
|
36
|
+
x5c?: ExternalIdentifierX5cOpts;
|
|
36
37
|
};
|
|
37
38
|
export declare function isExternalIdentifierJwkOpts(opts: ExternalIdentifierOptsBase): opts is ExternalIdentifierJwkOpts;
|
|
39
|
+
export type ExternalIdentifierCoseKeyOpts = Omit<ExternalIdentifierOptsBase, 'method'> & {
|
|
40
|
+
method?: 'cose_key';
|
|
41
|
+
identifier: ICoseKeyJson;
|
|
42
|
+
};
|
|
43
|
+
export declare function isExternalIdentifierCoseKeyOpts(opts: ExternalIdentifierOptsBase): opts is ExternalIdentifierCoseKeyOpts;
|
|
38
44
|
export type ExternalIdentifierOidcDiscoveryOpts = Omit<ExternalIdentifierOptsBase, 'method'> & {
|
|
39
45
|
method?: 'oidc-discovery';
|
|
40
46
|
identifier: string;
|
|
@@ -45,7 +51,7 @@ export type ExternalIdentifierJwksUrlOpts = Omit<ExternalIdentifierOptsBase, 'me
|
|
|
45
51
|
identifier: string;
|
|
46
52
|
};
|
|
47
53
|
export declare function isExternalIdentifierJwksUrlOpts(opts: ExternalIdentifierOptsBase): opts is ExternalIdentifierJwksUrlOpts;
|
|
48
|
-
export type ExternalIdentifierX5cOpts = Omit<ExternalIdentifierOptsBase, 'method'> & {
|
|
54
|
+
export type ExternalIdentifierX5cOpts = Omit<ExternalIdentifierOptsBase, 'method'> & X509CertificateChainValidationOpts & {
|
|
49
55
|
method?: 'x5c';
|
|
50
56
|
identifier: string[];
|
|
51
57
|
verify?: boolean;
|
|
@@ -53,12 +59,22 @@ export type ExternalIdentifierX5cOpts = Omit<ExternalIdentifierOptsBase, 'method
|
|
|
53
59
|
trustAnchors?: string[];
|
|
54
60
|
};
|
|
55
61
|
export declare function isExternalIdentifierX5cOpts(opts: ExternalIdentifierOptsBase): opts is ExternalIdentifierX5cOpts;
|
|
56
|
-
export type ExternalIdentifierMethod = 'did' | 'jwk' | 'x5c' | 'kid' | 'oidc-discovery' | 'jwks-url' | 'oid4vci-issuer';
|
|
57
|
-
export type ExternalIdentifierResult = ExternalIdentifierDidResult | ExternalIdentifierX5cResult;
|
|
62
|
+
export type ExternalIdentifierMethod = 'did' | 'jwk' | 'x5c' | 'kid' | 'cose_key' | 'oidc-discovery' | 'jwks-url' | 'oid4vci-issuer';
|
|
63
|
+
export type ExternalIdentifierResult = IExternalIdentifierResultBase & (ExternalIdentifierDidResult | ExternalIdentifierX5cResult | ExternalIdentifierJwkResult | ExternalIdentifierCoseKeyResult);
|
|
58
64
|
export interface IExternalIdentifierResultBase {
|
|
59
65
|
method: ExternalIdentifierMethod;
|
|
60
66
|
jwks: Array<ExternalJwkInfo>;
|
|
61
67
|
}
|
|
68
|
+
export interface ExternalIdentifierJwkResult extends IExternalIdentifierResultBase {
|
|
69
|
+
method: 'jwk';
|
|
70
|
+
jwk: JWK;
|
|
71
|
+
x5c?: ExternalIdentifierX5cResult;
|
|
72
|
+
}
|
|
73
|
+
export interface ExternalIdentifierCoseKeyResult extends IExternalIdentifierResultBase {
|
|
74
|
+
method: 'cose_key';
|
|
75
|
+
coseKey: ICoseKeyJson;
|
|
76
|
+
x5c?: ExternalIdentifierX5cResult;
|
|
77
|
+
}
|
|
62
78
|
export interface ExternalIdentifierX5cResult extends IExternalIdentifierResultBase {
|
|
63
79
|
method: 'x5c';
|
|
64
80
|
x5c: string[];
|
|
@@ -68,6 +84,7 @@ export interface ExternalIdentifierX5cResult extends IExternalIdentifierResultBa
|
|
|
68
84
|
}
|
|
69
85
|
export interface ExternalJwkInfo extends JwkInfo {
|
|
70
86
|
kid?: string;
|
|
87
|
+
publicKeyHex: string;
|
|
71
88
|
}
|
|
72
89
|
export interface ExternalIdentifierDidResult extends IExternalIdentifierResultBase {
|
|
73
90
|
method: 'did';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"externalIdentifierTypes.d.ts","sourceRoot":"","sources":["../../src/types/externalIdentifierTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"externalIdentifierTypes.d.ts","sourceRoot":"","sources":["../../src/types/externalIdentifierTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,GAAG,EAA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AAE,MAAM,CAAA;IACX,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,OAAO,CAAC,EAAE,eAAe,CAAA;IACzB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAA;IAC7D,SAAS,EAAE,UAAU,CAAA;CACtB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isExternalIdentifierX5cOpts = exports.isExternalIdentifierJwksUrlOpts = exports.isExternalIdentifierOidcDiscoveryOpts = exports.isExternalIdentifierJwkOpts = exports.isExternalIdentifierKidOpts = exports.isExternalIdentifierDidOpts = void 0;
|
|
3
|
+
exports.isExternalIdentifierX5cOpts = exports.isExternalIdentifierJwksUrlOpts = exports.isExternalIdentifierOidcDiscoveryOpts = exports.isExternalIdentifierCoseKeyOpts = exports.isExternalIdentifierJwkOpts = exports.isExternalIdentifierKidOpts = exports.isExternalIdentifierDidOpts = void 0;
|
|
4
4
|
const common_1 = require("./common");
|
|
5
5
|
function isExternalIdentifierDidOpts(opts) {
|
|
6
6
|
const { identifier } = opts;
|
|
@@ -17,6 +17,11 @@ function isExternalIdentifierJwkOpts(opts) {
|
|
|
17
17
|
return ('method' in opts && opts.method === 'jwk') || (0, common_1.isJwkIdentifier)(identifier);
|
|
18
18
|
}
|
|
19
19
|
exports.isExternalIdentifierJwkOpts = isExternalIdentifierJwkOpts;
|
|
20
|
+
function isExternalIdentifierCoseKeyOpts(opts) {
|
|
21
|
+
const { identifier } = opts;
|
|
22
|
+
return ('method' in opts && opts.method === 'cose_key') || (0, common_1.isCoseKeyIdentifier)(identifier);
|
|
23
|
+
}
|
|
24
|
+
exports.isExternalIdentifierCoseKeyOpts = isExternalIdentifierCoseKeyOpts;
|
|
20
25
|
function isExternalIdentifierOidcDiscoveryOpts(opts) {
|
|
21
26
|
const { identifier } = opts;
|
|
22
27
|
return ('method' in opts && opts.method === 'oidc-discovery') || (0, common_1.isOidcDiscoveryIdentifier)(identifier);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"externalIdentifierTypes.js","sourceRoot":"","sources":["../../src/types/externalIdentifierTypes.ts"],"names":[],"mappings":";;;AAKA,
|
|
1
|
+
{"version":3,"file":"externalIdentifierTypes.js","sourceRoot":"","sources":["../../src/types/externalIdentifierTypes.ts"],"names":[],"mappings":";;;AAKA,qCASiB;AAwBjB,SAAgB,2BAA2B,CAAC,IAAgC;IAC1E,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAC3B,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,IAAA,wBAAe,EAAC,UAAU,CAAC,CAAA;AACnF,CAAC;AAHD,kEAGC;AAgBD,SAAgB,2BAA2B,CAAC,IAAgC;IAC1E,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAC3B,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,IAAA,wBAAe,EAAC,UAAU,CAAC,CAAA;AACnF,CAAC;AAHD,kEAGC;AAQD,SAAgB,2BAA2B,CAAC,IAAgC;IAC1E,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAC3B,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,IAAA,wBAAe,EAAC,UAAU,CAAC,CAAA;AACnF,CAAC;AAHD,kEAGC;AAOD,SAAgB,+BAA+B,CAAC,IAAgC;IAC9E,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAC3B,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU,CAAC,IAAI,IAAA,4BAAmB,EAAC,UAAU,CAAC,CAAA;AAC5F,CAAC;AAHD,0EAGC;AAOD,SAAgB,qCAAqC,CAAC,IAAgC;IACpF,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAC3B,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,gBAAgB,CAAC,IAAI,IAAA,kCAAyB,EAAC,UAAU,CAAC,CAAA;AACxG,CAAC;AAHD,sFAGC;AAOD,SAAgB,+BAA+B,CAAC,IAAgC;IAC9E,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAC3B,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,gBAAgB,CAAC,IAAI,IAAA,4BAAmB,EAAC,UAAU,CAAC,CAAA;AAClG,CAAC;AAHD,0EAGC;AAWD,SAAgB,2BAA2B,CAAC,IAAgC;IAC1E,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI,CAAA;IAC3B,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,IAAA,wBAAe,EAAC,UAAU,CAAC,CAAA;AACnF,CAAC;AAHD,kEAGC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClientIdScheme } from '@sphereon/ssi-sdk-ext.x509-utils';
|
|
2
|
+
import { ICoseKeyJson, JWK } from '@sphereon/ssi-types';
|
|
2
3
|
import { DIDDocumentSection, IIdentifier, IKey, TKeyType } from '@veramo/core';
|
|
3
4
|
import { JwkInfo } from './common';
|
|
4
5
|
/**
|
|
@@ -6,14 +7,16 @@ import { JwkInfo } from './common';
|
|
|
6
7
|
*
|
|
7
8
|
* The functions below can be used to check the type, and they also provide the proper 'runtime' types
|
|
8
9
|
*/
|
|
9
|
-
export type ManagedIdentifierType = IIdentifier | string | string[] | JWK | IKey;
|
|
10
|
-
export type ManagedIdentifierOpts = (ManagedIdentifierJwkOpts | ManagedIdentifierX5cOpts | ManagedIdentifierDidOpts | ManagedIdentifierKidOpts | ManagedIdentifierKeyOpts) & ManagedIdentifierOptsBase;
|
|
10
|
+
export type ManagedIdentifierType = IIdentifier | string | string[] | JWK | IKey | ICoseKeyJson;
|
|
11
|
+
export type ManagedIdentifierOpts = (ManagedIdentifierJwkOpts | ManagedIdentifierX5cOpts | ManagedIdentifierDidOpts | ManagedIdentifierKidOpts | ManagedIdentifierKeyOpts | ManagedIdentifierCoseKeyOpts) & ManagedIdentifierOptsBase;
|
|
11
12
|
export type ManagedIdentifierOptsBase = {
|
|
12
13
|
method?: ManagedIdentifierMethod;
|
|
13
14
|
identifier: ManagedIdentifierType;
|
|
14
15
|
kmsKeyRef?: string;
|
|
15
16
|
issuer?: string;
|
|
16
17
|
kid?: string;
|
|
18
|
+
clientId?: string;
|
|
19
|
+
clientIdScheme?: ClientIdScheme | 'did' | string;
|
|
17
20
|
};
|
|
18
21
|
export type ManagedIdentifierDidOpts = Omit<ManagedIdentifierOptsBase, 'method'> & {
|
|
19
22
|
method?: 'did';
|
|
@@ -34,7 +37,12 @@ export type ManagedIdentifierKeyOpts = Omit<ManagedIdentifierOptsBase, 'method'>
|
|
|
34
37
|
method?: 'key';
|
|
35
38
|
identifier: IKey;
|
|
36
39
|
};
|
|
37
|
-
export declare function isManagedIdentifierKeyOpts(opts: ManagedIdentifierOptsBase): opts is
|
|
40
|
+
export declare function isManagedIdentifierKeyOpts(opts: ManagedIdentifierOptsBase): opts is ManagedIdentifierKeyOpts;
|
|
41
|
+
export type ManagedIdentifierCoseKeyOpts = Omit<ManagedIdentifierOptsBase, 'method'> & {
|
|
42
|
+
method?: 'cose_key';
|
|
43
|
+
identifier: ICoseKeyJson;
|
|
44
|
+
};
|
|
45
|
+
export declare function isManagedIdentifierCoseKeyOpts(opts: ManagedIdentifierOptsBase): opts is ManagedIdentifierCoseKeyOpts;
|
|
38
46
|
export type ManagedIdentifierJwkOpts = Omit<ManagedIdentifierOptsBase, 'method'> & {
|
|
39
47
|
method?: 'jwk';
|
|
40
48
|
identifier: JWK;
|
|
@@ -54,12 +62,16 @@ export interface IManagedIdentifierResultBase extends ManagedJwkInfo {
|
|
|
54
62
|
key: IKey;
|
|
55
63
|
kid?: string;
|
|
56
64
|
issuer?: string;
|
|
65
|
+
clientId?: string;
|
|
66
|
+
clientIdScheme?: ClientIdScheme | 'did' | string;
|
|
67
|
+
identifier: ManagedIdentifierType;
|
|
57
68
|
}
|
|
58
69
|
export declare function isManagedIdentifierDidResult(object: IManagedIdentifierResultBase): object is ManagedIdentifierDidResult;
|
|
59
70
|
export declare function isManagedIdentifierX5cResult(object: IManagedIdentifierResultBase): object is ManagedIdentifierX5cResult;
|
|
60
71
|
export declare function isManagedIdentifierJwkResult(object: IManagedIdentifierResultBase): object is ManagedIdentifierJwkResult;
|
|
61
72
|
export declare function isManagedIdentifierKidResult(object: IManagedIdentifierResultBase): object is ManagedIdentifierKidResult;
|
|
62
73
|
export declare function isManagedIdentifierKeyResult(object: IManagedIdentifierResultBase): object is ManagedIdentifierKeyResult;
|
|
74
|
+
export declare function isManagedIdentifierCoseKeyResult(object: IManagedIdentifierResultBase): object is ManagedIdentifierCoseKeyResult;
|
|
63
75
|
export interface ManagedIdentifierDidResult extends IManagedIdentifierResultBase {
|
|
64
76
|
method: 'did';
|
|
65
77
|
identifier: IIdentifier;
|
|
@@ -71,21 +83,31 @@ export interface ManagedIdentifierDidResult extends IManagedIdentifierResultBase
|
|
|
71
83
|
kid: string;
|
|
72
84
|
}
|
|
73
85
|
export interface ManagedIdentifierJwkResult extends IManagedIdentifierResultBase {
|
|
86
|
+
identifier: JWK;
|
|
74
87
|
method: 'jwk';
|
|
75
88
|
}
|
|
76
89
|
export interface ManagedIdentifierKidResult extends IManagedIdentifierResultBase {
|
|
77
90
|
method: 'kid';
|
|
91
|
+
identifier: string;
|
|
78
92
|
kid: string;
|
|
79
93
|
}
|
|
80
94
|
export interface ManagedIdentifierKeyResult extends IManagedIdentifierResultBase {
|
|
81
95
|
method: 'key';
|
|
96
|
+
identifier: IKey;
|
|
97
|
+
}
|
|
98
|
+
export interface ManagedIdentifierCoseKeyResult extends IManagedIdentifierResultBase {
|
|
99
|
+
method: 'cose_key';
|
|
100
|
+
identifier: ICoseKeyJson;
|
|
82
101
|
}
|
|
83
102
|
export interface ManagedIdentifierX5cResult extends IManagedIdentifierResultBase {
|
|
84
103
|
method: 'x5c';
|
|
104
|
+
identifier: string[];
|
|
85
105
|
x5c: string[];
|
|
86
106
|
certificate: any;
|
|
87
107
|
}
|
|
88
|
-
export type ManagedIdentifierMethod = 'did' | 'jwk' | 'x5c' | 'kid' | 'key';
|
|
89
|
-
export type ManagedIdentifierResult = IManagedIdentifierResultBase & (ManagedIdentifierX5cResult | ManagedIdentifierDidResult | ManagedIdentifierJwkResult | ManagedIdentifierKidResult | ManagedIdentifierKeyResult);
|
|
90
|
-
export type ManagedIdentifierOptsOrResult = ManagedIdentifierResult | ManagedIdentifierOpts
|
|
108
|
+
export type ManagedIdentifierMethod = 'did' | 'jwk' | 'x5c' | 'kid' | 'key' | 'cose_key';
|
|
109
|
+
export type ManagedIdentifierResult = IManagedIdentifierResultBase & (ManagedIdentifierX5cResult | ManagedIdentifierDidResult | ManagedIdentifierJwkResult | ManagedIdentifierKidResult | ManagedIdentifierKeyResult | ManagedIdentifierCoseKeyResult);
|
|
110
|
+
export type ManagedIdentifierOptsOrResult = (ManagedIdentifierResult | ManagedIdentifierOpts) & {
|
|
111
|
+
lazyDisabled?: boolean;
|
|
112
|
+
};
|
|
91
113
|
//# sourceMappingURL=managedIdentifierTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managedIdentifierTypes.d.ts","sourceRoot":"","sources":["../../src/types/managedIdentifierTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"managedIdentifierTypes.d.ts","sourceRoot":"","sources":["../../src/types/managedIdentifierTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kC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A4B;IAC9E,UAAU,EAAE,GAAG,CAAA;IACf,MAAM,EAAE,KAAK,CAAA;CACd;AAED,MAAM,WAAW,0BAA2B,SAAQ,4BAA4B;IAC9E,MAAM,EAAE,KAAK,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,0BAA2B,SAAQ,4BAA4B;IAC9E,MAAM,EAAE,KAAK,CAAA;IACb,UAAU,EAAE,IAAI,CAAA;CACjB;AAED,MAAM,WAAW,8BAA+B,SAAQ,4BAA4B;IAClF,MAAM,EAAE,UAAU,CAAA;IAClB,UAAU,EAAE,YAAY,CAAA;CACzB;AAED,MAAM,WAAW,0BAA2B,SAAQ,4BAA4B;IAC9E,MAAM,EAAE,KAAK,CAAA;IACb,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,GAAG,EAAE,MAAM,EAAE,CAAA;IACb,WAAW,EAAE,GAAG,CAAA;CACjB;AAED,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,UAAU,CAAA;AAExF,MAAM,MAAM,uBAAuB,GAAG,4BAA4B,GAChE,CACI,0BAA0B,GAC1B,0BAA0B,GAC1B,0BAA0B,GAC1B,0BAA0B,GAC1B,0BAA0B,GAC1B,8BAA8B,CACjC,CAAA;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,uBAAuB,GAAG,qBAAqB,CAAC,GAAG;IAC9F,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isManagedIdentifierKeyResult = exports.isManagedIdentifierKidResult = exports.isManagedIdentifierJwkResult = exports.isManagedIdentifierX5cResult = exports.isManagedIdentifierDidResult = exports.isManagedIdentifierX5cOpts = exports.isManagedIdentifierJwkOpts = exports.isManagedIdentifierKeyOpts = exports.isManagedIdentifierKidOpts = exports.isManagedIdentifierDidOpts = void 0;
|
|
3
|
+
exports.isManagedIdentifierCoseKeyResult = exports.isManagedIdentifierKeyResult = exports.isManagedIdentifierKidResult = exports.isManagedIdentifierJwkResult = exports.isManagedIdentifierX5cResult = exports.isManagedIdentifierDidResult = exports.isManagedIdentifierX5cOpts = exports.isManagedIdentifierJwkOpts = exports.isManagedIdentifierCoseKeyOpts = exports.isManagedIdentifierKeyOpts = exports.isManagedIdentifierKidOpts = exports.isManagedIdentifierDidOpts = void 0;
|
|
4
4
|
const common_1 = require("./common");
|
|
5
5
|
function isManagedIdentifierDidOpts(opts) {
|
|
6
6
|
const { identifier } = opts;
|
|
@@ -17,6 +17,11 @@ function isManagedIdentifierKeyOpts(opts) {
|
|
|
17
17
|
return ('method' in opts && opts.method === 'key') || (0, common_1.isKeyIdentifier)(identifier);
|
|
18
18
|
}
|
|
19
19
|
exports.isManagedIdentifierKeyOpts = isManagedIdentifierKeyOpts;
|
|
20
|
+
function isManagedIdentifierCoseKeyOpts(opts) {
|
|
21
|
+
const { identifier } = opts;
|
|
22
|
+
return ('method' in opts && opts.method === 'cose_key') || (0, common_1.isCoseKeyIdentifier)(identifier);
|
|
23
|
+
}
|
|
24
|
+
exports.isManagedIdentifierCoseKeyOpts = isManagedIdentifierCoseKeyOpts;
|
|
20
25
|
function isManagedIdentifierJwkOpts(opts) {
|
|
21
26
|
const { identifier } = opts;
|
|
22
27
|
return ('method' in opts && opts.method === 'jwk') || (0, common_1.isJwkIdentifier)(identifier);
|
|
@@ -47,4 +52,8 @@ function isManagedIdentifierKeyResult(object) {
|
|
|
47
52
|
return object && typeof object === 'object' && 'method' in object && object.method === 'key';
|
|
48
53
|
}
|
|
49
54
|
exports.isManagedIdentifierKeyResult = isManagedIdentifierKeyResult;
|
|
55
|
+
function isManagedIdentifierCoseKeyResult(object) {
|
|
56
|
+
return object && typeof object === 'object' && 'method' in object && object.method === 'cose_key';
|
|
57
|
+
}
|
|
58
|
+
exports.isManagedIdentifierCoseKeyResult = isManagedIdentifierCoseKeyResult;
|
|
50
59
|
//# sourceMappingURL=managedIdentifierTypes.js.map
|