@denodeio/seshat 0.0.34 → 0.0.35

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,3 +1,4 @@
1
+ import jwt from "jsonwebtoken";
1
2
  import { Key, Keychain } from "./types";
2
3
  type JwsSignature = {
3
4
  protected: string;
@@ -21,7 +22,8 @@ type JwtPayload<T> = {
21
22
  iat: number;
22
23
  };
23
24
  export declare const validateJws: <T>(key: Key, input: JwsPayload) => JwtPayload<T> | undefined;
24
- export declare const validateJwsMultisig: <T>(keychain: Keychain, input: JwsPayload) => {
25
+ export declare const validateJwsMultisig: (keychain: Keychain, input: JwsPayload) => {
26
+ payload: string | jwt.JwtPayload | null;
25
27
  verified: string[];
26
28
  unverified: string[];
27
29
  };
@@ -1,4 +1,4 @@
1
- import { Secret, PublicKey } from 'jsonwebtoken';
1
+ import jwt, { Secret, PublicKey } from 'jsonwebtoken';
2
2
 
3
3
  declare const managementSigner: (options: any) => (req: any, res: any, next: any) => void;
4
4
  type OptionsInput = {
@@ -51,7 +51,8 @@ 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
+ payload: string | jwt.JwtPayload | null;
55
56
  verified: string[];
56
57
  unverified: string[];
57
58
  };
@@ -6672,6 +6672,7 @@ var utils = {};
6672
6672
  const validateJwsMultisig = (keychain, input) => {
6673
6673
  const verified = [];
6674
6674
  const unverified = [];
6675
+ const payload = jsonwebtoken_1.default.decode(input.payload);
6675
6676
  for (const signature of input.signatures) {
6676
6677
  const key = keychain.get(signature.header.kid);
6677
6678
  if (key) {
@@ -6683,6 +6684,7 @@ var utils = {};
6683
6684
  }
6684
6685
  }
6685
6686
  return {
6687
+ payload,
6686
6688
  verified,
6687
6689
  unverified
6688
6690
  };