@sassoftware/viya-serverjs 0.6.1-6 → 0.6.2
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/.env +5 -5
- package/lib/index.js +1 -1
- package/lib/plugins/setContext.js +2 -2
- package/package.json +3 -2
- package/src/iService.js +1 -0
- package/src/index.js +1 -1
- package/src/plugins/setContext.js +1 -1
package/.env
CHANGED
|
@@ -3,16 +3,16 @@ APPENTRY=index.html
|
|
|
3
3
|
APPLOC=./public
|
|
4
4
|
|
|
5
5
|
APPENV_USEPROXY=YES
|
|
6
|
-
|
|
6
|
+
PORT=8080
|
|
7
7
|
APPNAME=viyaapp
|
|
8
8
|
AUTHFLOW=server
|
|
9
9
|
CLIENTID=viyaapp
|
|
10
10
|
CLIENTSECRET=jellico
|
|
11
11
|
REDIRECT=
|
|
12
|
-
USELOGON=FALSE
|
|
13
|
-
USETOKEN=FALSE
|
|
14
|
-
HTTPS=
|
|
12
|
+
# USELOGON=FALSE
|
|
13
|
+
# USETOKEN=FALSE
|
|
14
|
+
HTTPS=true
|
|
15
15
|
|
|
16
|
-
VIYACERT=c:\Users\kumar\viyaCert
|
|
16
|
+
VIYACERT=c:\Users\kumar\viyaCert\xf1
|
|
17
17
|
NODE_TLS_REJECT_UNAUTHORIZED=0
|
|
18
18
|
|
package/lib/index.js
CHANGED
|
@@ -149,7 +149,7 @@ function getAllEnv(userInfo) {
|
|
|
149
149
|
l.redirect = redirect;
|
|
150
150
|
}
|
|
151
151
|
if (authflow === "server" && keepAlive === "YES") {
|
|
152
|
-
var protocol = process.env.HTTPS === "
|
|
152
|
+
var protocol = process.env.HTTPS.toUpperCase() === "TRUE" ? "https://" : "http://";
|
|
153
153
|
l.keepAlive = "".concat(protocol).concat(process.env.APPHOST, ":").concat(process.env.APPPORT, "/").concat(appName, "/keepAlive");
|
|
154
154
|
l.keepAlive = l.keepAlive.replace(/0.0.0.0/, "localhost");
|
|
155
155
|
}
|
|
@@ -65,9 +65,9 @@ function _setContext() {
|
|
|
65
65
|
query: req.query,
|
|
66
66
|
payload: req.payload,
|
|
67
67
|
queryOrig: fcredentials != null ? fcredentials.query : {},
|
|
68
|
-
credentials: _objectSpread(_objectSpread({}, fcredentials), {}, {
|
|
68
|
+
credentials: fcredentials != null ? _objectSpread(_objectSpread({}, fcredentials), {}, {
|
|
69
69
|
host: process.env.VIYA_SERVER
|
|
70
|
-
}),
|
|
70
|
+
}) : null,
|
|
71
71
|
credType: credentials != null ? 'auth' : 'cached',
|
|
72
72
|
host: process.env.VIYA_SERVER
|
|
73
73
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sassoftware/viya-serverjs",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Easy to use app server for SAS Viya applications",
|
|
5
5
|
"author": "Deva Kumaraswamy <deva.kumar@sas.com>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"unpkg": "./lib/index.js",
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "rimraf lib && babel src --out-dir lib",
|
|
32
|
-
"test": "
|
|
32
|
+
"test": "node cli --env=./.env --docker=./Dockerfile",
|
|
33
33
|
"server": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 node server.js --env=./.env --docker=./Dockerfile",
|
|
34
34
|
"proxy": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 node cli --env=./.env.proxy --docker=./Dockerfile",
|
|
35
35
|
"pub": "npm publish --tag dev --access public",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"jwt-decode": "^4.0.0",
|
|
57
57
|
"node-cache-promise": "^1.0.2",
|
|
58
58
|
"only": "0.0.2",
|
|
59
|
+
"open": "^11.0.0",
|
|
59
60
|
"qs": "^6.14.1",
|
|
60
61
|
"regenerator-runtime": "^0.14.1",
|
|
61
62
|
"request-debug": "^0.2.0",
|
package/src/iService.js
CHANGED
|
@@ -211,6 +211,7 @@ function iService (userRouteTable, useDefault, asset, allAppEnv, serverMode, use
|
|
|
211
211
|
process.env.APPSERVER = `${hh}/${process.env.APPNAME}`;
|
|
212
212
|
process.env.HEALTH = 'true';
|
|
213
213
|
console.log('====================================================================================');
|
|
214
|
+
|
|
214
215
|
};
|
|
215
216
|
|
|
216
217
|
process.on('unhandledRejection', (err) => {
|
package/src/index.js
CHANGED
|
@@ -190,7 +190,7 @@ function getAllEnv(userInfo) {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
if (authflow === "server" && keepAlive === "YES") {
|
|
193
|
-
let protocol = process.env.HTTPS === "
|
|
193
|
+
let protocol = process.env.HTTPS.toUpperCase() === "TRUE" ? "https://" : "http://";
|
|
194
194
|
l.keepAlive = `${protocol}${process.env.APPHOST}:${process.env.APPPORT}/${appName}/keepAlive`;
|
|
195
195
|
l.keepAlive = l.keepAlive.replace(/0.0.0.0/, "localhost");
|
|
196
196
|
}
|
|
@@ -37,7 +37,7 @@ async function setContext(req, h) {
|
|
|
37
37
|
query: req.query,
|
|
38
38
|
payload: req.payload,
|
|
39
39
|
queryOrig: (fcredentials != null) ? fcredentials.query : {},
|
|
40
|
-
credentials: {...fcredentials, host: process.env.VIYA_SERVER},
|
|
40
|
+
credentials: (fcredentials != null) ? {...fcredentials, host: process.env.VIYA_SERVER} : null,
|
|
41
41
|
credType: (credentials != null) ? 'auth' : 'cached',
|
|
42
42
|
host: process.env.VIYA_SERVER
|
|
43
43
|
};
|