@graphql-mesh/plugin-jwt-auth 2.0.2 → 2.0.3-alpha-c495addbe8250b921cc5e04aacd7bbcc7fa06a05
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/CHANGELOG.md +7 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @graphql-mesh/plugin-jwt-auth
|
|
2
2
|
|
|
3
|
+
## 2.0.3-alpha-c495addbe8250b921cc5e04aacd7bbcc7fa06a05
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#1459](https://github.com/graphql-hive/gateway/pull/1459) [`d38112a`](https://github.com/graphql-hive/gateway/commit/d38112a3ca819f73c524223ab7f45e60f6295740) Thanks [@ardatan](https://github.com/ardatan)! - `useForwardedJWT` no longer requires an object so `useForwardedJWT()` is possible to use it with defaults
|
|
9
|
+
|
|
3
10
|
## 2.0.2
|
|
4
11
|
### Patch Changes
|
|
5
12
|
|
package/dist/index.cjs
CHANGED
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var pluginJwt = require('@graphql-yoga/plugin-jwt');
|
|
6
6
|
|
|
7
7
|
function useForwardedJWT(config) {
|
|
8
|
-
const extensionsJwtFieldName = config
|
|
9
|
-
const extendContextFieldName = config
|
|
8
|
+
const extensionsJwtFieldName = config?.extensionsFieldName ?? "jwt";
|
|
9
|
+
const extendContextFieldName = config?.extendContextFieldName ?? "jwt";
|
|
10
10
|
return {
|
|
11
11
|
onContextBuilding({ context, extendContext }) {
|
|
12
12
|
if (context.params.extensions?.[extensionsJwtFieldName]) {
|
package/dist/index.d.cts
CHANGED
|
@@ -452,7 +452,7 @@ type JWTAuthPluginOptions = JwtPluginOptions & {
|
|
|
452
452
|
* This Yoga plugin is used to extract the forwarded (from Mesh gateway) the JWT token and claims.
|
|
453
453
|
* Use this plugin in your Yoga server to extract the JWT token and claims from the forwarded extensions.
|
|
454
454
|
*/
|
|
455
|
-
declare function useForwardedJWT(config
|
|
455
|
+
declare function useForwardedJWT(config?: {
|
|
456
456
|
extensionsFieldName?: string;
|
|
457
457
|
extendContextFieldName?: string;
|
|
458
458
|
}): Plugin<JWTAuthContextExtension>;
|
package/dist/index.d.ts
CHANGED
|
@@ -452,7 +452,7 @@ type JWTAuthPluginOptions = JwtPluginOptions & {
|
|
|
452
452
|
* This Yoga plugin is used to extract the forwarded (from Mesh gateway) the JWT token and claims.
|
|
453
453
|
* Use this plugin in your Yoga server to extract the JWT token and claims from the forwarded extensions.
|
|
454
454
|
*/
|
|
455
|
-
declare function useForwardedJWT(config
|
|
455
|
+
declare function useForwardedJWT(config?: {
|
|
456
456
|
extensionsFieldName?: string;
|
|
457
457
|
extendContextFieldName?: string;
|
|
458
458
|
}): Plugin<JWTAuthContextExtension>;
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import { useJWT as useJWT$1 } from '@graphql-yoga/plugin-jwt';
|
|
|
2
2
|
export { createInlineSigningKeyProvider, createRemoteJwksSigningKeyProvider, extractFromConnectionParams, extractFromCookie, extractFromHeader } from '@graphql-yoga/plugin-jwt';
|
|
3
3
|
|
|
4
4
|
function useForwardedJWT(config) {
|
|
5
|
-
const extensionsJwtFieldName = config
|
|
6
|
-
const extendContextFieldName = config
|
|
5
|
+
const extensionsJwtFieldName = config?.extensionsFieldName ?? "jwt";
|
|
6
|
+
const extendContextFieldName = config?.extendContextFieldName ?? "jwt";
|
|
7
7
|
return {
|
|
8
8
|
onContextBuilding({ context, extendContext }) {
|
|
9
9
|
if (context.params.extensions?.[extensionsJwtFieldName]) {
|