@sassoftware/viya-serverjs 0.2.4 → 0.4.0
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/.babelrc +6 -6
- package/.dockerignore +2 -2
- package/.env +29 -29
- package/.env.proxy +32 -32
- package/.env.server +30 -30
- package/.eslintignore +3 -3
- package/.eslintrc.json +42 -42
- package/Dockerfile +44 -44
- package/README.md +99 -99
- package/cli.js +9 -9
- package/lib/config.js +16 -16
- package/lib/handlers/appCallback.js +23 -24
- package/lib/handlers/codeAuth.js +17 -18
- package/lib/handlers/decodeJwt.js +3 -3
- package/lib/handlers/favicon.js +22 -25
- package/lib/handlers/getApp.js +20 -21
- package/lib/handlers/getApp2.js +22 -25
- package/lib/handlers/getUser.js +14 -17
- package/lib/handlers/index.js +3 -3
- package/lib/handlers/keepAlive.js +28 -31
- package/lib/handlers/keepAlive2.js +9 -12
- package/lib/handlers/logon.js +12 -15
- package/lib/handlers/logout.js +24 -28
- package/lib/handlers/proxyMapUri.js +6 -11
- package/lib/handlers/proxyOnResponse.js +6 -7
- package/lib/handlers/reactDev.js +22 -25
- package/lib/handlers/setCookies.js +52 -53
- package/lib/iService.js +106 -104
- package/lib/index.js +23 -21
- package/lib/parseDocker.js +3 -3
- package/lib/plugins/SASauth.js +30 -32
- package/lib/plugins/appCookie.js +36 -38
- package/lib/plugins/setContext.js +22 -25
- package/lib/plugins/setDefaultRoutes.js +61 -58
- package/lib/plugins/setupAuth.js +35 -38
- package/lib/plugins/setupUserRoutes.js +16 -16
- package/lib/plugins/token.js +9 -10
- package/lib/schemes/SASTokenScheme.js +24 -27
- package/package.json +85 -79
- package/public/data/Cluster_SDOH1.sas +181 -181
- package/public/data/Cluster_SDOH6.sas +179 -179
- package/public/data/NeuralNetwork_High_med.sas +2408 -2408
- package/public/data/NeuralNetwork_high_med1.sas +2408 -2408
- package/public/data/cars.csv +429 -429
- package/public/data/cmdList.txt +15 -15
- package/public/data/iris.csv +151 -151
- package/public/index.html +355 -360
- package/public/indexProxy.html +351 -351
- package/public/simplesubmit.html +233 -0
- package/server.js +362 -362
- package/src/config.js +90 -90
- package/src/handlers/appCallback.js +40 -40
- package/src/handlers/codeAuth.js +31 -31
- package/src/handlers/decodeJwt.js +10 -10
- package/src/handlers/favicon.js +23 -23
- package/src/handlers/getApp.js +52 -52
- package/src/handlers/getApp2.js +25 -25
- package/src/handlers/getUser.js +20 -20
- package/src/handlers/index.js +36 -36
- package/src/handlers/keepAlive.js +53 -53
- package/src/handlers/keepAlive2.js +12 -12
- package/src/handlers/logon.js +23 -23
- package/src/handlers/logout.js +42 -42
- package/src/handlers/proxyMapUri.js +25 -25
- package/src/handlers/proxyOnResponse.js +11 -11
- package/src/handlers/reactDev.js +29 -29
- package/src/handlers/setCookies.js +81 -79
- package/src/iService.js +346 -347
- package/src/index.js +251 -249
- package/src/parseDocker.js +32 -32
- package/src/plugins/SASauth.js +78 -78
- package/src/plugins/appCookie.js +51 -49
- package/src/plugins/setContext.js +33 -33
- package/src/plugins/setDefaultRoutes.js +256 -253
- package/src/plugins/setupAuth.js +49 -49
- package/src/plugins/setupUserRoutes.js +47 -47
- package/src/plugins/token.js +10 -10
- package/src/schemes/SASTokenScheme.js +43 -43
- package/src/visionIndex.html +23 -23
- package/start.sh +14 -14
- package/tls/viyatls.sh +2 -2
package/lib/plugins/appCookie.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function
|
|
4
|
-
function
|
|
3
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
4
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
5
5
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
6
6
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
7
7
|
var uuid = require('uuid');
|
|
8
8
|
var debug = require('debug')('cookie');
|
|
9
9
|
module.exports = /*#__PURE__*/function () {
|
|
10
|
-
var _appCookie = _asyncToGenerator(/*#__PURE__*/
|
|
10
|
+
var _appCookie = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(server, options) {
|
|
11
11
|
var cookieOptions;
|
|
12
|
-
return
|
|
13
|
-
while (1) switch (_context2.
|
|
12
|
+
return _regenerator().w(function (_context2) {
|
|
13
|
+
while (1) switch (_context2.n) {
|
|
14
14
|
case 0:
|
|
15
|
-
_context2.
|
|
15
|
+
_context2.n = 1;
|
|
16
16
|
return server.register(require('@hapi/cookie'));
|
|
17
|
-
case
|
|
17
|
+
case 1:
|
|
18
18
|
debug('in appCookie');
|
|
19
|
-
debug(options.redirectTo);
|
|
19
|
+
debug('redirecTo', options.redirectTo);
|
|
20
20
|
cookieOptions = {
|
|
21
21
|
cookie: {
|
|
22
22
|
name: 'cookie',
|
|
@@ -28,67 +28,65 @@ module.exports = /*#__PURE__*/function () {
|
|
|
28
28
|
appendNext: {
|
|
29
29
|
name: 'next'
|
|
30
30
|
},
|
|
31
|
-
|
|
32
|
-
var
|
|
31
|
+
validate: function () {
|
|
32
|
+
var _validate = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(req, session) {
|
|
33
33
|
var credentials, sid;
|
|
34
|
-
return
|
|
35
|
-
while (1) switch (_context.
|
|
34
|
+
return _regenerator().w(function (_context) {
|
|
35
|
+
while (1) switch (_context.n) {
|
|
36
36
|
case 0:
|
|
37
|
-
|
|
37
|
+
debugger;
|
|
38
|
+
debug('Cookie validate', "path - ".concat(req.path));
|
|
38
39
|
if (!(session == null)) {
|
|
39
|
-
_context.
|
|
40
|
+
_context.n = 1;
|
|
40
41
|
break;
|
|
41
42
|
}
|
|
42
43
|
console.log('session is null');
|
|
43
|
-
return _context.
|
|
44
|
-
|
|
44
|
+
return _context.a(2, {
|
|
45
|
+
isValid: false
|
|
45
46
|
});
|
|
46
|
-
case
|
|
47
|
+
case 1:
|
|
47
48
|
credentials = null;
|
|
48
49
|
if (Array.isArray(session) === true && session.length > 0) {
|
|
49
50
|
sid = session[0].sid;
|
|
50
51
|
} else {
|
|
51
52
|
sid = session.sid;
|
|
52
53
|
}
|
|
54
|
+
console.log('appcookie sid', sid);
|
|
53
55
|
if (!(sid != null)) {
|
|
54
|
-
_context.
|
|
56
|
+
_context.n = 3;
|
|
55
57
|
break;
|
|
56
58
|
}
|
|
57
|
-
_context.
|
|
59
|
+
_context.n = 2;
|
|
58
60
|
return req.server.app.cache.get(sid);
|
|
59
|
-
case
|
|
60
|
-
credentials = _context.
|
|
61
|
-
case
|
|
61
|
+
case 2:
|
|
62
|
+
credentials = _context.v;
|
|
63
|
+
case 3:
|
|
62
64
|
if (!(credentials == null)) {
|
|
63
|
-
_context.
|
|
65
|
+
_context.n = 4;
|
|
64
66
|
break;
|
|
65
67
|
}
|
|
66
|
-
return _context.
|
|
67
|
-
|
|
68
|
+
return _context.a(2, {
|
|
69
|
+
isValid: false
|
|
68
70
|
});
|
|
69
|
-
case
|
|
70
|
-
debug('Cookie
|
|
71
|
-
return _context.
|
|
72
|
-
|
|
71
|
+
case 4:
|
|
72
|
+
debug('Cookie validate', sid);
|
|
73
|
+
return _context.a(2, {
|
|
74
|
+
isValid: true,
|
|
73
75
|
credentials: credentials
|
|
74
76
|
});
|
|
75
|
-
case 14:
|
|
76
|
-
case "end":
|
|
77
|
-
return _context.stop();
|
|
78
77
|
}
|
|
79
78
|
}, _callee);
|
|
80
79
|
}));
|
|
81
|
-
function
|
|
82
|
-
return
|
|
80
|
+
function validate(_x3, _x4) {
|
|
81
|
+
return _validate.apply(this, arguments);
|
|
83
82
|
}
|
|
84
|
-
return
|
|
83
|
+
return validate;
|
|
85
84
|
}()
|
|
86
85
|
}; // console.log('cookie options', cookieOptions);
|
|
87
86
|
debug('Cookie Options', cookieOptions);
|
|
88
87
|
server.auth.strategy('session', 'cookie', cookieOptions);
|
|
89
|
-
case
|
|
90
|
-
|
|
91
|
-
return _context2.stop();
|
|
88
|
+
case 2:
|
|
89
|
+
return _context2.a(2);
|
|
92
90
|
}
|
|
93
91
|
}, _callee2);
|
|
94
92
|
}));
|
|
@@ -4,35 +4,35 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
function
|
|
8
|
-
function
|
|
7
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
8
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
9
9
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
10
10
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
11
|
-
/*
|
|
12
|
-
* ------------------------------------------------------------------------------------
|
|
13
|
-
* Copyright (c) SAS Institute Inc.
|
|
14
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
15
|
-
* you may not use this file except in compliance with the License.
|
|
16
|
-
* You may obtain a copy of the License at
|
|
17
|
-
*
|
|
18
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
-
*
|
|
20
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
21
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
22
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
23
|
-
* See the License for the specific language governing permissions and
|
|
24
|
-
* limitations under the License.
|
|
25
|
-
* ---------------------------------------------------------------------------------------
|
|
26
|
-
*
|
|
11
|
+
/*
|
|
12
|
+
* ------------------------------------------------------------------------------------
|
|
13
|
+
* Copyright (c) SAS Institute Inc.
|
|
14
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License.
|
|
16
|
+
* You may obtain a copy of the License at
|
|
17
|
+
*
|
|
18
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
*
|
|
20
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
21
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
22
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
23
|
+
* See the License for the specific language governing permissions and
|
|
24
|
+
* limitations under the License.
|
|
25
|
+
* ---------------------------------------------------------------------------------------
|
|
26
|
+
*
|
|
27
27
|
*/
|
|
28
28
|
function setContext(_x, _x2) {
|
|
29
29
|
return _setContext.apply(this, arguments);
|
|
30
30
|
}
|
|
31
31
|
function _setContext() {
|
|
32
|
-
_setContext = _asyncToGenerator(/*#__PURE__*/
|
|
32
|
+
_setContext = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(req, h) {
|
|
33
33
|
var credentials, context;
|
|
34
|
-
return
|
|
35
|
-
while (1) switch (_context.
|
|
34
|
+
return _regenerator().w(function (_context) {
|
|
35
|
+
while (1) switch (_context.n) {
|
|
36
36
|
case 0:
|
|
37
37
|
credentials = req.auth.credentials;
|
|
38
38
|
context = {
|
|
@@ -44,10 +44,7 @@ function _setContext() {
|
|
|
44
44
|
token: credentials != null ? "bearer ".concat(credentials.token) : null,
|
|
45
45
|
host: process.env.VIYA_SERVER
|
|
46
46
|
};
|
|
47
|
-
return _context.
|
|
48
|
-
case 3:
|
|
49
|
-
case "end":
|
|
50
|
-
return _context.stop();
|
|
47
|
+
return _context.a(2, context);
|
|
51
48
|
}
|
|
52
49
|
}, _callee);
|
|
53
50
|
}));
|
|
@@ -7,24 +7,25 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
-
function
|
|
10
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
11
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
11
12
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
12
|
-
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } /*
|
|
13
|
-
* ------------------------------------------------------------------------------------
|
|
14
|
-
* * Copyright (c) SAS Institute Inc.
|
|
15
|
-
* * Licensed under the Apache License, Version 2.0 (the "License");
|
|
16
|
-
* * you may not use this file except in compliance with the License.
|
|
17
|
-
* * You may obtain a copy of the License at
|
|
18
|
-
* *
|
|
19
|
-
* * http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
-
* *
|
|
21
|
-
* * Unless required by applicable law or agreed to in writing, software
|
|
22
|
-
* * distributed under the License is distributed on an "AS IS" BASIS,
|
|
23
|
-
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24
|
-
* * See the License for the specific language governing permissions and
|
|
25
|
-
* limitations under the License.
|
|
26
|
-
* ----------------------------------------------------------------------------------------
|
|
27
|
-
*
|
|
13
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } /*
|
|
14
|
+
* ------------------------------------------------------------------------------------
|
|
15
|
+
* * Copyright (c) SAS Institute Inc.
|
|
16
|
+
* * Licensed under the Apache License, Version 2.0 (the "License");
|
|
17
|
+
* * you may not use this file except in compliance with the License.
|
|
18
|
+
* * You may obtain a copy of the License at
|
|
19
|
+
* *
|
|
20
|
+
* * http://www.apache.org/licenses/LICENSE-2.0
|
|
21
|
+
* *
|
|
22
|
+
* * Unless required by applicable law or agreed to in writing, software
|
|
23
|
+
* * distributed under the License is distributed on an "AS IS" BASIS,
|
|
24
|
+
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
25
|
+
* * See the License for the specific language governing permissions and
|
|
26
|
+
* limitations under the License.
|
|
27
|
+
* ----------------------------------------------------------------------------------------
|
|
28
|
+
*
|
|
28
29
|
*/
|
|
29
30
|
var debug = require("debug")("routes");
|
|
30
31
|
module.exports = function setDefaultRoutes(server, options) {
|
|
@@ -65,18 +66,15 @@ module.exports = function setDefaultRoutes(server, options) {
|
|
|
65
66
|
}
|
|
66
67
|
},
|
|
67
68
|
handler: function () {
|
|
68
|
-
var _handler = _asyncToGenerator(/*#__PURE__*/
|
|
69
|
-
return
|
|
70
|
-
while (1) switch (_context.
|
|
69
|
+
var _handler = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(req, h) {
|
|
70
|
+
return _regenerator().w(function (_context) {
|
|
71
|
+
while (1) switch (_context.n) {
|
|
71
72
|
case 0:
|
|
72
73
|
debug('logonhandler', req.auth.credentials);
|
|
73
|
-
_context.
|
|
74
|
+
_context.n = 1;
|
|
74
75
|
return (0, _handlers.logon)(req, h);
|
|
75
|
-
case
|
|
76
|
-
return _context.
|
|
77
|
-
case 4:
|
|
78
|
-
case "end":
|
|
79
|
-
return _context.stop();
|
|
76
|
+
case 1:
|
|
77
|
+
return _context.a(2, _context.v);
|
|
80
78
|
}
|
|
81
79
|
}, _callee);
|
|
82
80
|
}));
|
|
@@ -99,14 +97,11 @@ module.exports = function setDefaultRoutes(server, options) {
|
|
|
99
97
|
options: {
|
|
100
98
|
auth: authDefault,
|
|
101
99
|
handler: function () {
|
|
102
|
-
var _handler2 = _asyncToGenerator(/*#__PURE__*/
|
|
103
|
-
return
|
|
104
|
-
while (1) switch (_context2.
|
|
100
|
+
var _handler2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(req, h) {
|
|
101
|
+
return _regenerator().w(function (_context2) {
|
|
102
|
+
while (1) switch (_context2.n) {
|
|
105
103
|
case 0:
|
|
106
|
-
return _context2.
|
|
107
|
-
case 1:
|
|
108
|
-
case "end":
|
|
109
|
-
return _context2.stop();
|
|
104
|
+
return _context2.a(2, h.redirect("".concat(appName, "/documentation")));
|
|
110
105
|
}
|
|
111
106
|
}, _callee2);
|
|
112
107
|
}));
|
|
@@ -151,10 +146,10 @@ module.exports = function setDefaultRoutes(server, options) {
|
|
|
151
146
|
options: {
|
|
152
147
|
auth: /*authDefault*/false,
|
|
153
148
|
handler: function () {
|
|
154
|
-
var _handler3 = _asyncToGenerator(/*#__PURE__*/
|
|
149
|
+
var _handler3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(req, h) {
|
|
155
150
|
var allAppEnv, uappenv, s;
|
|
156
|
-
return
|
|
157
|
-
while (1) switch (_context3.
|
|
151
|
+
return _regenerator().w(function (_context3) {
|
|
152
|
+
while (1) switch (_context3.n) {
|
|
158
153
|
case 0:
|
|
159
154
|
allAppEnv = options.allAppEnv;
|
|
160
155
|
if (options.userInfo != null) {
|
|
@@ -169,10 +164,7 @@ module.exports = function setDefaultRoutes(server, options) {
|
|
|
169
164
|
console.log(s);
|
|
170
165
|
}
|
|
171
166
|
debug(s);
|
|
172
|
-
return _context3.
|
|
173
|
-
case 7:
|
|
174
|
-
case "end":
|
|
175
|
-
return _context3.stop();
|
|
167
|
+
return _context3.a(2, s);
|
|
176
168
|
}
|
|
177
169
|
}, _callee3);
|
|
178
170
|
}));
|
|
@@ -188,10 +180,10 @@ module.exports = function setDefaultRoutes(server, options) {
|
|
|
188
180
|
options: {
|
|
189
181
|
auth: /*authDefault*/false,
|
|
190
182
|
handler: function () {
|
|
191
|
-
var _handler4 = _asyncToGenerator(/*#__PURE__*/
|
|
183
|
+
var _handler4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(req, h) {
|
|
192
184
|
var allAppEnv, uappenv, s;
|
|
193
|
-
return
|
|
194
|
-
while (1) switch (_context4.
|
|
185
|
+
return _regenerator().w(function (_context4) {
|
|
186
|
+
while (1) switch (_context4.n) {
|
|
195
187
|
case 0:
|
|
196
188
|
allAppEnv = options.allAppEnv;
|
|
197
189
|
if (options.userInfo != null) {
|
|
@@ -206,10 +198,7 @@ module.exports = function setDefaultRoutes(server, options) {
|
|
|
206
198
|
debug(options.allAppEnv);
|
|
207
199
|
}
|
|
208
200
|
debug(s);
|
|
209
|
-
return _context4.
|
|
210
|
-
case 7:
|
|
211
|
-
case "end":
|
|
212
|
-
return _context4.stop();
|
|
201
|
+
return _context4.a(2, s);
|
|
213
202
|
}
|
|
214
203
|
}, _callee4);
|
|
215
204
|
}));
|
|
@@ -220,23 +209,37 @@ module.exports = function setDefaultRoutes(server, options) {
|
|
|
220
209
|
}()
|
|
221
210
|
}
|
|
222
211
|
},
|
|
223
|
-
/*
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
212
|
+
/*
|
|
213
|
+
{
|
|
214
|
+
method: ["GET"],
|
|
215
|
+
path: `${appName}/{param*}`,
|
|
216
|
+
options: {
|
|
217
|
+
auth: authDefault,
|
|
218
|
+
handler: getApp2,
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
*/
|
|
233
222
|
|
|
234
223
|
{
|
|
235
224
|
method: ["GET"],
|
|
236
225
|
path: "/{param*}",
|
|
237
226
|
options: {
|
|
238
227
|
auth: authDefault,
|
|
239
|
-
handler:
|
|
228
|
+
handler: function () {
|
|
229
|
+
var _handler5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(req, h) {
|
|
230
|
+
return _regenerator().w(function (_context5) {
|
|
231
|
+
while (1) switch (_context5.n) {
|
|
232
|
+
case 0:
|
|
233
|
+
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>in param');
|
|
234
|
+
return _context5.a(2, (0, _handlers.getApp2)(req, h));
|
|
235
|
+
}
|
|
236
|
+
}, _callee5);
|
|
237
|
+
}));
|
|
238
|
+
function handler(_x9, _x0) {
|
|
239
|
+
return _handler5.apply(this, arguments);
|
|
240
|
+
}
|
|
241
|
+
return handler;
|
|
242
|
+
}()
|
|
240
243
|
}
|
|
241
244
|
}, {
|
|
242
245
|
method: ["GET"],
|