@boxyhq/saml-jackson 0.3.6-beta.603 → 0.3.6-beta.618
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/dist/controller/oauth.d.ts +0 -1
- package/dist/controller/oauth.js +10 -20
- package/dist/controller/utils.d.ts +0 -1
- package/dist/controller/utils.js +1 -25
- package/dist/saml/saml.js +1 -1
- package/dist/typings.d.ts +0 -1
- package/package.json +10 -2
package/dist/controller/oauth.js
CHANGED
@@ -40,6 +40,9 @@ const allowed = __importStar(require("./oauth/allowed"));
|
|
40
40
|
const codeVerifier = __importStar(require("./oauth/code-verifier"));
|
41
41
|
const redirect = __importStar(require("./oauth/redirect"));
|
42
42
|
const utils_1 = require("./utils");
|
43
|
+
const util_1 = require("util");
|
44
|
+
const zlib_1 = require("zlib");
|
45
|
+
const deflateRawAsync = (0, util_1.promisify)(zlib_1.deflateRaw);
|
43
46
|
const relayStatePrefix = 'boxyhq_jackson_';
|
44
47
|
function getEncodedClientId(client_id) {
|
45
48
|
try {
|
@@ -130,26 +133,13 @@ class OAuthController {
|
|
130
133
|
code_challenge,
|
131
134
|
code_challenge_method,
|
132
135
|
});
|
133
|
-
|
134
|
-
const samlReqEnc =
|
135
|
-
const
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
redirectUrl = redirect.success(sso.redirectUrl, {
|
141
|
-
RelayState: relayState,
|
142
|
-
SAMLRequest: samlReqEnc,
|
143
|
-
});
|
144
|
-
}
|
145
|
-
// HTTP POST binding
|
146
|
-
if ('postUrl' in sso) {
|
147
|
-
authorizeForm = (0, utils_1.createAuthorizeForm)(relayState, samlReqEnc, sso.postUrl);
|
148
|
-
}
|
149
|
-
return {
|
150
|
-
redirect_url: redirectUrl,
|
151
|
-
authorize_form: authorizeForm,
|
152
|
-
};
|
136
|
+
// deepak: When supporting HTTP-POST skip deflate
|
137
|
+
const samlReqEnc = yield deflateRawAsync(samlReq.request);
|
138
|
+
const redirectUrl = redirect.success(samlConfig.idpMetadata.sso.redirectUrl, {
|
139
|
+
RelayState: relayStatePrefix + sessionId,
|
140
|
+
SAMLRequest: Buffer.from(samlReqEnc).toString('base64'),
|
141
|
+
});
|
142
|
+
return { redirect_url: redirectUrl };
|
153
143
|
});
|
154
144
|
}
|
155
145
|
samlResponse(body) {
|
package/dist/controller/utils.js
CHANGED
@@ -1,32 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.IndexNames = void 0;
|
4
4
|
var IndexNames;
|
5
5
|
(function (IndexNames) {
|
6
6
|
IndexNames["EntityID"] = "entityID";
|
7
7
|
IndexNames["TenantProduct"] = "tenantProduct";
|
8
8
|
})(IndexNames = exports.IndexNames || (exports.IndexNames = {}));
|
9
|
-
const createAuthorizeForm = (relayState, samlReqEnc, postUrl) => {
|
10
|
-
const formElements = [
|
11
|
-
'<!DOCTYPE html>',
|
12
|
-
'<html>',
|
13
|
-
'<head>',
|
14
|
-
'<meta charset="utf-8">',
|
15
|
-
'<meta http-equiv="x-ua-compatible" content="ie=edge">',
|
16
|
-
'</head>',
|
17
|
-
'<body onload="document.forms[0].submit()">',
|
18
|
-
'<noscript>',
|
19
|
-
'<p>Note: Since your browser does not support JavaScript, you must press the Continue button once to proceed.</p>',
|
20
|
-
'</noscript>',
|
21
|
-
'<form method="post" action="' + encodeURI(postUrl) + '">',
|
22
|
-
'<input type="hidden" name="RelayState" value="' + relayState + '"/>',
|
23
|
-
'<input type="hidden" name="SAMLRequest" value="' + samlReqEnc + '"/>',
|
24
|
-
'<input type="submit" value="Continue" />',
|
25
|
-
'</form>',
|
26
|
-
'<script>document.forms[0].style.display="none";</script>',
|
27
|
-
'</body>',
|
28
|
-
'</html>',
|
29
|
-
];
|
30
|
-
return formElements.join('');
|
31
|
-
};
|
32
|
-
exports.createAuthorizeForm = createAuthorizeForm;
|
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-
|
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/dist/typings.d.ts
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@boxyhq/saml-jackson",
|
3
|
-
"version": "0.3.6-beta.
|
3
|
+
"version": "0.3.6-beta.618",
|
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"
|
@@ -34,6 +39,8 @@
|
|
34
39
|
"@boxyhq/saml20": "0.2.0",
|
35
40
|
"@peculiar/webcrypto": "1.2.3",
|
36
41
|
"@peculiar/x509": "1.6.1",
|
42
|
+
"cors": "2.8.5",
|
43
|
+
"express": "4.17.2",
|
37
44
|
"mongodb": "4.3.0",
|
38
45
|
"mysql2": "2.3.3",
|
39
46
|
"pg": "8.7.1",
|
@@ -54,6 +61,7 @@
|
|
54
61
|
"@types/tap": "15.0.5",
|
55
62
|
"@typescript-eslint/eslint-plugin": "5.8.1",
|
56
63
|
"@typescript-eslint/parser": "5.8.1",
|
64
|
+
"cross-env": "7.0.3",
|
57
65
|
"eslint": "8.5.0",
|
58
66
|
"eslint-config-prettier": "8.3.0",
|
59
67
|
"prettier": "2.5.1",
|