@veramo/credential-ld 5.4.2-next.1 → 5.4.2-next.2

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":"ld-suite-loader.d.ts","sourceRoot":"","sources":["../src/ld-suite-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7C;;GAEG;AACH,qBAAa,aAAa;gBACZ,OAAO,EAAE;QAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAA;KAAE;IAOhE,OAAO,CAAC,YAAY,CAAwD;IAE5E,2BAA2B,CAAC,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM;IAOpE,qBAAqB,IAAI,iBAAiB,EAAE;IAI5C,yBAAyB;CAG1B"}
1
+ {"version":3,"file":"ld-suite-loader.d.ts","sourceRoot":"","sources":["../src/ld-suite-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7C;;GAEG;AACH,qBAAa,aAAa;gBACZ,OAAO,EAAE;QAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAA;KAAE;IAYhE,OAAO,CAAC,YAAY,CAAwD;IAE5E,2BAA2B,CAAC,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM;IAOpE,qBAAqB,IAAI,iBAAiB,EAAE;IAM5C,yBAAyB;CAK1B"}
@@ -4,9 +4,13 @@
4
4
  export class LdSuiteLoader {
5
5
  constructor(options) {
6
6
  options.veramoLdSignatures.forEach((obj) => {
7
+ // FIXME: some suites would work for multiple key types, but this only returns a single value per suite.
8
+ // For example, EcdsaSecp256k1RecoverySignature2020 should work with both EcdsaSecp256k1VerificationKey2019
9
+ // as well as EcdsaSecp256k1RecoveryMethod2020 since the VerificationKey can also be expressed as the recovery
10
+ // method.
7
11
  const keyType = obj.getSupportedVeramoKeyType();
8
12
  const verificationType = obj.getSupportedVerificationType();
9
- return this.signatureMap[keyType] = { ...this.signatureMap[keyType], [verificationType]: obj };
13
+ return (this.signatureMap[keyType] = { ...this.signatureMap[keyType], [verificationType]: obj });
10
14
  });
11
15
  }
12
16
  signatureMap = {};
@@ -17,10 +21,14 @@ export class LdSuiteLoader {
17
21
  throw new Error('No Veramo LD Signature Suite for ' + type);
18
22
  }
19
23
  getAllSignatureSuites() {
20
- return Object.values(this.signatureMap).map((x) => Object.values(x)).flat();
24
+ return Object.values(this.signatureMap)
25
+ .map((x) => Object.values(x))
26
+ .flat();
21
27
  }
22
28
  getAllSignatureSuiteTypes() {
23
- return Object.values(this.signatureMap).map((x) => Object.keys(x)).flat();
29
+ return Object.values(this.signatureMap)
30
+ .map((x) => Object.keys(x))
31
+ .flat();
24
32
  }
25
33
  }
26
34
  //# sourceMappingURL=ld-suite-loader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ld-suite-loader.js","sourceRoot":"","sources":["../src/ld-suite-loader.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,OAAO,aAAa;IACxB,YAAY,OAAoD;QAC9D,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACzC,MAAM,OAAO,GAAG,GAAG,CAAC,yBAAyB,EAAE,CAAA;YAC/C,MAAM,gBAAgB,GAAG,GAAG,CAAC,4BAA4B,EAAE,CAAA;YAC3D,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,GAAG,EAAE,CAAA;QAChG,CAAC,CAAC,CAAA;IACJ,CAAC;IACO,YAAY,GAAsD,EAAE,CAAA;IAE5E,2BAA2B,CAAC,IAAc,E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,EAAE,CAAA;IAE5E,2BAA2B,CAAC,IAAc,EAAE,gBAAwB;QAClE,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAA;QACzD,IAAI,KAAK;YAAE,OAAO,KAAK,CAAA;QAEvB,MAAM,IAAI,KAAK,CAAC,mCAAmC,GAAG,IAAI,CAAC,CAAA;IAC7D,CAAC;IAED,qBAAqB;QACnB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;aACpC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;aAC5B,IAAI,EAAE,CAAA;IACX,CAAC;IAED,yBAAyB;QACvB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;aACpC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aAC1B,IAAI,EAAE,CAAA;IACX,CAAC;CACF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@veramo/credential-ld",
3
3
  "description": "Veramo plugin for working with W3C JSON-LD Verifiable Credentials & Presentations.",
4
- "version": "5.4.2-next.1+72e2ee3bb",
4
+ "version": "5.4.2-next.2+d046e49b0",
5
5
  "main": "build/index.js",
6
6
  "exports": {
7
7
  ".": "./build/index.js",
@@ -27,8 +27,8 @@
27
27
  "@transmute/ed25519-signature-2018": "^0.7.0-unstable.81",
28
28
  "@transmute/json-web-signature": "^0.7.0-unstable.81",
29
29
  "@veramo-community/lds-ecdsa-secp256k1-recovery2020": "uport-project/EcdsaSecp256k1RecoverySignature2020",
30
- "@veramo/core-types": "^5.4.2-next.1+72e2ee3bb",
31
- "@veramo/utils": "^5.4.2-next.1+72e2ee3bb",
30
+ "@veramo/core-types": "^5.4.2-next.2+d046e49b0",
31
+ "@veramo/utils": "^5.4.2-next.2+d046e49b0",
32
32
  "cross-fetch": "^3.1.6",
33
33
  "debug": "^4.3.3",
34
34
  "did-resolver": "^4.1.0"
@@ -62,5 +62,5 @@
62
62
  "node_modules",
63
63
  "src"
64
64
  ],
65
- "gitHead": "72e2ee3bbc1910a9eb3a83c53de3a0c73bb406b7"
65
+ "gitHead": "d046e49b098cd23b7ce654c336172823c6258e5e"
66
66
  }
