@sphereon/ssi-sdk-ext.identifier-resolution 0.36.1-feature.SSISDK.70.integrate.digidentity.57 → 0.36.1-feature.SSISDK.78.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -39
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
- package/plugin.schema.json +2 -2
- package/src/functions/managedIdentifierFunctions.ts +8 -56
package/dist/index.js
CHANGED
|
@@ -1062,9 +1062,9 @@ var require_plugin_schema = __commonJS({
|
|
|
1062
1062
|
type: "object"
|
|
1063
1063
|
},
|
|
1064
1064
|
DidDocumentJwks: {
|
|
1065
|
-
$ref: '#/components/schemas/Record<Exclude<DIDDocumentSection,("publicKey"|"service")>,def-interface-.ts-
|
|
1065
|
+
$ref: '#/components/schemas/Record<Exclude<DIDDocumentSection,("publicKey"|"service")>,def-interface-.ts-36152-36877-.ts-0-63876[]>'
|
|
1066
1066
|
},
|
|
1067
|
-
'Record<Exclude<DIDDocumentSection,("publicKey"|"service")>,def-interface-.ts-
|
|
1067
|
+
'Record<Exclude<DIDDocumentSection,("publicKey"|"service")>,def-interface-.ts-36152-36877-.ts-0-63876[]>': {
|
|
1068
1068
|
type: "object",
|
|
1069
1069
|
properties: {
|
|
1070
1070
|
verificationMethod: {
|
|
@@ -4780,6 +4780,7 @@ async function getManagedDidIdentifier(opts, context) {
|
|
|
4780
4780
|
identifier = opts.identifier;
|
|
4781
4781
|
}
|
|
4782
4782
|
const did = identifier.did;
|
|
4783
|
+
const keys = identifier?.keys;
|
|
4783
4784
|
const extendedKey = await getFirstKeyWithRelation({
|
|
4784
4785
|
...opts,
|
|
4785
4786
|
// Make sure we use offline mode if no pref was supplied. We are looking for managed DIDs after all. Could be it is not published yet
|
|
@@ -4788,6 +4789,7 @@ async function getManagedDidIdentifier(opts, context) {
|
|
|
4788
4789
|
vmRelationship: opts.vmRelationship ?? "verificationMethod"
|
|
4789
4790
|
}, context);
|
|
4790
4791
|
const key = extendedKey;
|
|
4792
|
+
const controllerKeyId = identifier.controllerKeyId;
|
|
4791
4793
|
const jwk = toJwk(key.publicKeyHex, key.type, {
|
|
4792
4794
|
key
|
|
4793
4795
|
});
|
|
@@ -4800,42 +4802,6 @@ async function getManagedDidIdentifier(opts, context) {
|
|
|
4800
4802
|
kid = `${did}${hash}${kid}`;
|
|
4801
4803
|
}
|
|
4802
4804
|
const issuer = opts.issuer ?? did;
|
|
4803
|
-
let filteredKeys = identifier?.keys ?? [];
|
|
4804
|
-
if (opts.kmsKeyRef) {
|
|
4805
|
-
const keysByKmsKeyRef = filteredKeys.filter((k) => k.kid === opts.kmsKeyRef);
|
|
4806
|
-
if (keysByKmsKeyRef.length > 0) {
|
|
4807
|
-
filteredKeys = keysByKmsKeyRef;
|
|
4808
|
-
}
|
|
4809
|
-
}
|
|
4810
|
-
if (filteredKeys.length === identifier?.keys?.length && opts.vmRelationship) {
|
|
4811
|
-
const keysByVmRelationship = filteredKeys.filter((k) => {
|
|
4812
|
-
const purposes = k.meta?.purposes;
|
|
4813
|
-
if (!purposes || purposes.length === 0) {
|
|
4814
|
-
return opts.vmRelationship === "verificationMethod";
|
|
4815
|
-
}
|
|
4816
|
-
return purposes.includes(opts.vmRelationship);
|
|
4817
|
-
});
|
|
4818
|
-
if (keysByVmRelationship.length > 0) {
|
|
4819
|
-
filteredKeys = keysByVmRelationship;
|
|
4820
|
-
}
|
|
4821
|
-
}
|
|
4822
|
-
if (filteredKeys.length === identifier?.keys?.length && typeof opts.identifier === "string" && opts.identifier.includes("#")) {
|
|
4823
|
-
const fragment = opts.identifier.split("#")[1];
|
|
4824
|
-
const keysByFragment = filteredKeys.filter((k) => {
|
|
4825
|
-
const vmId = k.meta?.verificationMethod?.id;
|
|
4826
|
-
return vmId === `${did}#${fragment}` || vmId === fragment || k.kid === fragment;
|
|
4827
|
-
});
|
|
4828
|
-
if (keysByFragment.length > 0) {
|
|
4829
|
-
filteredKeys = keysByFragment;
|
|
4830
|
-
}
|
|
4831
|
-
}
|
|
4832
|
-
const keys = filteredKeys;
|
|
4833
|
-
const controllerKeyId = key.kid;
|
|
4834
|
-
const filteredIdentifier = {
|
|
4835
|
-
...identifier,
|
|
4836
|
-
keys: filteredKeys,
|
|
4837
|
-
controllerKeyId
|
|
4838
|
-
};
|
|
4839
4805
|
return {
|
|
4840
4806
|
method,
|
|
4841
4807
|
key,
|
|
@@ -4847,7 +4813,7 @@ async function getManagedDidIdentifier(opts, context) {
|
|
|
4847
4813
|
kid,
|
|
4848
4814
|
keys,
|
|
4849
4815
|
issuer,
|
|
4850
|
-
identifier
|
|
4816
|
+
identifier,
|
|
4851
4817
|
clientId: opts.clientId,
|
|
4852
4818
|
clientIdScheme: opts.clientIdScheme,
|
|
4853
4819
|
opts
|