@denodeio/seshat 0.0.35 → 0.0.37

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,4 +1,3 @@
1
- import jwt from "jsonwebtoken";
2
1
  import { Key, Keychain } from "./types";
3
2
  type JwsSignature = {
4
3
  protected: string;
@@ -23,7 +22,8 @@ type JwtPayload<T> = {
23
22
  };
24
23
  export declare const validateJws: <T>(key: Key, input: JwsPayload) => JwtPayload<T> | undefined;
25
24
  export declare const validateJwsMultisig: (keychain: Keychain, input: JwsPayload) => {
26
- payload: string | jwt.JwtPayload | null;
25
+ isVerified: boolean;
26
+ payload: any;
27
27
  verified: string[];
28
28
  unverified: string[];
29
29
  };
@@ -1,4 +1,4 @@
1
- import jwt, { Secret, PublicKey } from 'jsonwebtoken';
1
+ import { Secret, PublicKey } from 'jsonwebtoken';
2
2
 
3
3
  declare const managementSigner: (options: any) => (req: any, res: any, next: any) => void;
4
4
  type OptionsInput = {
@@ -52,7 +52,8 @@ type JwtPayload<T> = {
52
52
  };
53
53
  declare const validateJws: <T>(key: Key, input: JwsPayload) => JwtPayload<T> | undefined;
54
54
  declare const validateJwsMultisig: (keychain: Keychain, input: JwsPayload) => {
55
- payload: string | jwt.JwtPayload | null;
55
+ isVerified: boolean;
56
+ payload: any;
56
57
  verified: string[];
57
58
  unverified: string[];
58
59
  };
@@ -6629,7 +6629,7 @@ const validateJws = (key, input) => {
6629
6629
  const validateJwsMultisig = (keychain, input) => {
6630
6630
  const verified = [];
6631
6631
  const unverified = [];
6632
- const payload = jwt.decode(input.payload);
6632
+ const payload = JSON.parse(Buffer.from(input.payload, "base64").toString());
6633
6633
  for (const signature of input.signatures) {
6634
6634
  const key = keychain.get(signature.header.kid);
6635
6635
  if (key) {
@@ -6641,6 +6641,7 @@ const validateJwsMultisig = (keychain, input) => {
6641
6641
  }
6642
6642
  }
6643
6643
  return {
6644
+ isVerified: verified.length > 0,
6644
6645
  payload,
6645
6646
  verified,
6646
6647
  unverified