@boxyhq/saml-jackson 0.3.6 → 0.3.7

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.
@@ -144,8 +144,8 @@ class OAuthController {
144
144
  }
145
145
  samlResponse(body) {
146
146
  return __awaiter(this, void 0, void 0, function* () {
147
- const { SAMLResponse } = body; // RelayState will contain the sessionId from earlier quasi-oauth flow
148
- let RelayState = body.RelayState || '';
147
+ const { SAMLResponse } = body;
148
+ let RelayState = body.RelayState || ''; // RelayState will contain the sessionId from earlier quasi-oauth flow
149
149
  if (!this.opts.idpEnabled && !RelayState.startsWith(relayStatePrefix)) {
150
150
  // IDP is disabled so block the request
151
151
  throw new error_1.JacksonError('IdP (Identity Provider) flow has been disabled. Please head to your Service Provider to login.', 403);
@@ -284,7 +284,7 @@ class OAuthController {
284
284
  }
285
285
  else if (client_id && client_secret) {
286
286
  // check if we have an encoded client_id
287
- if (client_id !== 'dummy' && client_secret !== 'dummy') {
287
+ if (client_id !== 'dummy') {
288
288
  const sp = getEncodedClientId(client_id);
289
289
  if (!sp) {
290
290
  // OAuth flow
@@ -39,8 +39,8 @@ const readConfig = (preLoadedConfig) => __awaiter(void 0, void 0, void 0, functi
39
39
  for (const idx in files) {
40
40
  const file = files[idx];
41
41
  if (file.endsWith('.js')) {
42
- // eslint-disable-next-line @typescript-eslint/no-var-requires
43
- const config = require(path.join(preLoadedConfig, file));
42
+ const { default: config } = yield Promise.resolve().then(() => __importStar(require(
43
+ /* webpackIgnore: true */ path.join(preLoadedConfig, file))));
44
44
  const rawMetadata = yield fs.promises.readFile(path.join(preLoadedConfig, path.parse(file).name + '.xml'), 'utf8');
45
45
  config.encodedRawMetadata = Buffer.from(rawMetadata, 'utf8').toString('base64');
46
46
  configs.push(config);
package/dist/saml/saml.js CHANGED
@@ -68,7 +68,7 @@ const request = ({ ssoUrl, entityID, callbackUrl, isPassive = false, forceAuthn
68
68
  '@ID': id,
69
69
  '@Version': '2.0',
70
70
  '@IssueInstant': date,
71
- '@ProtocolBinding': 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
71
+ '@ProtocolBinding': 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
72
72
  '@Destination': ssoUrl,
73
73
  'saml:Issuer': {
74
74
  '@xmlns:saml': 'urn:oasis:names:tc:SAML:2.0:assertion',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boxyhq/saml-jackson",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "SAML 2.0 service",
5
5
  "keywords": [
6
6
  "SAML 2.0"
@@ -18,7 +18,12 @@
18
18
  ],
19
19
  "scripts": {
20
20
  "build": "tsc -p tsconfig.build.json",
21
- "db:migration:generate": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js migration:generate --config ormconfig.js -n Initial",
21
+ "db:migration:generate:postgres": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js migration:generate --config ormconfig.js -n Initial",
22
+ "db:migration:generate:mysql": "cross-env DB_TYPE=mysql DB_URL=mysql://root:mysql@localhost:3307/mysql ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js migration:generate --config ormconfig.js -n Initial",
23
+ "db:migration:generate:mariadb": "cross-env DB_TYPE=mariadb DB_URL=mariadb://root@localhost:3306/mysql ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js migration:generate --config ormconfig.js -n Initial",
24
+ "db:migration:run:postgres": "ts-node --transpile-only ./node_modules/typeorm/cli.js migration:run",
25
+ "db:migration:run:mysql": "cross-env DB_TYPE=mysql DB_URL=mysql://root:mysql@localhost:3307/mysql ts-node --transpile-only ./node_modules/typeorm/cli.js migration:run",
26
+ "db:migration:run:mariadb": "cross-env DB_TYPE=mariadb DB_URL=mariadb://root@localhost:3306/mysql ts-node --transpile-only ./node_modules/typeorm/cli.js migration:run",
22
27
  "prepublishOnly": "npm run build",
23
28
  "test": "tap --ts --timeout=100 --coverage test/**/*.test.ts",
24
29
  "sort": "npx sort-package-json"
@@ -36,11 +41,11 @@
36
41
  "@peculiar/x509": "1.6.1",
37
42
  "cors": "2.8.5",
38
43
  "express": "4.17.2",
39
- "mongodb": "4.3.0",
44
+ "mongodb": "4.3.1",
40
45
  "mysql2": "2.3.3",
41
- "pg": "8.7.1",
42
- "rambda": "7.0.1",
43
- "redis": "4.0.1",
46
+ "pg": "8.7.3",
47
+ "rambda": "7.0.2",
48
+ "redis": "4.0.3",
44
49
  "reflect-metadata": "0.1.13",
45
50
  "ripemd160": "2.0.2",
46
51
  "thumbprint": "0.0.1",
@@ -51,19 +56,20 @@
51
56
  },
52
57
  "devDependencies": {
53
58
  "@types/express": "4.17.13",
54
- "@types/node": "16.11.17",
55
- "@types/sinon": "10.0.6",
59
+ "@types/node": "17.0.17",
60
+ "@types/sinon": "10.0.11",
56
61
  "@types/tap": "15.0.5",
57
- "@typescript-eslint/eslint-plugin": "5.8.1",
58
- "@typescript-eslint/parser": "5.8.1",
59
- "eslint": "8.5.0",
62
+ "@typescript-eslint/eslint-plugin": "5.11.0",
63
+ "@typescript-eslint/parser": "5.11.0",
64
+ "cross-env": "7.0.3",
65
+ "eslint": "8.9.0",
60
66
  "eslint-config-prettier": "8.3.0",
61
67
  "prettier": "2.5.1",
62
- "sinon": "12.0.1",
68
+ "sinon": "13.0.1",
63
69
  "tap": "15.1.6",
64
- "ts-node": "10.4.0",
70
+ "ts-node": "10.5.0",
65
71
  "tsconfig-paths": "3.12.0",
66
- "typescript": "4.5.4"
72
+ "typescript": "4.5.5"
67
73
  },
68
74
  "engines": {
69
75
  "node": ">=14.x"