@sphereon/ssi-sdk-ext.identifier-resolution 0.24.1-next.104 → 0.24.1-next.106

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.
@@ -1 +1 @@
1
- {"version":3,"file":"LegacySupport.d.ts","sourceRoot":"","sources":["../../src/functions/LegacySupport.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAElF;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,MAAM,CAAC,EAAE,6BAA6B,CAAA;IACtC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,GAAG,CAAA;CACd,GAAG,6BAA6B,CAqChC"}
1
+ {"version":3,"file":"LegacySupport.d.ts","sourceRoot":"","sources":["../../src/functions/LegacySupport.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,6BAA6B,EAAC,MAAM,UAAU,CAAA;AAEhF;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAChD,MAAM,CAAC,EAAE,6BAA6B,CAAA;IACtC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,GAAG,CAAA;CAChB,GAAG,6BAA6B,CAyChC"}
@@ -6,17 +6,18 @@ exports.legacyKeyRefsToIdentifierOpts = void 0;
6
6
  * @param opts
7
7
  */
8
8
  function legacyKeyRefsToIdentifierOpts(opts) {
9
- var _a, _b, _c, _d, _e, _f, _g;
9
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
10
10
  if (!opts.idOpts) {
11
11
  console.warn(`Legacy idOpts being used. Support will be dropped in the future. Consider switching to the idOpts, to have support for DIDs, JWKS, x5c etc. See https://github.com/Sphereon-Opensource/SSI-SDK-crypto-extensions/tree/feature/multi_identifier_support/packages/identifier-resolution`);
12
12
  // legacy way
13
- let kmsKeyRef = (_d = (_a = opts.keyRef) !== null && _a !== void 0 ? _a : (_c = (_b = opts.didOpts) === null || _b === void 0 ? void 0 : _b.idOpts) === null || _c === void 0 ? void 0 : _c.kmsKeyRef) !== null && _d !== void 0 ? _d : (typeof ((_e = opts.didOpts) === null || _e === void 0 ? void 0 : _e.idOpts.identifier) === 'object' ? ((_f = opts.didOpts) === null || _f === void 0 ? void 0 : _f.idOpts.identifier).keys[0].kid : undefined);
13
+ let kmsKeyRef = (_h = (_f = (_d = (_a = opts.keyRef) !== null && _a !== void 0 ? _a : (_c = (_b = opts.didOpts) === null || _b === void 0 ? void 0 : _b.idOpts) === null || _c === void 0 ? void 0 : _c.kmsKeyRef) !== null && _d !== void 0 ? _d : (_e = opts.didOpts) === null || _e === void 0 ? void 0 : _e.kid) !== null && _f !== void 0 ? _f : (_g = opts.didOpts.idOpts) === null || _g === void 0 ? void 0 : _g.kid) !== null && _h !== void 0 ? _h : (typeof ((_j = opts.didOpts) === null || _j === void 0 ? void 0 : _j.idOpts.identifier) === 'object' ? ((_k = opts.didOpts) === null || _k === void 0 ? void 0 : _k.idOpts.identifier).keys[0].kid : undefined);
14
14
  if (!kmsKeyRef) {
15
15
  throw Error('Key ref is needed for access token signer');
16
16
  }
17
+ let identifier = ((_m = (_l = opts.didOpts) === null || _l === void 0 ? void 0 : _l.identifier) !== null && _m !== void 0 ? _m : (_p = (_o = opts.didOpts) === null || _o === void 0 ? void 0 : _o.idOpts) === null || _p === void 0 ? void 0 : _p.identifier);
17
18
  return {
18
- kmsKeyRef: (_g = opts.keyRef) !== null && _g !== void 0 ? _g : kmsKeyRef,
19
- identifier: kmsKeyRef,
19
+ kmsKeyRef: (_q = opts.keyRef) !== null && _q !== void 0 ? _q : kmsKeyRef,
20
+ identifier: identifier !== null && identifier !== void 0 ? identifier : kmsKeyRef,
20
21
  issuer: opts.iss,
21
22
  };
22
23
  }
@@ -1 +1 @@
1
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AE,IAAI,CAAC,GAAG;SACgB,CAAA;IACxC,CAAC;SAAM,CAAC;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QAC1B,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YACnC,aAAa;YACb,OAAO,CAAC,IAAI,CACR,uRAAuR,CAC1R,CAAA;YACD,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAA;QAClC,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YAC7B,aAAa;YACb,OAAO,CAAC,IAAI,CACR,oRAAoR,CACvR,CAAA;YACD,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAA;QAC5B,CAAC;QAED,OAAO,MAAM,CAAA;IACjB,CAAC;AACL,CAAC;AA9CD,sEA8CC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk-ext.identifier-resolution",
3
- "version": "0.24.1-next.104+9f76393",
3
+ "version": "0.24.1-next.106+49c6348",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,9 +15,9 @@
15
15
  "generate-plugin-schema": "sphereon dev generate-plugin-schema"
16
16
  },
17
17
  "dependencies": {
18
- "@sphereon/ssi-sdk-ext.did-utils": "0.24.1-next.104+9f76393",
19
- "@sphereon/ssi-sdk-ext.key-utils": "0.24.1-next.104+9f76393",
20
- "@sphereon/ssi-sdk-ext.x509-utils": "0.24.1-next.104+9f76393",
18
+ "@sphereon/ssi-sdk-ext.did-utils": "0.24.1-next.106+49c6348",
19
+ "@sphereon/ssi-sdk-ext.key-utils": "0.24.1-next.106+49c6348",
20
+ "@sphereon/ssi-sdk-ext.x509-utils": "0.24.1-next.106+49c6348",
21
21
  "@sphereon/ssi-sdk.agent-config": "0.29.1-unstable.161",
22
22
  "@sphereon/ssi-types": "0.29.1-unstable.161",
23
23
  "@veramo/core": "4.2.0",
@@ -27,10 +27,10 @@
27
27
  "uint8arrays": "^3.1.1"
28
28
  },
29
29
  "devDependencies": {
30
- "@sphereon/ssi-sdk-ext.did-provider-jwk": "0.24.1-next.104+9f76393",
31
- "@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.24.1-next.104+9f76393",
32
- "@sphereon/ssi-sdk-ext.key-manager": "0.24.1-next.104+9f76393",
33
- "@sphereon/ssi-sdk-ext.kms-local": "0.24.1-next.104+9f76393",
30
+ "@sphereon/ssi-sdk-ext.did-provider-jwk": "0.24.1-next.106+49c6348",
31
+ "@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.24.1-next.106+49c6348",
32
+ "@sphereon/ssi-sdk-ext.key-manager": "0.24.1-next.106+49c6348",
33
+ "@sphereon/ssi-sdk-ext.kms-local": "0.24.1-next.106+49c6348",
34
34
  "@sphereon/ssi-sdk.dev": "0.29.1-unstable.161",
35
35
  "@veramo/data-store": "4.2.0",
36
36
  "@veramo/did-manager": "4.2.0",
@@ -64,5 +64,5 @@
64
64
  "X.509 Certificates",
65
65
  "ARF"
66
66
  ],
67
- "gitHead": "9f7639322d825bd7ec0a276adfb6ab4a934fc571"
67
+ "gitHead": "49c6348c3e55e96cc38c28679a870493eebc872e"
68
68
  }
@@ -1,50 +1,54 @@
1
- import { IIdentifier } from '@veramo/core'
2
- import { ManagedIdentifierDidOpts, ManagedIdentifierOptsOrResult } from '../types'
1
+ import {IIdentifier} from '@veramo/core'
2
+ import {ManagedIdentifierDidOpts, ManagedIdentifierOptsOrResult} from '../types'
3
3
 
4
4
  /**
5
5
  * Converts legacy id opts key refs to the new ManagedIdentifierOpts
6
6
  * @param opts
7
7
  */
8
8
  export function legacyKeyRefsToIdentifierOpts(opts: {
9
- idOpts?: ManagedIdentifierOptsOrResult
10
- iss?: string
11
- keyRef?: string
12
- didOpts?: any
9
+ idOpts?: ManagedIdentifierOptsOrResult
10
+ iss?: string
11
+ keyRef?: string
12
+ didOpts?: any
13
13
  }): ManagedIdentifierOptsOrResult {
14
- if (!opts.idOpts) {
15
- console.warn(
16
- `Legacy idOpts being used. Support will be dropped in the future. Consider switching to the idOpts, to have support for DIDs, JWKS, x5c etc. See https://github.com/Sphereon-Opensource/SSI-SDK-crypto-extensions/tree/feature/multi_identifier_support/packages/identifier-resolution`
17
- )
18
- // legacy way
19
- let kmsKeyRef =
20
- opts.keyRef ??
21
- opts.didOpts?.idOpts?.kmsKeyRef ??
22
- (typeof opts.didOpts?.idOpts.identifier === 'object' ? (opts.didOpts?.idOpts.identifier as IIdentifier).keys[0].kid : undefined)
23
- if (!kmsKeyRef) {
24
- throw Error('Key ref is needed for access token signer')
25
- }
26
- return {
27
- kmsKeyRef: opts.keyRef ?? kmsKeyRef,
28
- identifier: kmsKeyRef,
29
- issuer: opts.iss,
30
- } satisfies ManagedIdentifierDidOpts
31
- } else {
32
- const idOpts = opts.idOpts
33
- if (opts.keyRef && !idOpts.kmsKeyRef) {
34
- // legacy way
35
- console.warn(
36
- `Legacy keyRef being used. Support will be dropped in the future. Consider switching to the idOpts, to have support for DIDs, JWKS, x5c etc. See https://github.com/Sphereon-Opensource/SSI-SDK-crypto-extensions/tree/feature/multi_identifier_support/packages/identifier-resolution`
37
- )
38
- idOpts.kmsKeyRef = opts.keyRef
39
- }
40
- if (opts.iss && !idOpts.issuer) {
41
- // legacy way
42
- console.warn(
43
- `Legacy iss being used. Support will be dropped in the future. Consider switching to the idOpts, to have support for DIDs, JWKS, x5c etc. See https://github.com/Sphereon-Opensource/SSI-SDK-crypto-extensions/tree/feature/multi_identifier_support/packages/identifier-resolution`
44
- )
45
- idOpts.issuer = opts.iss
46
- }
14
+ if (!opts.idOpts) {
15
+ console.warn(
16
+ `Legacy idOpts being used. Support will be dropped in the future. Consider switching to the idOpts, to have support for DIDs, JWKS, x5c etc. See https://github.com/Sphereon-Opensource/SSI-SDK-crypto-extensions/tree/feature/multi_identifier_support/packages/identifier-resolution`
17
+ )
18
+ // legacy way
19
+ let kmsKeyRef =
20
+ opts.keyRef ??
21
+ opts.didOpts?.idOpts?.kmsKeyRef ??
22
+ opts.didOpts?.kid ??
23
+ opts.didOpts.idOpts?.kid ??
24
+ (typeof opts.didOpts?.idOpts.identifier === 'object' ? (opts.didOpts?.idOpts.identifier as IIdentifier).keys[0].kid : undefined)
25
+ if (!kmsKeyRef) {
26
+ throw Error('Key ref is needed for access token signer')
27
+ }
28
+ let identifier = (opts.didOpts?.identifier ?? opts.didOpts?.idOpts?.identifier) as IIdentifier | undefined
47
29
 
48
- return idOpts
49
- }
30
+ return {
31
+ kmsKeyRef: opts.keyRef ?? kmsKeyRef,
32
+ identifier: identifier ?? kmsKeyRef,
33
+ issuer: opts.iss,
34
+ } satisfies ManagedIdentifierDidOpts
35
+ } else {
36
+ const idOpts = opts.idOpts
37
+ if (opts.keyRef && !idOpts.kmsKeyRef) {
38
+ // legacy way
39
+ console.warn(
40
+ `Legacy keyRef being used. Support will be dropped in the future. Consider switching to the idOpts, to have support for DIDs, JWKS, x5c etc. See https://github.com/Sphereon-Opensource/SSI-SDK-crypto-extensions/tree/feature/multi_identifier_support/packages/identifier-resolution`
41
+ )
42
+ idOpts.kmsKeyRef = opts.keyRef
43
+ }
44
+ if (opts.iss && !idOpts.issuer) {
45
+ // legacy way
46
+ console.warn(
47
+ `Legacy iss being used. Support will be dropped in the future. Consider switching to the idOpts, to have support for DIDs, JWKS, x5c etc. See https://github.com/Sphereon-Opensource/SSI-SDK-crypto-extensions/tree/feature/multi_identifier_support/packages/identifier-resolution`
48
+ )
49
+ idOpts.issuer = opts.iss
50
+ }
51
+
52
+ return idOpts
53
+ }
50
54
  }