@@ -7,11 +7,16 @@ import { TKeyType } from '@veramo/core-types'
7
7
  export class LdSuiteLoader {
8
8
  constructor(options: { veramoLdSignatures: VeramoLdSignature[] }) {
9
9
  options.veramoLdSignatures.forEach((obj) => {
10
+ // FIXME: some suites would work for multiple key types, but this only returns a single value per suite.
11
+ // For example, EcdsaSecp256k1RecoverySignature2020 should work with both EcdsaSecp256k1VerificationKey2019
12
+ // as well as EcdsaSecp256k1RecoveryMethod2020 since the VerificationKey can also be expressed as the recovery
13
+ // method.
10
14
  const keyType = obj.getSupportedVeramoKeyType()
11
15
  const verificationType = obj.getSupportedVerificationType()
12
- return this.signatureMap[keyType] = { ...this.signatureMap[keyType], [verificationType]: obj }
16
+ return (this.signatureMap[keyType] = { ...this.signatureMap[keyType], [verificationType]: obj })
13
17
  })
14
18
  }
19
+
15
20
  private signatureMap: Record<string, Record<string, VeramoLdSignature>> = {}
16
21
 
17
22
  getSignatureSuiteForKeyType(type: TKeyType, verificationType: string) {
@@ -22,10 +27,14 @@ export class LdSuiteLoader {
22
27
  }
23
28
 
24
29
  getAllSignatureSuites(): VeramoLdSignature[] {
25
- return Object.values(this.signatureMap).map((x) => Object.values(x)).flat()
30
+ return Object.values(this.signatureMap)
31
+ .map((x) => Object.values(x))
32
+ .flat()
26
33
  }
27
34
 
28
35
  getAllSignatureSuiteTypes() {
29
- return Object.values(this.signatureMap).map((x) => Object.keys(x)).flat()
36
+ return Object.values(this.signatureMap)
37
+ .map((x) => Object.keys(x))
38
+ .flat()
30
39
  }
31
40
  }