@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.cjs
CHANGED
|
@@ -1088,9 +1088,9 @@ var require_plugin_schema = __commonJS({
|
|
|
1088
1088
|
type: "object"
|
|
1089
1089
|
},
|
|
1090
1090
|
DidDocumentJwks: {
|
|
1091
|
-
$ref: '#/components/schemas/Record<Exclude<DIDDocumentSection,("publicKey"|"service")>,def-interface-.ts-
|
|
1091
|
+
$ref: '#/components/schemas/Record<Exclude<DIDDocumentSection,("publicKey"|"service")>,def-interface-.ts-36152-36877-.ts-0-63876[]>'
|
|
1092
1092
|
},
|
|
1093
|
-
'Record<Exclude<DIDDocumentSection,("publicKey"|"service")>,def-interface-.ts-
|
|
1093
|
+
'Record<Exclude<DIDDocumentSection,("publicKey"|"service")>,def-interface-.ts-36152-36877-.ts-0-63876[]>': {
|
|
1094
1094
|
type: "object",
|
|
1095
1095
|
properties: {
|
|
1096
1096
|
verificationMethod: {
|
|
@@ -4866,6 +4866,7 @@ async function getManagedDidIdentifier(opts, context) {
|
|
|
4866
4866
|
identifier = opts.identifier;
|
|
4867
4867
|
}
|
|
4868
4868
|
const did = identifier.did;
|
|
4869
|
+
const keys = identifier?.keys;
|
|
4869
4870
|
const extendedKey = await (0, import_ssi_sdk_ext.getFirstKeyWithRelation)({
|
|
4870
4871
|
...opts,
|
|
4871
4872
|
// 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
|
|
@@ -4874,6 +4875,7 @@ async function getManagedDidIdentifier(opts, context) {
|
|
|
4874
4875
|
vmRelationship: opts.vmRelationship ?? "verificationMethod"
|
|
4875
4876
|
}, context);
|
|
4876
4877
|
const key = extendedKey;
|
|
4878
|
+
const controllerKeyId = identifier.controllerKeyId;
|
|
4877
4879
|
const jwk = (0, import_ssi_sdk_ext2.toJwk)(key.publicKeyHex, key.type, {
|
|
4878
4880
|
key
|
|
4879
4881
|
});
|
|
@@ -4886,42 +4888,6 @@ async function getManagedDidIdentifier(opts, context) {
|
|
|
4886
4888
|
kid = `${did}${hash}${kid}`;
|
|
4887
4889
|
}
|
|
4888
4890
|
const issuer = opts.issuer ?? did;
|
|
4889
|
-
let filteredKeys = identifier?.keys ?? [];
|
|
4890
|
-
if (opts.kmsKeyRef) {
|
|
4891
|
-
const keysByKmsKeyRef = filteredKeys.filter((k) => k.kid === opts.kmsKeyRef);
|
|
4892
|
-
if (keysByKmsKeyRef.length > 0) {
|
|
4893
|
-
filteredKeys = keysByKmsKeyRef;
|
|
4894
|
-
}
|
|
4895
|
-
}
|
|
4896
|
-
if (filteredKeys.length === identifier?.keys?.length && opts.vmRelationship) {
|
|
4897
|
-
const keysByVmRelationship = filteredKeys.filter((k) => {
|
|
4898
|
-
const purposes = k.meta?.purposes;
|
|
4899
|
-
if (!purposes || purposes.length === 0) {
|
|
4900
|
-
return opts.vmRelationship === "verificationMethod";
|
|
4901
|
-
}
|
|
4902
|
-
return purposes.includes(opts.vmRelationship);
|
|
4903
|
-
});
|
|
4904
|
-
if (keysByVmRelationship.length > 0) {
|
|
4905
|
-
filteredKeys = keysByVmRelationship;
|
|
4906
|
-
}
|
|
4907
|
-
}
|
|
4908
|
-
if (filteredKeys.length === identifier?.keys?.length && typeof opts.identifier === "string" && opts.identifier.includes("#")) {
|
|
4909
|
-
const fragment = opts.identifier.split("#")[1];
|
|
4910
|
-
const keysByFragment = filteredKeys.filter((k) => {
|
|
4911
|
-
const vmId = k.meta?.verificationMethod?.id;
|
|
4912
|
-
return vmId === `${did}#${fragment}` || vmId === fragment || k.kid === fragment;
|
|
4913
|
-
});
|
|
4914
|
-
if (keysByFragment.length > 0) {
|
|
4915
|
-
filteredKeys = keysByFragment;
|
|
4916
|
-
}
|
|
4917
|
-
}
|
|
4918
|
-
const keys = filteredKeys;
|
|
4919
|
-
const controllerKeyId = key.kid;
|
|
4920
|
-
const filteredIdentifier = {
|
|
4921
|
-
...identifier,
|
|
4922
|
-
keys: filteredKeys,
|
|
4923
|
-
controllerKeyId
|
|
4924
|
-
};
|
|
4925
4891
|
return {
|
|
4926
4892
|
method,
|
|
4927
4893
|
key,
|
|
@@ -4933,7 +4899,7 @@ async function getManagedDidIdentifier(opts, context) {
|
|
|
4933
4899
|
kid,
|
|
4934
4900
|
keys,
|
|
4935
4901
|
issuer,
|
|
4936
|
-
identifier
|
|
4902
|
+
identifier,
|
|
4937
4903
|
clientId: opts.clientId,
|
|
4938
4904
|
clientIdScheme: opts.clientIdScheme,
|
|
4939
4905
|
opts
|