Last open WIP commit to see ldap action.
This commit is contained in:
parent
3f929f9607
commit
4c72e7a5f8
|
@ -16,6 +16,7 @@ var fs = require('fs');
|
|||
//tcrud.setup.pluginLoad(new MyPlugin());
|
||||
require('./lib/pg-moviedb').load(tcrud);
|
||||
require('./lib/pg-pagila').load(tcrud);
|
||||
//require('./lib/ldapjs-example').load(tcrud);
|
||||
|
||||
// PHASE_2: enable plugins
|
||||
tcrud.setup.pluginEnableAll();
|
||||
|
@ -26,8 +27,10 @@ tcrud.config.getRootTEntity().tmeta.tplugin.formatXML.tslug = 'xml_is_free';
|
|||
tcrud.config.getRootTEntity().tmeta.tplugin.formatCSV.tslug = 'csv4all';
|
||||
var tPostgresDB = tcrud.config.createTEntityNode(tcrud.config.getRootTEntity(),'pg');
|
||||
var tMongoose = tcrud.config.createTEntityNode(tcrud.config.getRootTEntity(),'mongoose');
|
||||
var tLdap = tcrud.config.createTEntityNode(tcrud.config.getRootTEntity(),'ldap');
|
||||
require('./lib/pg-moviedb').setup(tcrud,tPostgresDB);
|
||||
require('./lib/pg-pagila').setup(tcrud,tPostgresDB);
|
||||
require('./lib/ldapjs-example').setup(tcrud,tLdap);
|
||||
//require('./lib/mongoose-blog').setup(tcrud,tMongoose);
|
||||
|
||||
// PHASE_4: finalize config
|
||||
|
|
|
@ -1,25 +1,35 @@
|
|||
var ldap = require('ldapjs');
|
||||
|
||||
module.exports = {
|
||||
load: load,
|
||||
setup: setup
|
||||
};
|
||||
|
||||
function setup(tcrud,tcrudModel) {
|
||||
|
||||
function load(tcrud) {
|
||||
var client = ldap.createClient({
|
||||
url: 'ldap://127.0.0.1:389'
|
||||
});
|
||||
client.bind('cn=admin,dc=test,dc=net', 'test', function(err) {
|
||||
if (err) {
|
||||
console.log('bind eror: '+err);
|
||||
} else {
|
||||
console.log('bind oke');
|
||||
}
|
||||
});
|
||||
|
||||
// Create backend with id and uri
|
||||
tcrud.plugin.backend.ldapjs.registrate('ldapjs/main',client);
|
||||
|
||||
tcrud.backend.ldapjs.registrate('ldapjs/main',client);
|
||||
}
|
||||
|
||||
function setup(tcrud,tcrudModel) {
|
||||
// Create tcrud models
|
||||
var tc = tcrud.config;
|
||||
var t = tc.createTEntityNode(tcrudModel,'ldapjs');
|
||||
t.tmeta.tmodel.tbackend = 'ldapjs/main';
|
||||
|
||||
// Define model and columns
|
||||
var tUser = tc.createTEntity(t,'cn=foo, o=example','cn');
|
||||
var tUser = tc.createTEntity(t,'test_users','cn');
|
||||
|
||||
var tUserId = tc.createTField(tUser,'uid');
|
||||
var tUserName = tc.createTField(tUser,'sn');
|
||||
var tUserEmail = tc.createTField(tUser,'email');
|
||||
|
|
384
example/package-lock.json
generated
384
example/package-lock.json
generated
|
@ -14,12 +14,22 @@
|
|||
"resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.2.1.tgz",
|
||||
"integrity": "sha1-vgiVmQl7dKXJxKhKDNvNtivYeu8="
|
||||
},
|
||||
"asn1": {
|
||||
"version": "0.2.3",
|
||||
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz",
|
||||
"integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y="
|
||||
},
|
||||
"assert-plus": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
|
||||
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
|
||||
},
|
||||
"async": {
|
||||
"version": "2.1.4",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-2.1.4.tgz",
|
||||
"integrity": "sha1-LSFgx3iAMuTdbL4lAvH5osj2zeQ=",
|
||||
"requires": {
|
||||
"lodash": "4.17.4"
|
||||
"lodash": "^4.14.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"lodash": {
|
||||
|
@ -34,10 +44,24 @@
|
|||
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
|
||||
"integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
|
||||
"requires": {
|
||||
"core-js": "2.5.2",
|
||||
"regenerator-runtime": "0.11.1"
|
||||
"core-js": "^2.4.0",
|
||||
"regenerator-runtime": "^0.11.0"
|
||||
}
|
||||
},
|
||||
"backoff": {
|
||||
"version": "2.5.0",
|
||||
"resolved": "https://registry.npmjs.org/backoff/-/backoff-2.5.0.tgz",
|
||||
"integrity": "sha1-9hbtqdPktmuMp/ynn2lXIsX44m8=",
|
||||
"requires": {
|
||||
"precond": "0.2"
|
||||
}
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
||||
"optional": true
|
||||
},
|
||||
"big-number": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/big-number/-/big-number-0.3.1.tgz",
|
||||
|
@ -48,7 +72,7 @@
|
|||
"resolved": "https://registry.npmjs.org/bl/-/bl-1.2.1.tgz",
|
||||
"integrity": "sha1-ysMo977kVzDUBLaSID/LWQ4XLV4=",
|
||||
"requires": {
|
||||
"readable-stream": "2.2.7"
|
||||
"readable-stream": "^2.0.5"
|
||||
}
|
||||
},
|
||||
"bluebird": {
|
||||
|
@ -56,6 +80,16 @@
|
|||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz",
|
||||
"integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw="
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"bson": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/bson/-/bson-1.0.4.tgz",
|
||||
|
@ -71,13 +105,24 @@
|
|||
"resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-1.0.1.tgz",
|
||||
"integrity": "sha1-Iqk2kB4wKa/NdUfrRIfOtpejvwg="
|
||||
},
|
||||
"bunyan": {
|
||||
"version": "1.8.12",
|
||||
"resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.12.tgz",
|
||||
"integrity": "sha1-8VDw9nSKvdcq6uhPBEA74u8RN5c=",
|
||||
"requires": {
|
||||
"dtrace-provider": "~0.8",
|
||||
"moment": "^2.10.6",
|
||||
"mv": "~2",
|
||||
"safe-json-stringify": "~1"
|
||||
}
|
||||
},
|
||||
"cardinal": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cardinal/-/cardinal-1.0.0.tgz",
|
||||
"integrity": "sha1-UOIcGwqjdyn5N33vGWtanOyTLuk=",
|
||||
"requires": {
|
||||
"ansicolors": "0.2.1",
|
||||
"redeyed": "1.0.1"
|
||||
"ansicolors": "~0.2.1",
|
||||
"redeyed": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
|
@ -85,9 +130,9 @@
|
|||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz",
|
||||
"integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=",
|
||||
"requires": {
|
||||
"ansi-styles": "1.0.0",
|
||||
"has-color": "0.1.7",
|
||||
"strip-ansi": "0.1.1"
|
||||
"ansi-styles": "~1.0.0",
|
||||
"has-color": "~0.1.0",
|
||||
"strip-ansi": "~0.1.0"
|
||||
}
|
||||
},
|
||||
"colors": {
|
||||
|
@ -95,6 +140,12 @@
|
|||
"resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
|
||||
"integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs="
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||
"optional": true
|
||||
},
|
||||
"cookie": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
|
||||
|
@ -129,6 +180,14 @@
|
|||
"resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz",
|
||||
"integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI="
|
||||
},
|
||||
"dashdash": {
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
|
||||
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
|
||||
"requires": {
|
||||
"assert-plus": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"debug": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
|
||||
|
@ -142,6 +201,15 @@
|
|||
"resolved": "https://registry.npmjs.org/denque/-/denque-1.2.2.tgz",
|
||||
"integrity": "sha512-x92Ql74lcTbGylXILO9Xf9S0cMpEPP04zVp2bB9e2C7G/n/Q1SgLl78RaSYEPSgpDX9uLgQXCEGAS5BI5dP3yA=="
|
||||
},
|
||||
"dtrace-provider": {
|
||||
"version": "0.8.8",
|
||||
"resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.8.tgz",
|
||||
"integrity": "sha512-b7Z7cNtHPhH9EJhNNbbeqTcXB8LGFFZhq1PGgEvpeHlzd36bhbdTWoE/Ba/YguqpBSlAPKnARWhVlhunCMwfxg==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"nan": "^2.14.0"
|
||||
}
|
||||
},
|
||||
"es6-promise": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.2.1.tgz",
|
||||
|
@ -162,10 +230,15 @@
|
|||
"resolved": "https://registry.npmjs.org/express-winston/-/express-winston-2.4.0.tgz",
|
||||
"integrity": "sha1-J6ts2TBT4t/cNbzuoUoHfcfVLkk=",
|
||||
"requires": {
|
||||
"chalk": "0.4.0",
|
||||
"lodash": "4.11.2"
|
||||
"chalk": "~0.4.0",
|
||||
"lodash": "~4.11.1"
|
||||
}
|
||||
},
|
||||
"extsprintf": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.2.0.tgz",
|
||||
"integrity": "sha1-WtlGwi9bMrp/jNdCZxHG6KP8JSk="
|
||||
},
|
||||
"eyes": {
|
||||
"version": "0.1.8",
|
||||
"resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz",
|
||||
|
@ -186,6 +259,19 @@
|
|||
"resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.2.0.tgz",
|
||||
"integrity": "sha512-JjcXDHT84icN/kFaF5+rNd1trZsgJFVqTSgM9dv6eayxSIQKMq0ilBJ+5pvf0SgimacMlZEsav4oL+4dUE4E2g=="
|
||||
},
|
||||
"glob": {
|
||||
"version": "6.0.4",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
|
||||
"integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "2 || 3",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"has-color": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz",
|
||||
|
@ -201,6 +287,16 @@
|
|||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
|
||||
"integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ=="
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
||||
|
@ -226,6 +322,38 @@
|
|||
"resolved": "https://registry.npmjs.org/kareem/-/kareem-1.5.0.tgz",
|
||||
"integrity": "sha1-4+QQHZ3P3imXadr0tNtk2JXRdEg="
|
||||
},
|
||||
"ldap-filter": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/ldap-filter/-/ldap-filter-0.2.2.tgz",
|
||||
"integrity": "sha1-8rhCvguG2jNSeYUFsx68rlkNd9A=",
|
||||
"requires": {
|
||||
"assert-plus": "0.1.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"assert-plus": {
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz",
|
||||
"integrity": "sha1-7nQAlBMALYTOxyGcasgRgS5yMWA="
|
||||
}
|
||||
}
|
||||
},
|
||||
"ldapjs": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/ldapjs/-/ldapjs-1.0.2.tgz",
|
||||
"integrity": "sha1-VE/3Ayt7g8aPBwEyjZKXqmlDQPk=",
|
||||
"requires": {
|
||||
"asn1": "0.2.3",
|
||||
"assert-plus": "^1.0.0",
|
||||
"backoff": "^2.5.0",
|
||||
"bunyan": "^1.8.3",
|
||||
"dashdash": "^1.14.0",
|
||||
"dtrace-provider": "~0.8",
|
||||
"ldap-filter": "0.2.2",
|
||||
"once": "^1.4.0",
|
||||
"vasync": "^1.6.4",
|
||||
"verror": "^1.8.1"
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.11.2",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.11.2.tgz",
|
||||
|
@ -246,10 +374,40 @@
|
|||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz",
|
||||
"integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==",
|
||||
"requires": {
|
||||
"pseudomap": "1.0.2",
|
||||
"yallist": "2.1.2"
|
||||
"pseudomap": "^1.0.2",
|
||||
"yallist": "^2.1.2"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
||||
"optional": true
|
||||
},
|
||||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
},
|
||||
"moment": {
|
||||
"version": "2.24.0",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
|
||||
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==",
|
||||
"optional": true
|
||||
},
|
||||
"mongodb": {
|
||||
"version": "2.2.33",
|
||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-2.2.33.tgz",
|
||||
|
@ -265,8 +423,8 @@
|
|||
"resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-2.1.17.tgz",
|
||||
"integrity": "sha1-pBizN6FKFJkPtRC5I97mqBMXPfg=",
|
||||
"requires": {
|
||||
"bson": "1.0.4",
|
||||
"require_optional": "1.0.1"
|
||||
"bson": "~1.0.4",
|
||||
"require_optional": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"mongoose": {
|
||||
|
@ -275,7 +433,7 @@
|
|||
"integrity": "sha512-H+loD0D8UCwGmbOzWV7rZAf6/efRr9CPGB1Bess/IIjiWvpRQNo4zH4UHkueKoEbMWdnSYenjdEL8A0Q8p7JXg==",
|
||||
"requires": {
|
||||
"async": "2.1.4",
|
||||
"bson": "1.0.4",
|
||||
"bson": "~1.0.4",
|
||||
"hooks-fixed": "2.0.2",
|
||||
"kareem": "1.5.0",
|
||||
"lodash.get": "4.4.2",
|
||||
|
@ -335,9 +493,9 @@
|
|||
"resolved": "https://registry.npmjs.org/mssql/-/mssql-4.1.0.tgz",
|
||||
"integrity": "sha512-ekht0eILEV0P1CbpkwpAxhgO+/5goYizUJrt7pgDm3fP6lGKe0+8V9jhTvQZ8DPHkycSd0wYGUoz/YA7VN7kQQ==",
|
||||
"requires": {
|
||||
"debug": "2.6.9",
|
||||
"generic-pool": "3.2.0",
|
||||
"tedious": "2.1.5"
|
||||
"debug": "^2.6.3",
|
||||
"generic-pool": "^3.1.7",
|
||||
"tedious": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
|
@ -355,23 +513,34 @@
|
|||
"resolved": "https://registry.npmjs.org/muri/-/muri-1.3.0.tgz",
|
||||
"integrity": "sha512-FiaFwKl864onHFFUV/a2szAl7X0fxVlSKNdhTf+BM8i8goEgYut8u5P9MqQqIYwvaMxjzVESsoEm/2kfkFH1rg=="
|
||||
},
|
||||
"mv": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz",
|
||||
"integrity": "sha1-rmzg1vbV4KT32JN5jQPB6pVZtqI=",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"mkdirp": "~0.5.1",
|
||||
"ncp": "~2.0.0",
|
||||
"rimraf": "~2.4.0"
|
||||
}
|
||||
},
|
||||
"mysql2": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/mysql2/-/mysql2-1.5.1.tgz",
|
||||
"integrity": "sha1-JBHW+5WK+GsjBLelO8VLJud+aCs=",
|
||||
"requires": {
|
||||
"cardinal": "1.0.0",
|
||||
"denque": "1.2.2",
|
||||
"generate-function": "2.0.0",
|
||||
"iconv-lite": "0.4.19",
|
||||
"long": "3.2.0",
|
||||
"lru-cache": "4.1.1",
|
||||
"denque": "^1.1.1",
|
||||
"generate-function": "^2.0.0",
|
||||
"iconv-lite": "^0.4.18",
|
||||
"long": "^3.2.0",
|
||||
"lru-cache": "^4.1.1",
|
||||
"named-placeholders": "1.1.1",
|
||||
"object-assign": "4.1.1",
|
||||
"object-assign": "^4.1.1",
|
||||
"readable-stream": "2.3.2",
|
||||
"safe-buffer": "5.1.1",
|
||||
"safe-buffer": "^5.0.1",
|
||||
"seq-queue": "0.0.5",
|
||||
"sqlstring": "2.3.0"
|
||||
"sqlstring": "^2.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"readable-stream": {
|
||||
|
@ -379,13 +548,13 @@
|
|||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.2.tgz",
|
||||
"integrity": "sha1-WgTfBeT1f+Pw3Gj90R3FyXx+b00=",
|
||||
"requires": {
|
||||
"core-util-is": "1.0.2",
|
||||
"inherits": "2.0.3",
|
||||
"isarray": "1.0.0",
|
||||
"process-nextick-args": "1.0.7",
|
||||
"safe-buffer": "5.1.1",
|
||||
"string_decoder": "1.0.3",
|
||||
"util-deprecate": "1.0.2"
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.3",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~1.0.6",
|
||||
"safe-buffer": "~5.1.0",
|
||||
"string_decoder": "~1.0.0",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -405,12 +574,24 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"nan": {
|
||||
"version": "2.14.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
|
||||
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
|
||||
"optional": true
|
||||
},
|
||||
"ncp": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz",
|
||||
"integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=",
|
||||
"optional": true
|
||||
},
|
||||
"node-postgres-named": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/node-postgres-named/-/node-postgres-named-2.4.1.tgz",
|
||||
"integrity": "sha1-GgfQZjaI2V48wQVy04xfUOJyIsk=",
|
||||
"requires": {
|
||||
"lodash": "4.11.2"
|
||||
"lodash": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"object-assign": {
|
||||
|
@ -418,6 +599,14 @@
|
|||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"packet-reader": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-0.3.1.tgz",
|
||||
|
@ -428,6 +617,12 @@
|
|||
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz",
|
||||
"integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M="
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||
"optional": true
|
||||
},
|
||||
"pg": {
|
||||
"version": "7.4.0",
|
||||
"resolved": "https://registry.npmjs.org/pg/-/pg-7.4.0.tgz",
|
||||
|
@ -437,9 +632,9 @@
|
|||
"js-string-escape": "1.0.1",
|
||||
"packet-reader": "0.3.1",
|
||||
"pg-connection-string": "0.1.3",
|
||||
"pg-pool": "2.0.3",
|
||||
"pg-types": "1.12.1",
|
||||
"pgpass": "1.0.2",
|
||||
"pg-pool": "~2.0.3",
|
||||
"pg-types": "~1.12.1",
|
||||
"pgpass": "1.x",
|
||||
"semver": "4.3.2"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -465,10 +660,10 @@
|
|||
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-1.12.1.tgz",
|
||||
"integrity": "sha1-1kCH45A7WP+q0nnnWVxSIIoUw9I=",
|
||||
"requires": {
|
||||
"postgres-array": "1.0.2",
|
||||
"postgres-bytea": "1.0.0",
|
||||
"postgres-date": "1.0.3",
|
||||
"postgres-interval": "1.1.1"
|
||||
"postgres-array": "~1.0.0",
|
||||
"postgres-bytea": "~1.0.0",
|
||||
"postgres-date": "~1.0.0",
|
||||
"postgres-interval": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"pgpass": {
|
||||
|
@ -476,7 +671,7 @@
|
|||
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.2.tgz",
|
||||
"integrity": "sha1-Knu0G2BltnkH6R2hsHwYR8h3swY=",
|
||||
"requires": {
|
||||
"split": "1.0.1"
|
||||
"split": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"postgres-array": {
|
||||
|
@ -499,9 +694,14 @@
|
|||
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.1.1.tgz",
|
||||
"integrity": "sha512-OkuCi9t/3CZmeQreutGgx/OVNv9MKHGIT5jH8KldQ4NLYXkvmT9nDVxEuCENlNwhlGPE374oA/xMqn05G49pHA==",
|
||||
"requires": {
|
||||
"xtend": "4.0.1"
|
||||
"xtend": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"precond": {
|
||||
"version": "0.2.3",
|
||||
"resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz",
|
||||
"integrity": "sha1-qpWRvKokkj8eD0hJ0kD0fvwQdaw="
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
|
||||
|
@ -517,13 +717,13 @@
|
|||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.7.tgz",
|
||||
"integrity": "sha1-BwV6y+JGeyIELTb5jFrVBwVOlbE=",
|
||||
"requires": {
|
||||
"buffer-shims": "1.0.0",
|
||||
"core-util-is": "1.0.2",
|
||||
"inherits": "2.0.3",
|
||||
"isarray": "1.0.0",
|
||||
"process-nextick-args": "1.0.7",
|
||||
"string_decoder": "1.0.3",
|
||||
"util-deprecate": "1.0.2"
|
||||
"buffer-shims": "~1.0.0",
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.1",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~1.0.6",
|
||||
"string_decoder": "~1.0.0",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"redeyed": {
|
||||
|
@ -531,7 +731,7 @@
|
|||
"resolved": "https://registry.npmjs.org/redeyed/-/redeyed-1.0.1.tgz",
|
||||
"integrity": "sha1-6WwZO0DAgWsArshCaY5hGF5VSYo=",
|
||||
"requires": {
|
||||
"esprima": "3.0.0"
|
||||
"esprima": "~3.0.0"
|
||||
}
|
||||
},
|
||||
"regenerator-runtime": {
|
||||
|
@ -549,8 +749,8 @@
|
|||
"resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz",
|
||||
"integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==",
|
||||
"requires": {
|
||||
"resolve-from": "2.0.0",
|
||||
"semver": "5.4.1"
|
||||
"resolve-from": "^2.0.0",
|
||||
"semver": "^5.1.0"
|
||||
}
|
||||
},
|
||||
"resolve-from": {
|
||||
|
@ -558,11 +758,26 @@
|
|||
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz",
|
||||
"integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c="
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.4.5",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz",
|
||||
"integrity": "sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto=",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"glob": "^6.0.1"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
|
||||
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
|
||||
},
|
||||
"safe-json-stringify": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz",
|
||||
"integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==",
|
||||
"optional": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.4.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
|
||||
|
@ -578,10 +793,10 @@
|
|||
"resolved": "https://registry.npmjs.org/serve-favicon/-/serve-favicon-2.4.5.tgz",
|
||||
"integrity": "sha512-s7F8h2NrslMkG50KxvlGdj+ApSwaLex0vexuJ9iFf3GLTIp1ph/l1qZvRe9T9TJEYZgmq72ZwJ2VYiAEtChknw==",
|
||||
"requires": {
|
||||
"etag": "1.8.1",
|
||||
"etag": "~1.8.1",
|
||||
"fresh": "0.5.2",
|
||||
"ms": "2.0.0",
|
||||
"parseurl": "1.3.2",
|
||||
"parseurl": "~1.3.2",
|
||||
"safe-buffer": "5.1.1"
|
||||
}
|
||||
},
|
||||
|
@ -595,7 +810,7 @@
|
|||
"resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz",
|
||||
"integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==",
|
||||
"requires": {
|
||||
"through": "2.3.8"
|
||||
"through": "2"
|
||||
}
|
||||
},
|
||||
"sprintf": {
|
||||
|
@ -618,7 +833,7 @@
|
|||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
|
||||
"integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
|
||||
"requires": {
|
||||
"safe-buffer": "5.1.1"
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
|
@ -631,11 +846,11 @@
|
|||
"resolved": "https://registry.npmjs.org/tedious/-/tedious-2.1.5.tgz",
|
||||
"integrity": "sha1-hVdNIs3hdp3+TMSg1pcXWxPl0xg=",
|
||||
"requires": {
|
||||
"babel-runtime": "6.26.0",
|
||||
"babel-runtime": "^6.26.0",
|
||||
"big-number": "0.3.1",
|
||||
"bl": "1.2.1",
|
||||
"iconv-lite": "0.4.19",
|
||||
"readable-stream": "2.2.7",
|
||||
"bl": "^1.2.0",
|
||||
"iconv-lite": "^0.4.11",
|
||||
"readable-stream": "^2.2.6",
|
||||
"sprintf": "0.1.5"
|
||||
}
|
||||
},
|
||||
|
@ -649,17 +864,45 @@
|
|||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"vasync": {
|
||||
"version": "1.6.4",
|
||||
"resolved": "https://registry.npmjs.org/vasync/-/vasync-1.6.4.tgz",
|
||||
"integrity": "sha1-3+k2Fq0OeugBszKp2Iv8XNyOHR8=",
|
||||
"requires": {
|
||||
"verror": "1.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"verror": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/verror/-/verror-1.6.0.tgz",
|
||||
"integrity": "sha1-fROyex+swuLakEBetepuW90lLqU=",
|
||||
"requires": {
|
||||
"extsprintf": "1.2.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"verror": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
|
||||
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
|
||||
"requires": {
|
||||
"assert-plus": "^1.0.0",
|
||||
"core-util-is": "1.0.2",
|
||||
"extsprintf": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"winston": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/winston/-/winston-2.4.0.tgz",
|
||||
"integrity": "sha1-gIBQuT1SZh7Z+2wms/DIJnCLCu4=",
|
||||
"requires": {
|
||||
"async": "1.0.0",
|
||||
"colors": "1.0.3",
|
||||
"cycle": "1.0.3",
|
||||
"eyes": "0.1.8",
|
||||
"isstream": "0.1.2",
|
||||
"stack-trace": "0.0.10"
|
||||
"async": "~1.0.0",
|
||||
"colors": "1.0.x",
|
||||
"cycle": "1.0.x",
|
||||
"eyes": "0.1.x",
|
||||
"isstream": "0.1.x",
|
||||
"stack-trace": "0.0.x"
|
||||
},
|
||||
"dependencies": {
|
||||
"async": {
|
||||
|
@ -669,6 +912,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"xtend": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"cookie-parser": "^1.4.3",
|
||||
"debug": "^3.1.0",
|
||||
"express-winston": "^2.4.0",
|
||||
"ldapjs": "1.0.2",
|
||||
"mongoose": "^4.13.6",
|
||||
"mssql": "^4.1.0",
|
||||
"mysql2": "^1.5.1",
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
var config = require('./../tcrud-config');
|
||||
var tcrudSetup = require('./../tcrud-setup');
|
||||
var debug = require('debug')('ff:tcrud:ldapjs');
|
||||
|
||||
module.exports = {
|
||||
registrate: function(key,client) {
|
||||
config.registratePlugin(new LdapJSPlugin(key,client));
|
||||
tcrudSetup.pluginLoad(new LdapJSPlugin(key,client));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,15 +33,18 @@ LdapJSBackend.prototype.getKey = function() {
|
|||
return this.plugin.key;
|
||||
}
|
||||
|
||||
// see http://ldapjs.org/client.html#connection-management
|
||||
LdapJSBackend.prototype.findAll = function(tview,crudType) {
|
||||
var self = this;
|
||||
return function(data, dataParam, cb) {
|
||||
var opts = {
|
||||
filter: '(&(l=Seattle)(email=*@foo.com))',
|
||||
filter2: '(&(l=Seattle)(email=*@foo.com))',
|
||||
scope: 'sub'
|
||||
};
|
||||
debug('findAll %s',opts);
|
||||
self.plugin.client.search('o=example', opts, function(err, res) {
|
||||
var ss = 'ou=users,dc=nss,dc=forwardfire,dc=net';
|
||||
console.log("ldap search "+ss);
|
||||
self.plugin.client.search(ss, opts, function(err, res) {
|
||||
if (err) {
|
||||
debug(err);
|
||||
cb(err);
|
||||
|
@ -50,9 +53,12 @@ LdapJSBackend.prototype.findAll = function(tview,crudType) {
|
|||
//var querySql = 'SELECT '+selectField(tview,crudType)+' FROM '+tview.tmeta.tmodel.tid+'';
|
||||
var result = [];
|
||||
res.on('searchEntry', function(entry) {
|
||||
result.push(entry);
|
||||
result.push(entry.object);
|
||||
});
|
||||
res.on('end', function(result) {
|
||||
res.on('error', function(err) {
|
||||
cb(err);
|
||||
});
|
||||
res.on('end', function(status) {
|
||||
cb(err,result);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -50,7 +50,7 @@ var mod = (function () {
|
|||
'fillTField',
|
||||
'fillTView',
|
||||
'createBackend',
|
||||
'key','dbModule','query','conn'];
|
||||
'key','dbModule','client','query','conn'];
|
||||
|
||||
|
||||
var mergeMaster = function(objectDest,pluginKey) {
|
||||
|
@ -192,7 +192,7 @@ var mod = (function () {
|
|||
if (pluginKeysAllowed.indexOf(objectKey) !== -1) {
|
||||
continue;
|
||||
}
|
||||
throw new Error('Illegal plugin objectKey: '+objectKey+' plugin: '+plugin.tmeta.key);
|
||||
throw new Error('Illegal plugin objectKey: '+objectKey+' plugin: '+plugin);
|
||||
}
|
||||
|
||||
plugin['tmeta'] = ctx;
|
||||
|
@ -385,16 +385,17 @@ var mod = (function () {
|
|||
|
||||
this.createClientResourceFetchList = function() {
|
||||
var fetchList = [];
|
||||
var serverUrl = "http://localhost:8080";
|
||||
for (var clientResourceIdx in masterConfig.clientResources.js) {
|
||||
var url = masterConfig.clientResources.js[clientResourceIdx];
|
||||
var url = serverUrl + masterConfig.clientResources.js[clientResourceIdx];
|
||||
fetchList.push({url:url,type:'js'});
|
||||
}
|
||||
for (var clientResourceIdx in masterConfig.clientResources.css) {
|
||||
var url = masterConfig.clientResources.css[clientResourceIdx];
|
||||
var url = serverUrl + masterConfig.clientResources.css[clientResourceIdx];
|
||||
fetchList.push({url:url,type:'css'});
|
||||
}
|
||||
for (var clientResourceIdx in masterConfig.clientResources.dss) {
|
||||
var url = masterConfig.clientResources.dss[clientResourceIdx];
|
||||
var url = serverUrl + masterConfig.clientResources.dss[clientResourceIdx];
|
||||
fetchList.push({url:url,type:'dss'});
|
||||
}
|
||||
return fetchList;
|
||||
|
|
1140
package-lock.json
generated
1140
package-lock.json
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue