@denodeio/seshat 0.0.34 → 0.0.36

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.
@@ -21,7 +21,9 @@ type JwtPayload<T> = {
21
21
  iat: number;
22
22
  };
23
23
  export declare const validateJws: <T>(key: Key, input: JwsPayload) => JwtPayload<T> | undefined;
24
- export declare const validateJwsMultisig: <T>(keychain: Keychain, input: JwsPayload) => {
24
+ export declare const validateJwsMultisig: (keychain: Keychain, input: JwsPayload) => {
25
+ isVerified: boolean;
26
+ payload: any;
25
27
  verified: string[];
26
28
  unverified: string[];
27
29
  };
@@ -51,7 +51,9 @@ type JwtPayload<T> = {
51
51
  iat: number;
52
52
  };
53
53
  declare const validateJws: <T>(key: Key, input: JwsPayload) => JwtPayload<T> | undefined;
54
- declare const validateJwsMultisig: <T>(keychain: Keychain, input: JwsPayload) => {
54
+ declare const validateJwsMultisig: (keychain: Keychain, input: JwsPayload) => {
55
+ isVerified: boolean;
56
+ payload: any;
55
57
  verified: string[];
56
58
  unverified: string[];
57
59
  };
@@ -6629,6 +6629,7 @@ const validateJws = (key, input) => {
6629
6629
  const validateJwsMultisig = (keychain, input) => {
6630
6630
  const verified = [];
6631
6631
  const unverified = [];
6632
+ const payload = JSON.parse(Buffer.from(input.payload, "base64").toString());
6632
6633
  for (const signature of input.signatures) {
6633
6634
  const key = keychain.get(signature.header.kid);
6634
6635
  if (key) {
@@ -6640,6 +6641,8 @@ const validateJwsMultisig = (keychain, input) => {
6640
6641
  }
6641
6642
  }
6642
6643
  return {
6644
+ isVerified: verified.length > 0,
6645
+ payload,
6643
6646
  verified,
6644
6647
  unverified
6645
6648
  };