Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit baab7c0

Browse files
author
wiki
committed
production patches
1 parent 8028713 commit baab7c0

File tree

6 files changed

+80
-9
lines changed

6 files changed

+80
-9
lines changed

Diff for: actions/docusign.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ exports.generateDocusignViewURL = {
310310
blockedConnectionTypes: [],
311311
outputExample: {},
312312
version: 'v2',
313-
transaction: 'read',
313+
transaction: 'write',
314314
cacheEnabled : false,
315315
databases: ["informixoltp", "common_oltp"],
316316
inputs: {

Diff for: actions/user.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ function getUserIdentityByAuth0Id(api, connection, next) {
361361
function (cb) {
362362
try {
363363
var splits = auth0id.split('|');
364-
if (splits[0] === 'ad') {
364+
if (splits[0] === 'ad' || splits[0] === 'auth0') {
365365
cb(null, [{ user_id: Number(splits[1]) }]);
366366
} else {
367367
api.helper.getProviderId(splits[0], function (err, provider) {

Diff for: config/logger.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports.default = {
1212
logger.transports.push(function (api, winston) {
1313
return new (winston.transports.Console)({
1414
colorize: true,
15-
level: 'debug',
15+
level: 'info',
1616
timestamp: api.utils.sqlDateTime,
1717
json: false
1818
});
@@ -31,7 +31,7 @@ exports.default = {
3131
logger.transports.push(function (api, winston) {
3232
return new (winston.transports.File)({
3333
filename: api.config.general.paths.log[0] + '/actionhero-worker.log',
34-
level: 'debug',
34+
level: 'info',
3535
colorize: true,
3636
timestamp: api.utils.sqlDateTime,
3737
json: false

Diff for: initializers/dataAccess.js

+13-4
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,19 @@ function parameterizeQuery(query, params, callback) {
113113
});
114114
}
115115

116+
function isSafeToUseJavaBridge(sql) {
117+
var lowerSQL = sql.toLowerCase();
118+
return lowerSQL.indexOf("insert") === -1 && lowerSQL.indexOf("update") === -1 && lowerSQL.indexOf("delete") === -1;
119+
}
120+
116121
function executePreparedStatement(api, sql, parameters, connection, next, db) {
117122
async.waterfall([
118123
function (cb) {
119124
parameterizeQuery(sql, parameters, cb);
120125
}, function (parametrizedQuery, cb) {
121126
sql = parametrizedQuery;
122127

123-
if (api.helper.readTransaction) {
128+
if (isSafeToUseJavaBridge(sql) && api.helper.readTransaction) {
124129
api.log("Calling Java Bridge", "debug");
125130

126131
api.log(sql, "debug");
@@ -304,8 +309,13 @@ exports.dataAccess = function (api, next) {
304309
return;
305310
}
306311

307-
if (!api.helper.readTransaction) {
312+
sql = queries[queryName].sql;
313+
314+
if (!isSafeToUseJavaBridge(sql) || !api.helper.readTransaction) {
308315
connection = connectionMap[queries[queryName].db];
316+
api.log("######### MD #########", "info");
317+
api.log(JSON.stringify(connectionMap), "info");
318+
api.log(queryName, "info");
309319
error = helper.checkObject(connection, "connection");
310320
}
311321

@@ -314,7 +324,6 @@ exports.dataAccess = function (api, next) {
314324
return;
315325
}
316326

317-
sql = queries[queryName].sql;
318327
if (!sql) {
319328
api.log('Unregistered query ' + queryName + ' is asked for.', 'error');
320329
next('The query for name ' + queryName + ' is not registered');
@@ -354,7 +363,7 @@ exports.dataAccess = function (api, next) {
354363
return;
355364
}
356365

357-
if (!api.helper.readTransaction) {
366+
if (!isSafeToUseJavaBridge(sql) || !api.helper.readTransaction) {
358367
connection = connectionMap[dbName];
359368
error = helper.checkObject(connection, "connection");
360369
}

Diff for: initializers/helper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ helper.getProviderId = function (provider, callback) {
12191219
if (provider.startsWith("salesforce")) {
12201220
providerId = helper.socialProviders.salesforce;
12211221
}
1222-
if (provider.startsWith("ad")) {
1222+
if (provider.startsWith("ad") || provider.startsWith("auth0")) {
12231223
providerId = helper.socialProviders.ad;
12241224
}
12251225
if (providerId) {

Diff for: package.json.org

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"author": "TCASSEMBLER",
3+
"name": "tcapi",
4+
"description": "",
5+
"version": "0.0.1",
6+
"homepage": "",
7+
"repository": {
8+
"type": "",
9+
"url": ""
10+
},
11+
"keywords": "",
12+
"engines": {
13+
"node": ">=0.8.0"
14+
},
15+
"dependencies": {
16+
"actionhero": "8.0.x",
17+
"xml2js": "0.2.x",
18+
"async": "0.2.x",
19+
"underscore": "1.5.x",
20+
"datejs": "0.0.x",
21+
"string": "1.6.x",
22+
"ldapjs": "0.7.x",
23+
"nodemailer": "0.5.x",
24+
"email-templates": "0.1.x",
25+
"bcrypt": "0.7.x",
26+
"bigdecimal": "0.6.x",
27+
"bignum": "0.6.x",
28+
"java": "0.3.x",
29+
"informix-wrapper": "git://github.com/cloudspokes/informix-wrapper.git#469300dbd4913c5d467b6957bc4610d95c3923ed",
30+
"forums-wrapper": "git://github.com/cloudspokes/forums-wrapper.git#12b57be495c2e10431173522bc9eff60e0575959",
31+
"asn1": "*",
32+
"crypto": "0.0.x",
33+
"jsonwebtoken": "0.4.x",
34+
"request": "~2.33.0",
35+
"soap": "~0.3.2",
36+
"moment-timezone": "0.0.x",
37+
"moment": "~2.5.1",
38+
"mime": "~1.2.11",
39+
"xtend": "2.1.x",
40+
"validator": "~3.5.0",
41+
"adm-zip": "0.4.x",
42+
"mkdirp": "0.3.x",
43+
"archiver": "~0.6.1",
44+
"redis": "0.10.x",
45+
"temp": "0.7.0",
46+
"ssha": "*"
47+
},
48+
"devDependencies": {
49+
"supertest": "0.8.x",
50+
"mocha": "1.x",
51+
"chai": "1.8.x",
52+
"fakeredis": "0.1.x",
53+
"should": ">= 3.0.0"
54+
},
55+
"scripts": {
56+
"start": "node ./node_modules/.bin/actionhero start &",
57+
"test": "node_modules/.bin/mocha --recursive ./test",
58+
"startCluster": "node ./node_modules/.bin/actionhero startCluster",
59+
"actionHero": "node ./node_modules/.bin/actionhero",
60+
"help": "node ./node_modules/.bin/actionhero help"
61+
}
62+
}

0 commit comments

Comments
 (0)