@edirect/auth-fastify 11.2.5 → 11.2.6

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@edirect/auth-fastify",
3
- "version": "11.2.5",
3
+ "version": "11.2.6",
4
4
  "main": "./src/index.js",
5
5
  "types": "./src/index.d.ts",
6
6
  "exports": {
package/src/util.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAS9C;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,QAAO,OAE0C,CAAC;AAE7E,+EAA+E;AAC/E,eAAO,MAAM,QAAQ,GAAI,KAAK,cAAc,KAAG,MAI3C,CAAC;AAEL,eAAO,MAAM,QAAQ,GAAI,KAAK,cAAc,EAAE,OAAO,MAAM,KAAG,IAE7D,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,KAAK,MAAM,EAAE,YAAY,MAAM,EAAE,YAClB,CAAC;AAEtD,eAAO,MAAM,cAAc,GAAI,OAAO,GAAG;;;CAcxC,CAAC"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAU9C;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,QAAO,OAAgB,CAAC;AAMnD,+EAA+E;AAC/E,eAAO,MAAM,QAAQ,GAAI,KAAK,cAAc,KAAG,MAI3C,CAAC;AAEL,eAAO,MAAM,QAAQ,GAAI,KAAK,cAAc,EAAE,OAAO,MAAM,KAAG,IAE7D,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,KAAK,MAAM,EAAE,YAAY,MAAM,EAAE,YAClB,CAAC;AAEtD,eAAO,MAAM,cAAc,GAAI,OAAO,GAAG;;;CAcxC,CAAC"}
package/src/util.js CHANGED
@@ -4,7 +4,12 @@ exports.errorFormatter = exports.checkPropertiesObject = exports.setToken = expo
4
4
  const tslib_1 = require("tslib");
5
5
  const axios_1 = require("axios");
6
6
  const set_1 = tslib_1.__importDefault(require("lodash/set"));
7
- const constants_1 = require("./constants");
7
+ // import {
8
+ // BOLTTECH_ENABLE_IDP_AUTH,
9
+ // BOLTTECH_ENABLE_IDP_AUTH_ENV_KEY,
10
+ // BOLTTECH_PLATFORM_ENV_KEY,
11
+ // BOLTTECH_PLATFORM_IDP,
12
+ // } from './constants';
8
13
  /**
9
14
  * Returns true when authentication/authorization should be bypassed.
10
15
  *
@@ -12,9 +17,12 @@ const constants_1 = require("./constants");
12
17
  * ENABLE_IDP_AUTH environment variable to "true" re-enables auth for idp.
13
18
  * On any other platform, auth is always enabled.
14
19
  */
15
- const isAuthDisabled = () => process.env[constants_1.BOLTTECH_PLATFORM_ENV_KEY] === constants_1.BOLTTECH_PLATFORM_IDP &&
16
- process.env[constants_1.BOLTTECH_ENABLE_IDP_AUTH_ENV_KEY] !== constants_1.BOLTTECH_ENABLE_IDP_AUTH;
20
+ const isAuthDisabled = () => false;
17
21
  exports.isAuthDisabled = isAuthDisabled;
22
+ // Disable it temporary, waiting for devops to have mTLS
23
+ // export const isAuthDisabled = (): boolean =>
24
+ // process.env[BOLTTECH_PLATFORM_ENV_KEY] === BOLTTECH_PLATFORM_IDP &&
25
+ // process.env[BOLTTECH_ENABLE_IDP_AUTH_ENV_KEY] !== BOLTTECH_ENABLE_IDP_AUTH;
18
26
  /** Bearer token from the Authorization header, or `token` from a JSON body. */
19
27
  const getToken = (req) => (req.headers.authorization &&
20
28
  req.headers.authorization.replace('Bearer ', '')) ||