@payello-module/jwt 1.20240419.2346 → 1.20240922.121

Sign up to get free protection for your applications and to get access to all the features.
package/dist/JWT.d.ts CHANGED
@@ -23,7 +23,7 @@ export declare class JWT {
23
23
  * @param key - The key for signing the JWT
24
24
  * @returns A promise that resolves to the signed JWT string.
25
25
  */
26
- static sign(payload: JWTPayload, alg: JWTAlgorithm, key: string | BufferSource): Promise<string>;
26
+ static sign(payload: JWTPayload, alg: JWTAlgorithm, key: string | BufferSource, kid?: string): Promise<string>;
27
27
  /**
28
28
  * Extracts and returns the header, payload, and signature components from a JWT string.
29
29
  * @param input - The JWT string to be parsed.
package/dist/JWT.js CHANGED
@@ -40,12 +40,13 @@ export class JWT {
40
40
  * @param key - The key for signing the JWT
41
41
  * @returns A promise that resolves to the signed JWT string.
42
42
  */
43
- static async sign(payload, alg, key) {
43
+ static async sign(payload, alg, key, kid) {
44
44
  if (typeof JWTAlgorithms[alg] == "undefined")
45
45
  throw new JwtError("Unknown algorithm");
46
46
  const _header = {
47
47
  typ: 'JWT',
48
- alg: alg
48
+ alg: alg,
49
+ kid: kid
49
50
  };
50
51
  const body = base64_encode_urlsafe(JSON.stringify(_header)) +
51
52
  "." +
@@ -2,4 +2,5 @@ import { JWTAlgorithm } from "./JWTAlgorithms";
2
2
  export interface JwtHeader {
3
3
  typ: 'JWT';
4
4
  alg: JWTAlgorithm;
5
+ kid?: string;
5
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payello-module/jwt",
3
- "version": "1.20240419.2346",
3
+ "version": "1.20240922.121",
4
4
  "author": "Payello <devsupport@payello.com> (https://payello.com/)",
5
5
  "displayName": "@payello-module/jwt",
6
6
  "description": "JSON Web Token Module",