@graphql-yoga/plugin-jwt 2.3.1 → 2.4.0-alpha-20240517101108-70410f9a

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.
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@graphql-yoga/plugin-jwt",
3
- "version": "2.3.1",
3
+ "version": "2.4.0-alpha-20240517101108-70410f9a",
4
4
  "description": "jwt plugin for GraphQL Yoga.",
5
5
  "peerDependencies": {
6
6
  "graphql": "^16.5.0",
7
- "graphql-yoga": "^5.3.1"
7
+ "graphql-yoga": "5.4.0-alpha-20240517101108-70410f9a"
8
8
  },
9
9
  "dependencies": {
10
10
  "jsonwebtoken": "^9.0.0",
@@ -1,7 +1,7 @@
1
1
  import { Plugin } from 'graphql-yoga';
2
- import { Algorithm } from 'jsonwebtoken';
2
+ import { Algorithm, VerifyOptions } from 'jsonwebtoken';
3
3
  export type JwtPluginOptions = JwtPluginOptionsWithJWKS | JwtPluginOptionsWithSigningKey;
4
- export interface JwtPluginOptionsBase {
4
+ export interface JwtPluginOptionsBase extends VerifyOptions {
5
5
  /**
6
6
  * List of the algorithms used to verify the token
7
7
  *
@@ -11,11 +11,11 @@ export interface JwtPluginOptionsBase {
11
11
  /**
12
12
  * The audience is the identifier of the API and is forwarded to your Auth API in order to specify for which API we are trying to authenticate our user for. E.g. if our API is hosted on `http://localhost:3000/graphql`, we would pass that value.
13
13
  */
14
- audience?: string;
14
+ audience?: VerifyOptions['audience'];
15
15
  /**
16
16
  * For example: `https://myapp.auth0.com/`
17
17
  */
18
- issuer: string;
18
+ issuer: VerifyOptions['issuer'];
19
19
  /**
20
20
  * Once a user got successfully authenticated the authentication information is added on the context object under this field. In our resolvers we can then access the authentication information via `context._jwt.sub`.
21
21
  */
@@ -1,7 +1,7 @@
1
1
  import { Plugin } from 'graphql-yoga';
2
- import { Algorithm } from 'jsonwebtoken';
2
+ import { Algorithm, VerifyOptions } from 'jsonwebtoken';
3
3
  export type JwtPluginOptions = JwtPluginOptionsWithJWKS | JwtPluginOptionsWithSigningKey;
4
- export interface JwtPluginOptionsBase {
4
+ export interface JwtPluginOptionsBase extends VerifyOptions {
5
5
  /**
6
6
  * List of the algorithms used to verify the token
7
7
  *
@@ -11,11 +11,11 @@ export interface JwtPluginOptionsBase {
11
11
  /**
12
12
  * The audience is the identifier of the API and is forwarded to your Auth API in order to specify for which API we are trying to authenticate our user for. E.g. if our API is hosted on `http://localhost:3000/graphql`, we would pass that value.
13
13
  */
14
- audience?: string;
14
+ audience?: VerifyOptions['audience'];
15
15
  /**
16
16
  * For example: `https://myapp.auth0.com/`
17
17
  */
18
- issuer: string;
18
+ issuer: VerifyOptions['issuer'];
19
19
  /**
20
20
  * Once a user got successfully authenticated the authentication information is added on the context object under this field. In our resolvers we can then access the authentication information via `context._jwt.sub`.
21
21
  */