Commit 2e328578 authored by Varun Srivastava's avatar Varun Srivastava
Browse files

Merge branch 'testing' into 'devel_varun'

Testing

See merge request !67
parents 68f76bef 496b8571
pages-testing: deploy-testing:
stage: deploy stage: deploy
script: script:
- cat $configfiledev > ./config/config.js
- cat $cert > ./routes/cert/cert.pem
- cat $certidp > ./routes/cert/cert_idp.pem
- cat $key > ./routes/cert/key.pem
- npm install - npm install
- "pm2 delete --silent account || :" - "pm2 delete --silent account || :"
- pm2 start ./app.js --name=account - pm2 start ./app.js --name=account
...@@ -9,4 +13,19 @@ pages-testing: ...@@ -9,4 +13,19 @@ pages-testing:
- testing - testing
only: only:
- testing - testing
- test_logoutbutton
\ No newline at end of file deploy-master:
stage: deploy
script:
- cat $configfileprod > ./config/config.js
- cat $cert > ./routes/cert/cert.pem
- cat $certidp > ./routes/cert/cert_idp.pem
- cat $key > ./routes/cert/key.pem
- npm install
- "pm2 delete --silent account || :"
- pm2 start ./app.js --name=account
- pm2 save
tags:
- production
only:
- master
\ No newline at end of file
...@@ -9,28 +9,31 @@ module.exports = { ...@@ -9,28 +9,31 @@ module.exports = {
strategy: 'saml', strategy: 'saml',
saml: { saml: {
path: process.env.SAML_PATH || '/saml/SSO', path: process.env.SAML_PATH || '/saml/SSO',
entryPoint: process.env.SAML_ENTRY_POINT || 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SSOService.php', entryPoint: process.env.SAML_ENTRY_POINT || 'Saml Entry Point',
issuer: 'sp-account.m4lab.hft-stuttgart.de', //local metadata issuer: 'SAML issuer', //local metadata
logoutUrl: 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SingleLogoutService.php' logoutUrl: 'SAML logout URL'
} }
}, },
database: { database: {
host: 'localhost', // DB host host: 'localhost', // DB host
user: 'DBManager', // DB username user: 'usernamedb', // DB username
password: 'Stuttgart2019', // DB password password: 'passworddb', // DB password
port: 3306, // MySQL port port: 3306, // MySQL port
dbUser: 'userdb', // User DB dbUser: 'userdb', // User DB
host_project: 'localhost', // DB host project db host_project: 'localhost', // DB host project db
dbProject: 'projectDB' // Project DB dbProject: 'projectdb' // Project DB
}, },
mailer: { mailer: {
host: 'mail.hft-stuttgart.de', // hostname host: 'mailhost', // hostname
secureConnection: false, // TLS requires secureConnection to be false secureConnection: false, // TLS requires secureConnection to be false
port: 587, // port for secure SMTP port: 587, // port for secure SMTP
authUser: 'ad\\support-transfer', authUser: 'mailuser',
authPass: '6laumri2', authPass: 'mailpass',
tlsCiphers: 'SSLv3', tlsCiphers: 'SSLv3',
from: 'support-transfer@hft-stuttgart.de', from: 'mailfrom',
},
gitlab: {
token_readWriteProjects: 'token-goes-here'
} }
}, },
testing: { testing: {
...@@ -43,30 +46,31 @@ module.exports = { ...@@ -43,30 +46,31 @@ module.exports = {
strategy: 'saml', strategy: 'saml',
saml: { saml: {
path: process.env.SAML_PATH || '/saml/SSO', path: process.env.SAML_PATH || '/saml/SSO',
entryPoint: process.env.SAML_ENTRY_POINT || 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SSOService.php', entryPoint: process.env.SAML_ENTRY_POINT || 'saml entry point',
//issuer: 'sp-account.m4lab.hft-stuttgart.de', //local metadata issuer: 'SAML issuer', //testing metadata
issuer: 'sp-account-testing.m4lab.hft-stuttgart.de', //testing metadata logoutUrl: 'SAML logout URL'
//issuer: 'sp-account-prod.m4lab.hft-stuttgart.de', //production metadata
logoutUrl: 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SingleLogoutService.php'
} }
}, },
database: { database: {
host: 'transfer.hft-stuttgart.de', // DB host host: 'dbhost', // DB host
user: 'DBManager', // DB username user: 'dbuser', // DB username
password: 'Stuttgart2019', // DB password password: 'dbpass', // DB password
port: 3306, // MySQL port port: 3306, // MySQL port
dbUser: 'userdb', // User DB dbUser: 'userdb', // User DB
host_project: 'm4lab.hft-stuttgart.de', // DB host project db host_project: 'dbhost', // DB host project db
dbProject: 'projectDB' // Project DB dbProject: 'projectdb' // Project DB
}, },
mailer: { mailer: {
host: 'mail.hft-stuttgart.de', // hostname host: 'mailhost', // hostname
secureConnection: false, // TLS requires secureConnection to be false secureConnection: false, // TLS requires secureConnection to be false
port: 587, // port for secure SMTP port: 587, // port for secure SMTP
authUser: 'ad\\support-transfer', authUser: 'mailuser',
authPass: '6laumri2', authPass: 'mailpass',
tlsCiphers: 'SSLv3', tlsCiphers: 'SSLv3',
from: 'support-transfer@hft-stuttgart.de', from: 'mailfrom',
},
gitlab: {
token_readWriteProjects: 'token-goes-here'
} }
} }
} }
\ No newline at end of file
...@@ -81,6 +81,11 @@ ...@@ -81,6 +81,11 @@
"resolved": "https://registry.npmjs.org/async/-/async-3.1.0.tgz", "resolved": "https://registry.npmjs.org/async/-/async-3.1.0.tgz",
"integrity": "sha512-4vx/aaY6j/j3Lw3fbCHNWP0pPaTCew3F6F3hYyl/tHs/ndmV1q7NW9T5yuJ2XAGwdQrP+6Wu20x06U4APo/iQQ==" "integrity": "sha512-4vx/aaY6j/j3Lw3fbCHNWP0pPaTCew3F6F3hYyl/tHs/ndmV1q7NW9T5yuJ2XAGwdQrP+6Wu20x06U4APo/iQQ=="
}, },
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"babel-runtime": { "babel-runtime": {
"version": "6.26.0", "version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
...@@ -303,6 +308,19 @@ ...@@ -303,6 +308,19 @@
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
}, },
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"requires": {
"delayed-stream": "~1.0.0"
}
},
"component-emitter": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
"integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
},
"compressible": { "compressible": {
"version": "2.0.18", "version": "2.0.18",
"resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz",
...@@ -410,6 +428,11 @@ ...@@ -410,6 +428,11 @@
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
}, },
"cookiejar": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz",
"integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA=="
},
"core-js": { "core-js": {
"version": "2.6.10", "version": "2.6.10",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.10.tgz", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.10.tgz",
...@@ -478,13 +501,10 @@ ...@@ -478,13 +501,10 @@
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
"integrity": "sha1-xPp8lUBKF6nD6Mp+FTcxK3NjMKw=" "integrity": "sha1-xPp8lUBKF6nD6Mp+FTcxK3NjMKw="
}, },
"define-properties": { "delayed-stream": {
"version": "1.1.3", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
"requires": {
"object-keys": "^1.0.12"
}
}, },
"depd": { "depd": {
"version": "1.1.2", "version": "1.1.2",
...@@ -515,9 +535,9 @@ ...@@ -515,9 +535,9 @@
"integrity": "sha512-ZjI4zqTaxveH2/tTlzS1wFp+7ncxNZaIEWYg3lzZRHkKf5zPT/MnEG6WL0BhHMJUabkh8GeU5NL5j+rEUCb7Ug==" "integrity": "sha512-ZjI4zqTaxveH2/tTlzS1wFp+7ncxNZaIEWYg3lzZRHkKf5zPT/MnEG6WL0BhHMJUabkh8GeU5NL5j+rEUCb7Ug=="
}, },
"dot-prop": { "dot-prop": {
"version": "4.2.0", "version": "4.2.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz",
"integrity": "sha1-HxngwuGqDjJ5fEl5nyg3rGr2nFc=", "integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==",
"requires": { "requires": {
"is-obj": "^1.0.0" "is-obj": "^1.0.0"
} }
...@@ -532,11 +552,6 @@ ...@@ -532,11 +552,6 @@
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
}, },
"ejs": {
"version": "2.7.4",
"resolved": "https://registry.npmjs.org/ejs/-/ejs-2.7.4.tgz",
"integrity": "sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA=="
},
"encodeurl": { "encodeurl": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
...@@ -551,33 +566,6 @@ ...@@ -551,33 +566,6 @@
"escape-html": "~1.0.3" "escape-html": "~1.0.3"
} }
}, },
"es-abstract": {
"version": "1.16.3",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.16.3.tgz",
"integrity": "sha512-WtY7Fx5LiOnSYgF5eg/1T+GONaGmpvpPdCpSnYij+U2gDTL0UPfWrhDw7b2IYb+9NQJsYpCA0wOQvZfsd6YwRw==",
"requires": {
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1",
"is-callable": "^1.1.4",
"is-regex": "^1.0.4",
"object-inspect": "^1.7.0",
"object-keys": "^1.1.1",
"string.prototype.trimleft": "^2.1.0",
"string.prototype.trimright": "^2.1.0"
}
},
"es-to-primitive": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
"integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
"requires": {
"is-callable": "^1.1.4",
"is-date-object": "^1.0.1",
"is-symbol": "^1.0.2"
}
},
"escape-html": { "escape-html": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
...@@ -704,6 +692,11 @@ ...@@ -704,6 +692,11 @@
} }
} }
}, },
"fast-safe-stringify": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz",
"integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA=="
},
"feature-policy": { "feature-policy": {
"version": "0.3.0", "version": "0.3.0",
"resolved": "https://registry.npmjs.org/feature-policy/-/feature-policy-0.3.0.tgz", "resolved": "https://registry.npmjs.org/feature-policy/-/feature-policy-0.3.0.tgz",
...@@ -731,6 +724,21 @@ ...@@ -731,6 +724,21 @@
"unpipe": "~1.0.0" "unpipe": "~1.0.0"
} }
}, },
"form-data": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz",
"integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
}
},
"formidable": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz",
"integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q=="
},
"forwarded": { "forwarded": {
"version": "0.1.2", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
...@@ -814,11 +822,6 @@ ...@@ -814,11 +822,6 @@
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
}, },
"has-symbols": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz",
"integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg=="
},
"helmet": { "helmet": {
"version": "3.23.3", "version": "3.23.3",
"resolved": "https://registry.npmjs.org/helmet/-/helmet-3.23.3.tgz", "resolved": "https://registry.npmjs.org/helmet/-/helmet-3.23.3.tgz",
...@@ -940,6 +943,11 @@ ...@@ -940,6 +943,11 @@
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o="
}, },
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
...@@ -963,11 +971,6 @@ ...@@ -963,11 +971,6 @@
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
"integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=" "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4="
}, },
"is-callable": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz",
"integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA=="
},
"is-ci": { "is-ci": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz",
...@@ -976,11 +979,6 @@ ...@@ -976,11 +979,6 @@
"ci-info": "^1.5.0" "ci-info": "^1.5.0"
} }
}, },
"is-date-object": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz",
"integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY="
},
"is-expression": { "is-expression": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-expression/-/is-expression-3.0.0.tgz", "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-3.0.0.tgz",
...@@ -1075,14 +1073,6 @@ ...@@ -1075,14 +1073,6 @@
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
}, },
"is-symbol": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
"integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==",
"requires": {
"has-symbols": "^1.0.1"
}
},
"isarray": { "isarray": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
...@@ -1119,11 +1109,6 @@ ...@@ -1119,11 +1109,6 @@
"resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz",
"integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=" "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4="
}, },
"lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
},
"longest": { "longest": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
...@@ -1281,9 +1266,9 @@ ...@@ -1281,9 +1266,9 @@
"integrity": "sha512-0L9FvHG3nfnnmaEQPjT9xhfN4ISk0A8/2j4M37Np4mcDesJjHgEUfgPhdCyZuFI954tjokaIj/A3NdpFNdEh4Q==" "integrity": "sha512-0L9FvHG3nfnnmaEQPjT9xhfN4ISk0A8/2j4M37Np4mcDesJjHgEUfgPhdCyZuFI954tjokaIj/A3NdpFNdEh4Q=="
}, },
"node-forge": { "node-forge": {
"version": "0.7.6", "version": "0.10.0",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.6.tgz", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz",
"integrity": "sha1-/fO0GK7h+U8O9kLNY0hsd8qXJKw=" "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA=="
}, },
"nodemailer": { "nodemailer": {
"version": "6.3.1", "version": "6.3.1",
...@@ -1343,25 +1328,6 @@ ...@@ -1343,25 +1328,6 @@
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
}, },
"object-inspect": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz",
"integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw=="
},
"object-keys": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="
},
"object.getownpropertydescriptors": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz",
"integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=",
"requires": {
"define-properties": "^1.1.2",
"es-abstract": "^1.5.1"
}
},
"on-finished": { "on-finished": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
...@@ -1406,15 +1372,15 @@ ...@@ -1406,15 +1372,15 @@
} }
}, },
"passport-saml": { "passport-saml": {
"version": "1.2.0", "version": "1.4.2",
"resolved": "https://registry.npmjs.org/passport-saml/-/passport-saml-1.2.0.tgz", "resolved": "https://registry.npmjs.org/passport-saml/-/passport-saml-1.4.2.tgz",
"integrity": "sha512-CU1JOx9FTITF8+vl/G1g7FV6kHWXYzECV3pq3D8K3RIM1MS0efbfQ2hkgDFdoZGdG9DdMH5z8OBW/O8qoXnkLQ==", "integrity": "sha512-RJXtuiv4KWazi4zmZGVqN5pf3bV2aFbOygYzUCDEBDdeOD0yHFL4ymPOpLPXg35HvilFYTzB94JRWqwLdI2ecw==",
"requires": { "requires": {
"debug": "^3.1.0", "debug": "^3.1.0",
"passport-strategy": "*", "passport-strategy": "*",
"q": "^1.5.0", "q": "^1.5.0",
"xml-crypto": "^1.1.4", "xml-crypto": "^2.0.0",
"xml-encryption": "^0.11.0", "xml-encryption": "1.2.1",
"xml2js": "0.4.x", "xml2js": "0.4.x",
"xmlbuilder": "^11.0.0", "xmlbuilder": "^11.0.0",
"xmldom": "0.1.x" "xmldom": "0.1.x"
...@@ -1423,7 +1389,7 @@ ...@@ -1423,7 +1389,7 @@
"debug": { "debug": {
"version": "3.2.6", "version": "3.2.6",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
"integrity": "sha1-6D0X3hbYp++3cX7b5fsQE17uYps=", "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
"requires": { "requires": {
"ms": "^2.1.1" "ms": "^2.1.1"
} }
...@@ -1834,7 +1800,7 @@ ...@@ -1834,7 +1800,7 @@
"sax": { "sax": {
"version": "1.2.4", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
"integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=" "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
}, },
"semver": { "semver": {
"version": "5.7.1", "version": "5.7.1",
...@@ -1939,24 +1905,6 @@ ...@@ -1939,24 +1905,6 @@
"strip-ansi": "^4.0.0" "strip-ansi": "^4.0.0"
} }
}, },
"string.prototype.trimleft": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz",
"integrity": "sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw==",
"requires": {
"define-properties": "^1.1.3",
"function-bind": "^1.1.1"
}
},
"string.prototype.trimright": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz",
"integrity": "sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg==",
"requires": {
"define-properties": "^1.1.3",
"function-bind": "^1.1.1"
}
},
"string_decoder": { "string_decoder": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
...@@ -1983,6 +1931,59 @@ ...@@ -1983,6 +1931,59 @@
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo="
}, },
"superagent": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/superagent/-/superagent-6.1.0.tgz",
"integrity": "sha512-OUDHEssirmplo3F+1HWKUrUjvnQuA+nZI6i/JJBdXb5eq9IyEQwPyPpqND+SSsxf6TygpBEkUjISVRN4/VOpeg==",
"requires": {
"component-emitter": "^1.3.0",
"cookiejar": "^2.1.2",
"debug": "^4.1.1",
"fast-safe-stringify": "^2.0.7",
"form-data": "^3.0.0",
"formidable": "^1.2.2",
"methods": "^1.1.2",
"mime": "^2.4.6",
"qs": "^6.9.4",
"readable-stream": "^3.6.0",
"semver": "^7.3.2"
},
"dependencies": {
"debug": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz",
"integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==",
"requires": {
"ms": "2.1.2"
}
},
"mime": {
"version": "2.4.6",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz",
"integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA=="
},
"qs": {
"version": "6.9.4",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz",
"integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ=="
},
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
},
"semver": {
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ=="
}
}
},
"supports-color": { "supports-color": {
"version": "5.5.0", "version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
...@@ -2131,15 +2132,6 @@ ...@@ -2131,15 +2132,6 @@
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
}, },
"util.promisify": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz",
"integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==",
"requires": {
"define-properties": "^1.1.2",
"object.getownpropertydescriptors": "^2.0.3"
}
},
"utils-merge": { "utils-merge": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
...@@ -2197,60 +2189,55 @@ ...@@ -2197,60 +2189,55 @@
"integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=" "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ="
}, },
"xml-crypto": { "xml-crypto": {
"version": "1.4.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/xml-crypto/-/xml-crypto-1.4.0.tgz", "resolved": "https://registry.npmjs.org/xml-crypto/-/xml-crypto-2.0.0.tgz",
"integrity": "sha1-3hzsjNMcvWic2Q09boon1K6Afec=", "integrity": "sha512-/a04qr7RpONRZHOxROZ6iIHItdsQQjN3sj8lJkYDDss8tAkEaAs0VrFjb3tlhmS5snQru5lTs9/5ISSMdPDHlg==",
"requires": { "requires": {
"xmldom": "0.1.27", "xmldom": "0.1.27",
"xpath": "0.0.27" "xpath": "0.0.27"
},
"dependencies": {
"xmldom": {
"version": "0.1.27",
"resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz",
"integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk="
}
} }
}, },
"xml-encryption": { "xml-encryption": {
"version": "0.11.2", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/xml-encryption/-/xml-encryption-0.11.2.tgz", "resolved": "https://registry.npmjs.org/xml-encryption/-/xml-encryption-1.2.1.tgz",
"integrity": "sha512-jVvES7i5ovdO7N+NjgncA326xYKjhqeAnnvIgRnY7ROLCfFqEDLwP0Sxp/30SHG0AXQV1048T5yinOFyvwGFzg==", "integrity": "sha512-hn5w3l5p2+nGjlmM0CAhMChDzVGhW+M37jH35Z+GJIipXbn9PUlAIRZ6I5Wm7ynlqZjFrMAr83d/CIp9VZJMTA==",
"requires": { "requires": {
"async": "^2.1.5", "escape-html": "^1.0.3",
"ejs": "^2.5.6", "node-forge": "^0.10.0",
"node-forge": "^0.7.0",
"xmldom": "~0.1.15", "xmldom": "~0.1.15",
"xpath": "0.0.27" "xpath": "0.0.27"
},
"dependencies": {
"async": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"requires": {
"lodash": "^4.17.14"
}
}
} }
}, },
"xml2js": { "xml2js": {
"version": "0.4.22", "version": "0.4.23",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.22.tgz", "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
"integrity": "sha512-MWTbxAQqclRSTnehWWe5nMKzI3VmJ8ltiJEco8akcC6j3miOhjjfzKum5sId+CWhfxdOs/1xauYr8/ZDBtQiRw==", "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
"requires": { "requires": {
"sax": ">=0.6.0", "sax": ">=0.6.0",
"util.promisify": "~1.0.0",
"xmlbuilder": "~11.0.0" "xmlbuilder": "~11.0.0"
} }
}, },
"xmlbuilder": { "xmlbuilder": {
"version": "11.0.1", "version": "11.0.1",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
"integrity": "sha1-vpuuHIoEbnazESdyY0fQrXACvrM=" "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="
}, },
"xmldom": { "xmldom": {
"version": "0.1.27", "version": "0.1.31",
"resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz",
"integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=" "integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ=="
}, },
"xpath": { "xpath": {
"version": "0.0.27", "version": "0.0.27",
"resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.27.tgz", "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.27.tgz",
"integrity": "sha1-3TQh+9zFZGrDLEhTG01+nQws+pI=" "integrity": "sha512-fg03WRxtkCV6ohClePNAECYsmpKKTv5L8y/X3Dn1hQrec3POx2jHZ/0P2qQ6HvsrU1BmeqXcof3NGGueG6LxwQ=="
}, },
"yallist": { "yallist": {
"version": "2.1.2", "version": "2.1.2",
......
...@@ -39,8 +39,9 @@ ...@@ -39,8 +39,9 @@
"nodemailer": "^6.3.1", "nodemailer": "^6.3.1",
"nodemon": "^2.0.1", "nodemon": "^2.0.1",
"passport": "0.3.2", "passport": "0.3.2",
"passport-saml": "^1.2.0", "passport-saml": "^1.4.2",
"pug": "^2.0.4" "pug": "^2.0.4",
"superagent": "^6.1.0"
}, },
"devDependencies": {}, "devDependencies": {},
"engines": { "engines": {
......
...@@ -69,7 +69,7 @@ var methods = { ...@@ -69,7 +69,7 @@ var methods = {
}) })
}, },
getUserByEmail: function(email, callback) { getUserByEmail: function(email, callback) {
dbconn.user.query('SELECT verificationStatus, salutation, title, firstname, lastname, industry, organisation, speciality, m4lab_idp FROM user WHERE email = "' +email+'"', function (err, rows, fields) { dbconn.user.query('SELECT id, verificationStatus, salutation, title, firstname, lastname, industry, organisation, speciality, m4lab_idp FROM user WHERE email = "' +email+'"', function (err, rows, fields) {
if (err) { if (err) {
throw err; throw err;
} }
...@@ -212,6 +212,25 @@ var methods = { ...@@ -212,6 +212,25 @@ var methods = {
}) })
callback(err) callback(err)
}) })
},
/* ===== GitLab ===== */
getGitlabId: function(userId, callback){
let gitlabUserId
dbconn.user.query('SELECT gu.gitlab_userId FROM user_gitlab gu, user u WHERE u.id = "' +userId+'" and gu.user_id = u.id', function (err, rows) {
if (err) {
throw err
}
else if(rows[0]) {
gitlabUserId = rows[0].gitlab_userId
}
callback(gitlabUserId, err)
})
},
addGitlabUser: function(data, callback){
dbconn.user.query('INSERT INTO user_gitlab SET ?', data, function (err) {
if (err) throw err
callback(err)
})
} }
}; };
......
...@@ -10,6 +10,7 @@ const salt = 64; // salt length ...@@ -10,6 +10,7 @@ const salt = 64; // salt length
const async = require('async') const async = require('async')
const crypto = require('crypto') const crypto = require('crypto')
const mailer = require('./mailer') const mailer = require('./mailer')
const superagent = require('superagent')
module.exports = function (app, config, passport, i18n) { module.exports = function (app, config, passport, i18n) {
...@@ -180,6 +181,34 @@ module.exports = function (app, config, passport, i18n) { ...@@ -180,6 +181,34 @@ module.exports = function (app, config, passport, i18n) {
methods.getUserByEmail(req.user.email, function(data, err){ methods.getUserByEmail(req.user.email, function(data, err){
if (!err) { if (!err) {
if (data.verificationStatus == 1) { if (data.verificationStatus == 1) {
// start =============== RS: MLAB-183
let userId = data.id
methods.getGitlabId(userId, function(data, err){
if (!err) {
if (data) {
console.log("TODO: GitLab is already activated for this user. Allow project creation.")
}
else {
superagent.get('https://transfer.hft-stuttgart.de/gitlab/api/v4/users?private_token='+config.gitlab.token_readWriteProjects+'&search='+req.user.email)
.then(res => {
if (res.body.length > 0) {
let gitlabActivationData = {
user_id: userId,
gitlab_userId: res.body[0].id
}
methods.addGitlabUser(gitlabActivationData, function(err){})
}
else {
console.log('TODO: Show gitlab activation button: transfer.hft-stuttgart.de/gitlab')
}
})
.catch(err => {
console.log(err.message)
});
}
}
})
// end =============== RS: MLAB-183
res.render(lang+'/account/services', { res.render(lang+'/account/services', {
user: data user: data
}); });
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment