From ce3626f897d22d5277919bb1fbdf776d33dd69ef Mon Sep 17 00:00:00 2001 From: DEEPAK RAJAMOHAN Date: Mon, 16 Mar 2020 16:51:08 -0700 Subject: [PATCH] docs: migrate loopback-example-passport repo as lb4 example --- examples/passport-login/.eslintignore | 3 + examples/passport-login/.eslintrc.js | 3 + examples/passport-login/.gitignore | 64 + examples/passport-login/.npmignore | 2 + examples/passport-login/.npmrc | 1 + examples/passport-login/.prettierignore | 2 + examples/passport-login/.prettierrc | 6 + examples/passport-login/data/db.json | 15 + examples/passport-login/index.js | 30 + examples/passport-login/index.ts | 1 + examples/passport-login/oauth2-providers.json | 47 + examples/passport-login/package-lock.json | 2319 +++++++++++++++++ examples/passport-login/package.json | 91 + examples/passport-login/public/index.html | 73 + examples/passport-login/src/application.ts | 60 + .../src/authentication-strategies/facebook.ts | 99 + .../src/authentication-strategies/google.ts | 96 + .../src/authentication-strategies/index.ts | 9 + .../src/authentication-strategies/local.ts | 119 + .../src/authentication-strategies/oauth2.ts | 123 + .../passport-login/src/controllers/index.ts | 1 + .../src/controllers/oauth2.controller.ts | 64 + .../src/controllers/user.controller.ts | 89 + .../src/datasources/db.datasource.config.json | 6 + .../src/datasources/db.datasource.ts | 19 + .../passport-login/src/datasources/index.ts | 6 + examples/passport-login/src/index.ts | 16 + examples/passport-login/src/models/index.ts | 8 + .../src/models/user-credentials.model.ts | 35 + .../src/models/user-identity.model.ts | 54 + .../passport-login/src/models/user.model.ts | 69 + .../passport-login/src/repositories/index.ts | 6 + .../user-credentials.repository.ts | 19 + .../repositories/user-identity.repository.ts | 19 + .../src/repositories/user.repository.ts | 37 + examples/passport-login/src/sequence.ts | 115 + examples/passport-login/src/server.ts | 70 + examples/passport-login/src/services/index.ts | 2 + examples/passport-login/src/services/keys.ts | 15 + .../src/services/user.service.ts | 112 + examples/passport-login/tsconfig.json | 10 + .../web-application/express-app.js | 140 + .../web-application/views/layouts/layout.jade | 8 + .../web-application/views/pages/index.jade | 17 + .../web-application/views/pages/login.jade | 23 + .../views/pages/loginProfiles.jade | 11 + .../web-application/views/pages/signup.jade | 29 + .../views/pages/signupOptions.jade | 13 + .../views/partials/banner.jade | 10 + .../views/partials/footer.jade | 13 + .../web-application/views/partials/head.jade | 30 + .../views/partials/navigation.jade | 23 + packages/authentication/src/services/index.ts | 1 + .../src/services/user-identity.service.ts | 61 + packages/rest/src/types.ts | 25 + 55 files changed, 4339 insertions(+) create mode 100644 examples/passport-login/.eslintignore create mode 100644 examples/passport-login/.eslintrc.js create mode 100644 examples/passport-login/.gitignore create mode 100644 examples/passport-login/.npmignore create mode 100644 examples/passport-login/.npmrc create mode 100644 examples/passport-login/.prettierignore create mode 100644 examples/passport-login/.prettierrc create mode 100644 examples/passport-login/data/db.json create mode 100644 examples/passport-login/index.js create mode 100644 examples/passport-login/index.ts create mode 100644 examples/passport-login/oauth2-providers.json create mode 100644 examples/passport-login/package-lock.json create mode 100644 examples/passport-login/package.json create mode 100644 examples/passport-login/public/index.html create mode 100644 examples/passport-login/src/application.ts create mode 100644 examples/passport-login/src/authentication-strategies/facebook.ts create mode 100644 examples/passport-login/src/authentication-strategies/google.ts create mode 100644 examples/passport-login/src/authentication-strategies/index.ts create mode 100644 examples/passport-login/src/authentication-strategies/local.ts create mode 100644 examples/passport-login/src/authentication-strategies/oauth2.ts create mode 100644 examples/passport-login/src/controllers/index.ts create mode 100644 examples/passport-login/src/controllers/oauth2.controller.ts create mode 100644 examples/passport-login/src/controllers/user.controller.ts create mode 100644 examples/passport-login/src/datasources/db.datasource.config.json create mode 100644 examples/passport-login/src/datasources/db.datasource.ts create mode 100644 examples/passport-login/src/datasources/index.ts create mode 100644 examples/passport-login/src/index.ts create mode 100644 examples/passport-login/src/models/index.ts create mode 100644 examples/passport-login/src/models/user-credentials.model.ts create mode 100644 examples/passport-login/src/models/user-identity.model.ts create mode 100644 examples/passport-login/src/models/user.model.ts create mode 100644 examples/passport-login/src/repositories/index.ts create mode 100644 examples/passport-login/src/repositories/user-credentials.repository.ts create mode 100644 examples/passport-login/src/repositories/user-identity.repository.ts create mode 100644 examples/passport-login/src/repositories/user.repository.ts create mode 100644 examples/passport-login/src/sequence.ts create mode 100644 examples/passport-login/src/server.ts create mode 100644 examples/passport-login/src/services/index.ts create mode 100644 examples/passport-login/src/services/keys.ts create mode 100644 examples/passport-login/src/services/user.service.ts create mode 100644 examples/passport-login/tsconfig.json create mode 100644 examples/passport-login/web-application/express-app.js create mode 100644 examples/passport-login/web-application/views/layouts/layout.jade create mode 100644 examples/passport-login/web-application/views/pages/index.jade create mode 100644 examples/passport-login/web-application/views/pages/login.jade create mode 100644 examples/passport-login/web-application/views/pages/loginProfiles.jade create mode 100644 examples/passport-login/web-application/views/pages/signup.jade create mode 100644 examples/passport-login/web-application/views/pages/signupOptions.jade create mode 100644 examples/passport-login/web-application/views/partials/banner.jade create mode 100644 examples/passport-login/web-application/views/partials/footer.jade create mode 100644 examples/passport-login/web-application/views/partials/head.jade create mode 100644 examples/passport-login/web-application/views/partials/navigation.jade create mode 100644 packages/authentication/src/services/user-identity.service.ts diff --git a/examples/passport-login/.eslintignore b/examples/passport-login/.eslintignore new file mode 100644 index 000000000000..9ebfc2d90351 --- /dev/null +++ b/examples/passport-login/.eslintignore @@ -0,0 +1,3 @@ +node_modules/ +dist/ +coverage/ diff --git a/examples/passport-login/.eslintrc.js b/examples/passport-login/.eslintrc.js new file mode 100644 index 000000000000..978b9dcca27f --- /dev/null +++ b/examples/passport-login/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: '@loopback/eslint-config', +}; diff --git a/examples/passport-login/.gitignore b/examples/passport-login/.gitignore new file mode 100644 index 000000000000..3013b9d0b6bc --- /dev/null +++ b/examples/passport-login/.gitignore @@ -0,0 +1,64 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + +# Transpiled JavaScript files from Typescript +/dist + +# Cache used by TypeScript's incremental build +*.tsbuildinfo diff --git a/examples/passport-login/.npmignore b/examples/passport-login/.npmignore new file mode 100644 index 000000000000..f86f365ab85b --- /dev/null +++ b/examples/passport-login/.npmignore @@ -0,0 +1,2 @@ +# Exclude *.tsbuildinfo - cache for tsc incremental builds +*.tsbuildinfo diff --git a/examples/passport-login/.npmrc b/examples/passport-login/.npmrc new file mode 100644 index 000000000000..cafe685a112d --- /dev/null +++ b/examples/passport-login/.npmrc @@ -0,0 +1 @@ +package-lock=true diff --git a/examples/passport-login/.prettierignore b/examples/passport-login/.prettierignore new file mode 100644 index 000000000000..c6911da9e1e8 --- /dev/null +++ b/examples/passport-login/.prettierignore @@ -0,0 +1,2 @@ +dist +*.json diff --git a/examples/passport-login/.prettierrc b/examples/passport-login/.prettierrc new file mode 100644 index 000000000000..f58b81dd7be2 --- /dev/null +++ b/examples/passport-login/.prettierrc @@ -0,0 +1,6 @@ +{ + "bracketSpacing": false, + "singleQuote": true, + "printWidth": 80, + "trailingComma": "all" +} diff --git a/examples/passport-login/data/db.json b/examples/passport-login/data/db.json new file mode 100644 index 000000000000..6d3d401ee092 --- /dev/null +++ b/examples/passport-login/data/db.json @@ -0,0 +1,15 @@ +{ + "ids": { + "User": 2, + "UserIdentity": 100487451443373280000 + }, + "models": { + "User": { + "1": "{\"name\":\"Open Graph Test User\",\"username\":\"dplojbdiuc_1585460374@tfbnw.net\",\"email\":\"dplojbdiuc_1585460374@tfbnw.net\",\"id\":1}" + }, + "UserIdentity": { + "104566694532668": "{\"id\":\"104566694532668\",\"provider\":\"facebook\",\"profile\":{\"emails\":[{\"value\":\"dplojbdiuc_1585460374@tfbnw.net\"}]},\"authScheme\":\"facebook\",\"created\":\"2020-04-07T18:40:25.360Z\",\"userId\":1}", + "100487451443373281118": "{\"id\":\"100487451443373281118\",\"provider\":\"google\",\"profile\":{\"emails\":[{\"value\":\"deepak.r.kris@gmail.com\",\"type\":\"account\"}]},\"authScheme\":\"google\",\"created\":\"2020-04-07T18:40:52.941Z\",\"userId\":1}" + } + } +} \ No newline at end of file diff --git a/examples/passport-login/index.js b/examples/passport-login/index.js new file mode 100644 index 000000000000..23fa79756090 --- /dev/null +++ b/examples/passport-login/index.js @@ -0,0 +1,30 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +const application = require('./dist'); + +module.exports = application; + +if (require.main === module) { + // Run the application + const config = { + rest: { + port: +(process.env.PORT || 3000), + host: process.env.HOST, + protocol: 'http', + gracePeriodForClose: 5000, // 5 seconds + openApiSpec: { + // useful when used with OpenAPI-to-GraphQL to locate your application + setServersFromRequest: true, + }, + // Use the LB4 application as a route. It should not be listening. + listenOnStart: false, + }, + }; + application.main(config).catch(err => { + console.error('Cannot start the application.', err); + process.exit(1); + }); +} diff --git a/examples/passport-login/index.ts b/examples/passport-login/index.ts new file mode 100644 index 000000000000..8420b1093fdb --- /dev/null +++ b/examples/passport-login/index.ts @@ -0,0 +1 @@ +export * from './src'; diff --git a/examples/passport-login/oauth2-providers.json b/examples/passport-login/oauth2-providers.json new file mode 100644 index 000000000000..faeed56cf251 --- /dev/null +++ b/examples/passport-login/oauth2-providers.json @@ -0,0 +1,47 @@ +{ + "facebook-login": { + "provider": "facebook", + "module": "passport-facebook", + "profileFields": ["gender", "link", "locale", "name", "timezone", + "verified", "email", "updated_time", "displayName", "id"], + "clientID": "{facebook-client-id}", + "clientSecret": "ad4315e3453b012f6e4b8dd4bc1c0ae6", + "callbackURL": "/api/auth/thirdparty/facebook/callback", + "authPath": "/api/auth/thirdparty/facebook", + "callbackPath": "/api/auth/thirdparty/facebook/callback", + "successRedirect": "/auth/account", + "failureRedirect": "/login", + "scope": ["email"], + "failureFlash": true + }, + "google-login": { + "provider": "google", + "module": "passport-google-oauth2", + "strategy": "OAuth2Strategy", + "clientID": "{google-client-id}", + "clientSecret": "FcldSqY5-9usqlRmQhZawN__", + "callbackURL": "/api/auth/thirdparty/google/callback", + "authPath": "/api/auth/thirdparty/google", + "callbackPath": "/api/auth/thirdparty/google/callback", + "successRedirect": "/auth/account", + "failureRedirect": "/login", + "scope": ["email", "profile"], + "failureFlash": true + }, + "oauth2": { + "provider": "oauth2", + "module": "passport-google-oauth2", + "strategy": "OAuth2Strategy", + "clientID": "{google-client-id}", + "clientSecret": "FcldSqY5-9usqlRmQhZawN__", + "callbackURL": "/api/auth/thirdparty/google/callback", + "authPath": "/api/auth/thirdparty/google", + "callbackPath": "/api/auth/thirdparty/google/callback", + "successRedirect": "/auth/account", + "failureRedirect": "/login", + "scope": ["email", "profile"], + "failureFlash": true, + "authorizationURL": "https://localhost:8080", + "tokenURL": "https://localhost:8080" + } +} diff --git a/examples/passport-login/package-lock.json b/examples/passport-login/package-lock.json new file mode 100644 index 000000000000..2c7bc97715e2 --- /dev/null +++ b/examples/passport-login/package-lock.json @@ -0,0 +1,2319 @@ +{ + "name": "@loopback/passport-login", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.8.3" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.0.tgz", + "integrity": "sha512-6G8bQKjOh+of4PV/ThDm/rRqlU7+IGoJuofpagU5GlEl29Vv0RGqqt86ZGRV8ZuSOY3o+8yXl5y782SMcG7SHw==", + "dev": true + }, + "@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@types/body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-W98JrE0j2K78swW4ukqMleo8R7h/pFETjM2DQ90MF6XK2i4LO4W3gQ71Lt4w3bfm2EvVSyWHplECvB5sK22yFQ==", + "requires": { + "@types/connect": "*", + "@types/node": "*" + }, + "dependencies": { + "@types/node": { + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.11.0.tgz", + "integrity": "sha512-uM4mnmsIIPK/yeO+42F2RQhGUIs39K2RFmugcJANppXe6J1nvH87PvzPZYpza7Xhhs8Yn9yIAVdLZ84z61+0xQ==" + } + } + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "@types/connect": { + "version": "3.4.33", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.33.tgz", + "integrity": "sha512-2+FrkXY4zllzTNfJth7jOqEHC+enpLeGslEhpnTAkg21GkRrWV4SsAtqchtT4YS9/nODBU2/ZfsBY2X4J/dX7A==", + "requires": { + "@types/node": "*" + }, + "dependencies": { + "@types/node": { + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.11.0.tgz", + "integrity": "sha512-uM4mnmsIIPK/yeO+42F2RQhGUIs39K2RFmugcJANppXe6J1nvH87PvzPZYpza7Xhhs8Yn9yIAVdLZ84z61+0xQ==" + } + } + }, + "@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", + "dev": true + }, + "@types/express": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.4.tgz", + "integrity": "sha512-DO1L53rGqIDUEvOjJKmbMEQ5Z+BM2cIEPy/eV3En+s166Gz+FeuzRerxcab757u/U4v4XF4RYrZPmqKa+aY/2w==", + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "*", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.17.3", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.3.tgz", + "integrity": "sha512-sHEsvEzjqN+zLbqP+8OXTipc10yH1QLR+hnr5uw29gi9AhCAAAdri8ClNV7iMdrJrIzXIQtlkPvq8tJGhj3QJQ==", + "requires": { + "@types/node": "*", + "@types/range-parser": "*" + }, + "dependencies": { + "@types/node": { + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.11.0.tgz", + "integrity": "sha512-uM4mnmsIIPK/yeO+42F2RQhGUIs39K2RFmugcJANppXe6J1nvH87PvzPZYpza7Xhhs8Yn9yIAVdLZ84z61+0xQ==" + } + } + }, + "@types/json-schema": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.4.tgz", + "integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==", + "dev": true + }, + "@types/jsonwebtoken": { + "version": "8.3.8", + "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.3.8.tgz", + "integrity": "sha512-g2ke5+AR/RKYpQxd+HJ2yisLHGuOV0uourOcPtKlcT5Zqv4wFg9vKhFpXEztN4H/6Y6RSUKioz/2PTFPP30CTA==", + "requires": { + "@types/node": "*" + }, + "dependencies": { + "@types/node": { + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.11.0.tgz", + "integrity": "sha512-uM4mnmsIIPK/yeO+42F2RQhGUIs39K2RFmugcJANppXe6J1nvH87PvzPZYpza7Xhhs8Yn9yIAVdLZ84z61+0xQ==" + } + } + }, + "@types/lodash": { + "version": "4.14.149", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.149.tgz", + "integrity": "sha512-ijGqzZt/b7BfzcK9vTrS6MFljQRPn5BFWOx8oE0GYxribu6uV+aA9zZuXI1zc/etK9E8nrgdoF2+LgUw7+9tJQ==" + }, + "@types/mime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.1.tgz", + "integrity": "sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw==" + }, + "@types/node": { + "version": "10.17.18", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.18.tgz", + "integrity": "sha512-DQ2hl/Jl3g33KuAUOcMrcAOtsbzb+y/ufakzAdeK9z/H/xsvkpbETZZbPNMIiQuk24f5ZRMCcZIViAwyFIiKmg==", + "dev": true + }, + "@types/oauth": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@types/oauth/-/oauth-0.9.1.tgz", + "integrity": "sha512-a1iY62/a3yhZ7qH7cNUsxoI3U/0Fe9+RnuFrpTKr+0WVOzbKlSLojShCKe20aOD1Sppv+i8Zlq0pLDuTJnwS4A==", + "requires": { + "@types/node": "*" + }, + "dependencies": { + "@types/node": { + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.11.0.tgz", + "integrity": "sha512-uM4mnmsIIPK/yeO+42F2RQhGUIs39K2RFmugcJANppXe6J1nvH87PvzPZYpza7Xhhs8Yn9yIAVdLZ84z61+0xQ==" + } + } + }, + "@types/passport": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/passport/-/passport-1.0.3.tgz", + "integrity": "sha512-nyztuxtDPQv9utCzU0qW7Gl8BY2Dn8BKlYAFFyxKipFxjaVd96celbkLCV/tRqqBUZ+JB8If3UfgV8347DTo3Q==", + "requires": { + "@types/express": "*" + } + }, + "@types/passport-facebook": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@types/passport-facebook/-/passport-facebook-2.1.9.tgz", + "integrity": "sha512-7Y5aHo35Io9fRvStBgXasf+6rRJ5SMiu1D3+cnUuxM1GS+QlgFnH+YTZjye0XgF4EWzxlXKTeLlK2DFU8+0Jpw==", + "requires": { + "@types/express": "*", + "@types/passport": "*" + } + }, + "@types/passport-google-oauth": { + "version": "1.0.41", + "resolved": "https://registry.npmjs.org/@types/passport-google-oauth/-/passport-google-oauth-1.0.41.tgz", + "integrity": "sha512-sl79Oau92bilbq6Sv47StzEt98qhu3kMjOBK4GaJX6XtG2a3bwVEebYkwxPrJkz7wb9S1O9x2Dtb3jMqqj9j9Q==", + "requires": { + "@types/express": "*", + "@types/passport": "*" + } + }, + "@types/passport-google-oauth2": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@types/passport-google-oauth2/-/passport-google-oauth2-0.1.3.tgz", + "integrity": "sha512-Xz28sSZXDIGnVQj58OyqhebxhVJZxsnDexNOQipHs/iD0sTY7pjCDNAMnUiaH3uWRjTLwcsIKXgxBqfWhUbGOw==", + "requires": { + "@types/express": "*" + } + }, + "@types/passport-local": { + "version": "1.0.33", + "resolved": "https://registry.npmjs.org/@types/passport-local/-/passport-local-1.0.33.tgz", + "integrity": "sha512-+rn6ZIxje0jZ2+DAiWFI8vGG7ZFKB0hXx2cUdMmudSWsigSq6ES7Emso46r4HJk0qCgrZVfI8sJiM7HIYf4SbA==", + "requires": { + "@types/express": "*", + "@types/passport": "*", + "@types/passport-strategy": "*" + } + }, + "@types/passport-oauth2": { + "version": "1.4.9", + "resolved": "https://registry.npmjs.org/@types/passport-oauth2/-/passport-oauth2-1.4.9.tgz", + "integrity": "sha512-QP0q+NVQOaIu2r0e10QWkiUA0Ya5mOBHRJN0UrI+LolMLOP1/VN4EVIpJ3xVwFo+xqNFRoFvFwJhBvKnk7kpUA==", + "requires": { + "@types/express": "*", + "@types/oauth": "*", + "@types/passport": "*" + } + }, + "@types/passport-strategy": { + "version": "0.2.35", + "resolved": "https://registry.npmjs.org/@types/passport-strategy/-/passport-strategy-0.2.35.tgz", + "integrity": "sha512-o5D19Jy2XPFoX2rKApykY15et3Apgax00RRLf0RUotPDUsYrQa7x4howLYr9El2mlUApHmCMv5CZ1IXqKFQ2+g==", + "requires": { + "@types/express": "*", + "@types/passport": "*" + } + }, + "@types/qs": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.1.tgz", + "integrity": "sha512-lhbQXx9HKZAPgBkISrBcmAcMpZsmpe/Cd/hY7LGZS5OfkySUBItnPZHgQPssWYUET8elF+yCFBbP1Q0RZPTdaw==" + }, + "@types/range-parser": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", + "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==" + }, + "@types/serve-static": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.3.tgz", + "integrity": "sha512-oprSwp094zOglVrXdlo/4bAHtKTAxX6VT8FOZlBKrmyLbNvE1zxZyJ6yikMVtHIvwP45+ZQGJn+FdXGKTozq0g==", + "requires": { + "@types/express-serve-static-core": "*", + "@types/mime": "*" + } + }, + "@typescript-eslint/eslint-plugin": { + "version": "2.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.27.0.tgz", + "integrity": "sha512-/my+vVHRN7zYgcp0n4z5A6HAK7bvKGBiswaM5zIlOQczsxj/aiD7RcgD+dvVFuwFaGh5+kM7XA6Q6PN0bvb1tw==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "2.27.0", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "2.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.27.0.tgz", + "integrity": "sha512-vOsYzjwJlY6E0NJRXPTeCGqjv5OHgRU1kzxHKWJVPjDYGbPgLudBXjIlc+OD1hDBZ4l1DLbOc5VjofKahsu9Jw==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.27.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "2.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.27.0.tgz", + "integrity": "sha512-HFUXZY+EdwrJXZo31DW4IS1ujQW3krzlRjBrFRrJcMDh0zCu107/nRfhk/uBasO8m0NVDbBF5WZKcIUMRO7vPg==", + "dev": true, + "requires": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "2.27.0", + "@typescript-eslint/typescript-estree": "2.27.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.27.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.27.0.tgz", + "integrity": "sha512-t2miCCJIb/FU8yArjAvxllxbTiyNqaXJag7UOpB5DVoM3+xnjeOngtqlJkLRnMtzaRcJhe3CIR9RmL40omubhg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^6.3.0", + "tsutils": "^3.17.1" + } + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "acorn": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz", + "integrity": "sha1-q259nYhqrKiwhbwzEreaGYQz8Oc=" + }, + "acorn-globals": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-1.0.9.tgz", + "integrity": "sha1-VbtemGkVB7dFedBRNBMhfDgMVM8=", + "requires": { + "acorn": "^2.1.0" + } + }, + "acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true + }, + "ajv": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", + "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" + }, + "ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + } + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "asap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/asap/-/asap-1.0.0.tgz", + "integrity": "sha1-sqRdpf36ILBJb8N2jMJ8EvqRan0=" + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base64url": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/base64url/-/base64url-3.0.1.tgz", + "integrity": "sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A==" + }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=" + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "character-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-1.2.1.tgz", + "integrity": "sha1-wN3kqxgnE7kZuXCVmhI+zBow/NY=" + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "clean-css": { + "version": "3.4.28", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-3.4.28.tgz", + "integrity": "sha1-vxlF6C/ICPVWlebd6uwBQA79A/8=", + "requires": { + "commander": "2.8.x", + "source-map": "0.4.x" + }, + "dependencies": { + "commander": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz", + "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=", + "requires": { + "graceful-readlink": ">= 1.0.0" + } + } + } + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "client-sessions": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/client-sessions/-/client-sessions-0.8.0.tgz", + "integrity": "sha1-p9jFVYrV1W8qGZ81M+tlS134k/0=", + "requires": { + "cookies": "^0.7.0" + } + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=" + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "commander": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.6.0.tgz", + "integrity": "sha1-nfflL7Kgyw+4kFjugMMQQiXzfh0=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "constantinople": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/constantinople/-/constantinople-3.0.2.tgz", + "integrity": "sha1-S5RdmTeQe82Y7ldRIsOBdRZUQUE=", + "requires": { + "acorn": "^2.1.0" + } + }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "requires": { + "safe-buffer": "5.1.2" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "cookies": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.7.3.tgz", + "integrity": "sha512-+gixgxYSgQLTaTIilDHAdlNPZDENDQernEMiIcZpYYP14zgHsCt4Ce1FEjFtcp6GefhozebB6orvhAAWx/IS0A==", + "requires": { + "depd": "~1.1.2", + "keygrip": "~1.0.3" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "css": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/css/-/css-1.0.8.tgz", + "integrity": "sha1-k4aBHKgrzMnuf7WnMrHioxfIo+c=", + "requires": { + "css-parse": "1.0.4", + "css-stringify": "1.0.5" + } + }, + "css-parse": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/css-parse/-/css-parse-1.0.4.tgz", + "integrity": "sha1-OLBQP7+dqfVOnB29pg4UXHcRe90=" + }, + "css-stringify": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/css-stringify/-/css-stringify-1.0.5.tgz", + "integrity": "sha1-sNBClG2ylTu50pKQCmy19tASIDE=" + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.3", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + } + } + }, + "eslint-config-prettier": { + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.10.1.tgz", + "integrity": "sha512-svTy6zh1ecQojvpbJSgH3aei/Rt7C6i090l5f2WQ4aB05lYHeZIR1qL4wZyyILTbtmnbHP5Yn8MrsOJMGa8RkQ==", + "dev": true, + "requires": { + "get-stdin": "^6.0.0" + } + }, + "eslint-plugin-eslint-plugin": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-2.2.1.tgz", + "integrity": "sha512-nvmoefIqdFX+skyCt/dN9HaeSNyL8A9UvEtCqCFfJBjKpAR0uRL3SGPLlvDsnfXWtN72G/viowvpA33VjQkGCg==", + "dev": true + }, + "eslint-plugin-mocha": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-6.3.0.tgz", + "integrity": "sha512-Cd2roo8caAyG21oKaaNTj7cqeYRWW1I2B5SfpKRp0Ip1gkfwoR1Ow0IGlPWnNjzywdF4n+kHL8/9vM6zCJUxdg==", + "dev": true, + "requires": { + "eslint-utils": "^2.0.0", + "ramda": "^0.27.0" + } + }, + "eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", + "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "dev": true + }, + "espree": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "acorn": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.2.0.tgz", + "integrity": "sha512-weltsSqdeWIX9G2qQZz7KlTRJdkkOCTPgLYJUz1Hacf48R4YOwGPHO3+ORfWedqJKbq5WQmsgK90n+pFLIKt/Q==", + "dev": true, + "requires": { + "estraverse": "^5.0.0" + }, + "dependencies": { + "estraverse": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.0.0.tgz", + "integrity": "sha512-j3acdrMzqrxmJTNj5dbr1YbjacrYgAxVMeF0gK16E3j494mOe7xygM/ZLIguEQ0ETwAg2hlJCtHRGav+y0Ny5A==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "express-session": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.17.0.tgz", + "integrity": "sha512-t4oX2z7uoSqATbMfsxWMbNjAL0T5zpvcJCk3Z9wnPPN7ibddhnmDZXHfEcoBMG2ojKXZoCyPMc5FbtK+G7SoDg==", + "requires": { + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~2.0.0", + "on-headers": "~1.0.2", + "parseurl": "~1.3.3", + "safe-buffer": "5.2.0", + "uid-safe": "~2.1.5" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + } + } + }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "fast-deep-equal": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + } + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "graceful-readlink": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "inquirer": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "jade": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/jade/-/jade-1.11.0.tgz", + "integrity": "sha1-nIDlOMEtP7lcjZu5VZ+gzAQEBf0=", + "requires": { + "character-parser": "1.2.1", + "clean-css": "^3.1.9", + "commander": "~2.6.0", + "constantinople": "~3.0.1", + "jstransformer": "0.0.2", + "mkdirp": "~0.5.0", + "transformers": "2.1.0", + "uglify-js": "^2.4.19", + "void-elements": "~2.0.1", + "with": "~4.0.0" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "jstransformer": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/jstransformer/-/jstransformer-0.0.2.tgz", + "integrity": "sha1-eq4pqQPRls+glz2IXT5HlH7Ndqs=", + "requires": { + "is-promise": "^2.0.0", + "promise": "^6.0.1" + } + }, + "keygrip": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.0.3.tgz", + "integrity": "sha512-/PpesirAIfaklxUzp4Yb7xBper9MwP6hNRA6BGGUFCgbJ+BM5CKBtsoxinNXkLHAr+GXS1/lSlF2rP7cv5Fl+g==" + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=" + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=" + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "mime-db": { + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" + }, + "mime-types": { + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "requires": { + "mime-db": "1.43.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "requires": { + "minimist": "^1.2.5" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "oauth": { + "version": "0.9.15", + "resolved": "https://registry.npmjs.org/oauth/-/oauth-0.9.15.tgz", + "integrity": "sha1-vR/vr2hslrdUda7VGWQS/2DPucE=" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "openid": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/openid/-/openid-0.5.13.tgz", + "integrity": "sha1-G462yox67m3WJktp2vua14UsKk0=" + }, + "optimist": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", + "integrity": "sha1-yQlBrVnkJzMokjB00s8ufLxuwNk=", + "requires": { + "wordwrap": "~0.0.2" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-event": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.1.0.tgz", + "integrity": "sha512-4vAd06GCsgflX4wHN1JqrMzBh/8QZ4j+rzp0cd2scXRwuBEv+QR3wrVA5aLhWDLw4y2WgDKvzWF3CCLmVM1UgA==", + "requires": { + "p-timeout": "^2.0.1" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-timeout": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz", + "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==", + "requires": { + "p-finally": "^1.0.0" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "passport": { + "version": "0.1.18", + "resolved": "https://registry.npmjs.org/passport/-/passport-0.1.18.tgz", + "integrity": "sha1-yCZEedy2QUytu2Z1LRKzfgtlJaE=", + "requires": { + "pause": "0.0.1", + "pkginfo": "0.2.x" + } + }, + "passport-facebook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/passport-facebook/-/passport-facebook-3.0.0.tgz", + "integrity": "sha512-K/qNzuFsFISYAyC1Nma4qgY/12V3RSLFdFVsPKXiKZt434wOvthFW1p7zKa1iQihQMRhaWorVE1o3Vi1o+ZgeQ==", + "requires": { + "passport-oauth2": "1.x.x" + } + }, + "passport-google": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/passport-google/-/passport-google-0.3.0.tgz", + "integrity": "sha1-xbS0FiZYiSs3Flt5WgH/1Mfhn7c=", + "requires": { + "passport-openid": "0.3.x", + "pkginfo": "0.2.x" + } + }, + "passport-google-oauth2": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/passport-google-oauth2/-/passport-google-oauth2-0.2.0.tgz", + "integrity": "sha512-62EdPtbfVdc55nIXi0p1WOa/fFMM8v/M8uQGnbcXA4OexZWCnfsEi3wo2buag+Is5oqpuHzOtI64JpHk0Xi5RQ==", + "requires": { + "passport-oauth2": "^1.1.2" + } + }, + "passport-local": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/passport-local/-/passport-local-1.0.0.tgz", + "integrity": "sha1-H+YyaMkudWBmJkN+O5BmYsFbpu4=", + "requires": { + "passport-strategy": "1.x.x" + } + }, + "passport-oauth2": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/passport-oauth2/-/passport-oauth2-1.5.0.tgz", + "integrity": "sha512-kqBt6vR/5VlCK8iCx1/KpY42kQ+NEHZwsSyt4Y6STiNjU+wWICG1i8ucc1FapXDGO15C5O5VZz7+7vRzrDPXXQ==", + "requires": { + "base64url": "3.x.x", + "oauth": "0.9.x", + "passport-strategy": "1.x.x", + "uid2": "0.0.x", + "utils-merge": "1.x.x" + } + }, + "passport-openid": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/passport-openid/-/passport-openid-0.3.1.tgz", + "integrity": "sha1-5k3gSFn6UbZSlIAXQSJiHgj6Iss=", + "requires": { + "openid": "0.5.x", + "passport": "~0.1.3", + "pkginfo": "0.2.x" + } + }, + "passport-strategy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", + "integrity": "sha1-tVOaqPwiWj0a0XlHbd8ja0QPUuQ=" + }, + "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=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "pause": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", + "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" + }, + "pkginfo": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.2.3.tgz", + "integrity": "sha1-cjnEKl72wwuPMoQ52bn/cQQkkPg=" + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "promise": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-6.1.0.tgz", + "integrity": "sha1-LOcp9rlLRcJoka0GAsXJDgTG7vY=", + "requires": { + "asap": "~1.0.0" + } + }, + "proxy-addr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz", + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==", + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.1" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" + }, + "ramda": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.27.0.tgz", + "integrity": "sha512-pVzZdDpWwWqEVVLshWUHjNwuVP7SfcmPraYuqocJp1yo2U1R7P+5QAfDhdItkuoGqIBnBYrtPp7rEPqDn9HlZA==", + "dev": true + }, + "random-bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", + "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=" + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "requires": { + "align-text": "^0.1.1" + } + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "run-async": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", + "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rxjs": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + } + } + }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } + } + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "requires": { + "amdefine": ">=0.0.4" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + } + } + }, + "strip-json-comments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" + }, + "transformers": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/transformers/-/transformers-2.1.0.tgz", + "integrity": "sha1-XSPLNVYd2F3Gf7hIIwm0fVPM6ac=", + "requires": { + "css": "~1.0.8", + "promise": "~2.0", + "uglify-js": "~2.2.5" + }, + "dependencies": { + "is-promise": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-1.0.1.tgz", + "integrity": "sha1-MVc3YcBX4zwukaq56W2gjO++duU=" + }, + "promise": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-2.0.0.tgz", + "integrity": "sha1-RmSKqdYFr10ucMMCS/WUNtoCuA4=", + "requires": { + "is-promise": "~1" + } + }, + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "requires": { + "amdefine": ">=0.0.4" + } + }, + "uglify-js": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.2.5.tgz", + "integrity": "sha1-puAqcNg5eSuXgEiLe4sYTAlcmcc=", + "requires": { + "optimist": "~0.3.5", + "source-map": "~0.1.7" + } + } + } + }, + "tslib": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" + }, + "tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "typescript": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", + "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "optional": true + }, + "uid-safe": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", + "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", + "requires": { + "random-bytes": "~1.0.0" + } + }, + "uid2": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", + "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=" + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "dev": true + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "void-elements": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", + "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=" + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=" + }, + "with": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/with/-/with-4.0.3.tgz", + "integrity": "sha1-7v0VTp550sjTQXtkeo8U2f7M4U4=", + "requires": { + "acorn": "^1.0.1", + "acorn-globals": "^1.0.3" + }, + "dependencies": { + "acorn": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-1.2.2.tgz", + "integrity": "sha1-yM4n3grMdtiW0rH6099YjZ6C8BQ=" + } + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + } + } +} diff --git a/examples/passport-login/package.json b/examples/passport-login/package.json new file mode 100644 index 000000000000..d2e21a55cb6b --- /dev/null +++ b/examples/passport-login/package.json @@ -0,0 +1,91 @@ +{ + "name": "@loopback/passport-login", + "version": "1.0.0", + "description": "examples to demonstrate authentication with passport strategies", + "main": "index.js", + "engines": { + "node": ">=10" + }, + "scripts": { + "build": "lb-tsc", + "build:watch": "lb-tsc --watch", + "clean": "lb-clean dist *.tsbuildinfo package", + "lint": "npm run prettier:check && npm run eslint", + "lint:fix": "npm run eslint:fix && npm run prettier:fix", + "prettier:cli": "lb-prettier \"**/*.ts\" \"**/*.js\"", + "prettier:check": "npm run prettier:cli -- -l", + "prettier:fix": "npm run prettier:cli -- --write", + "eslint": "lb-eslint --report-unused-disable-directives .", + "eslint:fix": "npm run eslint -- --fix", + "pretest": "npm run clean && npm run build", + "test": "lb-mocha \"dist/__tests__/**/*.js\"", + "posttest": "npm run lint", + "test:dev": "lb-mocha --allow-console-logs dist/__tests__/**/*.js && npm run posttest", + "migrate": "node ./dist/migrate", + "prestart": "npm run build", + "start": "node .", + "prepublishOnly": "npm run test" + }, + "repository": { + "type": "git", + "url": "https://github.com/strongloop/loopback-next.git", + "directory": "examples/passport-login" + }, + "author": "IBM Corp.", + "license": "MIT", + "dependencies": { + "@loopback/authentication": "^4.1.1", + "@loopback/authentication-passport": "^2.0.0", + "@loopback/boot": "2.0.2", + "@loopback/context": "3.2.0", + "@loopback/core": "2.2.0", + "@loopback/openapi-v3": "3.1.1", + "@loopback/repository": "2.0.2", + "@loopback/rest": "3.1.0", + "@loopback/security": "0.2.2", + "@loopback/service-proxy": "2.0.2", + "@types/jsonwebtoken": "8.3.8", + "@types/lodash": "^4.14.149", + "@types/passport-facebook": "^2.1.9", + "@types/passport-google-oauth": "^1.0.41", + "@types/passport-google-oauth2": "^0.1.3", + "@types/passport-local": "^1.0.33", + "@types/passport-oauth2": "^1.4.9", + "body-parser": "^1.19.0", + "client-sessions": "^0.8.0", + "debug": "4.1.1", + "express": "4.17.1", + "express-session": "^1.17.0", + "jade": "^1.7.0", + "lodash": "^4.17.15", + "p-event": "^4.1.0", + "passport-facebook": "^3.0.0", + "passport-google": "^0.3.0", + "passport-google-oauth2": "^0.2.0", + "passport-local": "^1.0.0", + "passport-oauth2": "^1.5.0", + "tslib": "^1.11.1" + }, + "devDependencies": { + "@loopback/build": "^5.0.0", + "@loopback/eslint-config": "^6.0.2", + "@loopback/testlab": "^2.0.2", + "@types/express": "^4.17.3", + "@types/node": "^10.17.17", + "@typescript-eslint/eslint-plugin": "^2.25.0", + "@typescript-eslint/parser": "^2.25.0", + "eslint": "^6.8.0", + "eslint-config-prettier": "^6.10.1", + "eslint-plugin-eslint-plugin": "^2.2.1", + "eslint-plugin-mocha": "^6.3.0", + "typescript": "~3.8.3" + }, + "keywords": [ + "loopback", + "LoopBack", + "example", + "tutorial", + "passport", + "authentication" + ] +} diff --git a/examples/passport-login/public/index.html b/examples/passport-login/public/index.html new file mode 100644 index 000000000000..dc7475689f3b --- /dev/null +++ b/examples/passport-login/public/index.html @@ -0,0 +1,73 @@ + + + + + passport facebook + + + + + + + + + + +
+

passport-facebook

+

Version 1.0.0

+ +

OpenAPI spec: /openapi.json

+

API Explorer: /explorer

+
+ + + + + diff --git a/examples/passport-login/src/application.ts b/examples/passport-login/src/application.ts new file mode 100644 index 000000000000..0e3cf8d4bfbe --- /dev/null +++ b/examples/passport-login/src/application.ts @@ -0,0 +1,60 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import {BootMixin} from '@loopback/boot'; +import {RepositoryMixin} from '@loopback/repository'; +import {RestApplication} from '@loopback/rest'; +import {ServiceMixin} from '@loopback/service-proxy'; +import {MySequence} from './sequence'; +import { + AuthenticationComponent, + AuthenticationBindings, +} from '@loopback/authentication'; +import {Oauth2Controller} from './controllers'; +import { + FaceBookOauth2Authorization, + GoogleOauth2Authorization, + Oauth2AuthStrategy, + LocalAuthStrategy, +} from './authentication-strategies'; +import {PassportUserIdentityService, UserServiceBindings} from './services'; +import {ApplicationConfig, createBindingFromClass} from '@loopback/core'; + +export class Oauth2LoginApplication extends BootMixin( + ServiceMixin(RepositoryMixin(RestApplication)), +) { + constructor(options: ApplicationConfig = {}) { + super(options); + + this.setUpBindings(); + + // Set up the custom sequence + this.sequence(MySequence); + + this.controller(Oauth2Controller); + this.component(AuthenticationComponent); + + this.projectRoot = __dirname; + // Customize @loopback/boot Booter Conventions here + this.bootOptions = { + controllers: { + // Customize ControllerBooter Conventions here + dirs: ['controllers'], + extensions: ['.controller.js'], + nested: true, + }, + }; + } + + setUpBindings(): void { + this.bind(UserServiceBindings.PASSPORT_USER_IDENTITY_SERVICE).toClass( + PassportUserIdentityService, + ); + this.add(createBindingFromClass(LocalAuthStrategy)); + this.add(createBindingFromClass(FaceBookOauth2Authorization)); + this.add(createBindingFromClass(GoogleOauth2Authorization)); + this.add(createBindingFromClass(Oauth2AuthStrategy)); + } +} diff --git a/examples/passport-login/src/authentication-strategies/facebook.ts b/examples/passport-login/src/authentication-strategies/facebook.ts new file mode 100644 index 000000000000..26d69e71b3af --- /dev/null +++ b/examples/passport-login/src/authentication-strategies/facebook.ts @@ -0,0 +1,99 @@ +// Copyright IBM Corp. 2019. All Rights Reserved. +// Node module: example-passport-oauth2-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import { + asAuthStrategy, + AuthenticationStrategy, + UserIdentityService, + AuthenticationBindings, +} from '@loopback/authentication'; +import {StrategyAdapter} from '@loopback/authentication-passport'; +import {Profile} from 'passport'; +import {Strategy, StrategyOption} from 'passport-facebook'; +import {bind, inject} from '@loopback/context'; +import {UserServiceBindings} from '../services'; +import {extensionFor} from '@loopback/core'; +import {securityId, UserProfile} from '@loopback/security'; +import {User} from '../models'; +import {Request, RedirectRoute} from '@loopback/rest'; +import {PassportAuthenticationBindings} from './oauth2'; + +@bind( + asAuthStrategy, + extensionFor(PassportAuthenticationBindings.OAUTH2_STRATEGY), +) +export class FaceBookOauth2Authorization implements AuthenticationStrategy { + name = 'oauth2-facebook'; + protected strategy: StrategyAdapter; + passportstrategy: Strategy; + + /** + * create an oauth2 strategy for facebook + */ + constructor( + @inject(UserServiceBindings.PASSPORT_USER_IDENTITY_SERVICE) + public userService: UserIdentityService, + @inject('facebookOAuth2Options') + public facebookOptions: StrategyOption, + ) { + this.passportstrategy = new Strategy( + facebookOptions, + this.verify.bind(this), + ); + this.strategy = new StrategyAdapter( + this.passportstrategy, + this.name, + this.mapProfile.bind(this), + ); + } + + /** + * verify function for the oauth2 strategy + * + * @param accessToken + * @param refreshToken + * @param profile + * @param done + */ + verify( + accessToken: string, + refreshToken: string, + profile: Profile, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + done: (error: any, user?: any, info?: any) => void, + ) { + // look up a linked user for the profile + this.userService + .findOrCreateUser(profile) + .then((user: User) => { + done(null, user); + }) + .catch((err: Error) => { + done(err); + }); + } + + /** + * authenticate a request + * @param request + */ + async authenticate(request: Request): Promise { + return this.strategy.authenticate(request); + } + + /** + * map passport profile to user profile + * @param user + */ + mapProfile(user: User): UserProfile { + const userProfile: UserProfile = { + [securityId]: '' + user.id, + profile: { + ...user, + }, + }; + return userProfile; + } +} diff --git a/examples/passport-login/src/authentication-strategies/google.ts b/examples/passport-login/src/authentication-strategies/google.ts new file mode 100644 index 000000000000..0690eb4602c1 --- /dev/null +++ b/examples/passport-login/src/authentication-strategies/google.ts @@ -0,0 +1,96 @@ +// Copyright IBM Corp. 2019. All Rights Reserved. +// Node module: example-passport-oauth2-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import { + asAuthStrategy, + AuthenticationStrategy, + UserIdentityService, + AuthenticationBindings, +} from '@loopback/authentication'; +import {StrategyAdapter} from '@loopback/authentication-passport'; +import {Profile} from 'passport'; +import {Strategy, StrategyOptions} from 'passport-google-oauth2'; +import {bind, inject} from '@loopback/context'; +import {UserServiceBindings} from '../services'; +import {extensionFor} from '@loopback/core'; +import {securityId, UserProfile} from '@loopback/security'; +import {User} from '../models'; +import {Request, RedirectRoute} from '@loopback/rest'; +import {PassportAuthenticationBindings} from './oauth2'; + +@bind( + asAuthStrategy, + extensionFor(PassportAuthenticationBindings.OAUTH2_STRATEGY), +) +export class GoogleOauth2Authorization implements AuthenticationStrategy { + name = 'oauth2-google'; + passportstrategy: Strategy; + protected strategy: StrategyAdapter; + + /** + * create an oauth2 strategy for google + */ + constructor( + @inject(UserServiceBindings.PASSPORT_USER_IDENTITY_SERVICE) + public userService: UserIdentityService, + @inject('googleOAuth2Options') + public googleOptions: StrategyOptions, + ) { + this.passportstrategy = new Strategy(googleOptions, this.verify.bind(this)); + this.strategy = new StrategyAdapter( + this.passportstrategy, + this.name, + this.mapProfile, + ); + } + + /** + * verify function for the oauth2 strategy + * + * @param accessToken + * @param refreshToken + * @param profile + * @param done + */ + verify( + accessToken: string, + refreshToken: string, + profile: Profile, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + done: (error: any, user?: any, info?: any) => void, + ) { + // look up a linked user for the profile + this.userService + .findOrCreateUser(profile) + .then((user: User) => { + done(null, user); + }) + .catch((err: Error) => { + done(err); + }); + } + + /** + * authenticate a request + * @param request + */ + async authenticate(request: Request): Promise { + return this.strategy.authenticate(request); + } + + /** + * map passport profile to user profile + * @param user + */ + mapProfile(user: User): UserProfile { + const userProfile: UserProfile = { + [securityId]: '' + user.id, + profile: { + ...user, + }, + }; + return userProfile; + } +} diff --git a/examples/passport-login/src/authentication-strategies/index.ts b/examples/passport-login/src/authentication-strategies/index.ts new file mode 100644 index 000000000000..fe6792497ad8 --- /dev/null +++ b/examples/passport-login/src/authentication-strategies/index.ts @@ -0,0 +1,9 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +export * from './oauth2'; +export * from './facebook'; +export * from './google'; +export * from './local'; diff --git a/examples/passport-login/src/authentication-strategies/local.ts b/examples/passport-login/src/authentication-strategies/local.ts new file mode 100644 index 000000000000..68ce5a2fc63f --- /dev/null +++ b/examples/passport-login/src/authentication-strategies/local.ts @@ -0,0 +1,119 @@ +// Copyright IBM Corp. 2019. All Rights Reserved. +// Node module: example-passport-oauth2-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import { + AuthenticationStrategy, + asAuthStrategy, + AuthenticationBindings, +} from '@loopback/authentication'; +import {StrategyAdapter} from '@loopback/authentication-passport'; +import {Request, RedirectRoute} from '@loopback/rest'; +import {UserProfile, securityId} from '@loopback/security'; +import {User} from '../models'; +import {bind} from '@loopback/context'; +import {Strategy, IVerifyOptions} from 'passport-local'; +import {repository} from '@loopback/repository'; +import {UserRepository} from '../repositories'; +import {extensionFor} from '@loopback/core'; + +@bind( + asAuthStrategy, + extensionFor( + AuthenticationBindings.AUTHENTICATION_STRATEGY_EXTENSION_POINT_NAME, + ), +) +export class LocalAuthStrategy implements AuthenticationStrategy { + name = 'local'; + passportstrategy: Strategy; + strategy: StrategyAdapter; + + /** + * create a local passport strategy + */ + constructor( + @repository(UserRepository) + public userRepository: UserRepository, + ) { + /** + * create a local passport strategy with verify function to validate credentials + */ + this.passportstrategy = new Strategy( + { + usernameField: 'email', + passwordField: 'password', + session: false, + }, + this.verify.bind(this), + ); + /** + * wrap the passport strategy instance with an adapter to plugin to LoopBack authentication + */ + this.strategy = new StrategyAdapter( + this.passportstrategy, + this.name, + this.mapProfile.bind(this), + ); + } + + /** + * authenticate a request + * @param request + */ + async authenticate(request: Request): Promise { + return this.strategy.authenticate(request); + } + + /** + * authenticate user with provided username and password + * + * @param username + * @param password + * @param done + * + * @returns User model + */ + verify( + username: string, + password: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + done: (error: any, user?: any, options?: IVerifyOptions) => void, + ): void { + this.userRepository + .find({ + where: { + email: username, + }, + include: [ + { + relation: 'profiles', + }, + ], + }) + .then(user => { + if (!user) { + return done(new Error('User not found')); + } + done(null, user); + }) + .catch(err => { + done(err); + }); + } + + /** + * maps returned User model from verify function to UserProfile + * + * @param user + */ + mapProfile(user: User): UserProfile { + const userProfile: UserProfile = { + [securityId]: '' + user.id, + profile: { + ...user, + }, + }; + return userProfile; + } +} diff --git a/examples/passport-login/src/authentication-strategies/oauth2.ts b/examples/passport-login/src/authentication-strategies/oauth2.ts new file mode 100644 index 000000000000..6737c7e1cc90 --- /dev/null +++ b/examples/passport-login/src/authentication-strategies/oauth2.ts @@ -0,0 +1,123 @@ +// Copyright IBM Corp. 2019. All Rights Reserved. +// Node module: example-passport-oauth2-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import { + AuthenticationStrategy, + UserIdentityService, + asAuthStrategy, + AuthenticationBindings, +} from '@loopback/authentication'; +import {StrategyAdapter} from '@loopback/authentication-passport'; +import {Profile} from 'passport'; +import {Strategy, StrategyOptions} from 'passport-oauth2'; +import {Request, RedirectRoute} from '@loopback/rest'; +import {UserProfile, securityId} from '@loopback/security'; +import {User} from '../models'; +import {UserServiceBindings} from '../services'; +import {inject, bind, extensions, Getter} from '@loopback/core'; + +export namespace PassportAuthenticationBindings { + export const OAUTH2_STRATEGY = 'passport.authentication.oauth2.strategy'; +} + +@bind(asAuthStrategy) +export class Oauth2AuthStrategy implements AuthenticationStrategy { + name = 'oauth2'; + passportstrategy: Strategy; + protected strategy: StrategyAdapter; + + /** + * create an oauth2 strategy + */ + constructor( + /** + * enable extensions for provider specific oauth2 implementations + * reroute to the specific extension based on given provider name + */ + @extensions(PassportAuthenticationBindings.OAUTH2_STRATEGY) + private getStrategies: Getter, + @inject(UserServiceBindings.PASSPORT_USER_IDENTITY_SERVICE) + public userService: UserIdentityService, + @inject('customOAuth2Options') + public oauth2Options: StrategyOptions, + ) { + /** + * Create a oauth2 strategy instance for a custom provider implementation + */ + this.passportstrategy = new Strategy(oauth2Options, this.verify.bind(this)); + this.strategy = new StrategyAdapter( + this.passportstrategy, + this.name, + this.mapProfile.bind(this), + ); + } + + /** + * verify function for the oauth2 strategy + * + * @param accessToken + * @param refreshToken + * @param profile + * @param done + */ + verify( + accessToken: string, + refreshToken: string, + profile: Profile, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + done: (error: any, user?: any, info?: any) => void, + ) { + // look up a linked user for the profile + this.userService + .findOrCreateUser(profile) + .then((user: User) => { + done(null, user); + }) + .catch((err: Error) => { + done(err); + }); + } + + /** + * authenticate a request + * @param request + */ + async authenticate(request: Request): Promise { + if ( + request.query['oauth2-provider-name'] && + request.query['oauth2-provider-name'] !== 'oauth2' + ) { + /** + * if provider name is given then reroute to the provider extension + */ + const providerName = request.query['oauth2-provider-name']; + const strategies: Oauth2AuthStrategy[] = await this.getStrategies(); + const strategy = strategies.find( + (s: Oauth2AuthStrategy) => s.name === 'oauth2-' + providerName, + ); + if (!strategy) throw new Error('provider not found'); + return strategy.authenticate(request); + } else { + /** + * provider not given, use passport-oauth2 for custom provider implementation + */ + return this.strategy.authenticate(request); + } + } + + /** + * map passport profile to user profile + * @param user + */ + mapProfile(user: User): UserProfile { + const userProfile: UserProfile = { + [securityId]: '' + user.id, + profile: { + ...user, + }, + }; + return userProfile; + } +} diff --git a/examples/passport-login/src/controllers/index.ts b/examples/passport-login/src/controllers/index.ts new file mode 100644 index 000000000000..3fb31923d95b --- /dev/null +++ b/examples/passport-login/src/controllers/index.ts @@ -0,0 +1 @@ +export * from './oauth2.controller'; diff --git a/examples/passport-login/src/controllers/oauth2.controller.ts b/examples/passport-login/src/controllers/oauth2.controller.ts new file mode 100644 index 000000000000..b564464f56b7 --- /dev/null +++ b/examples/passport-login/src/controllers/oauth2.controller.ts @@ -0,0 +1,64 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import { + get, + RestBindings, + Response, + RequestWithSession, + param, +} from '@loopback/rest'; +import {authenticate} from '@loopback/authentication'; +import {inject} from '@loopback/core'; +import {SecurityBindings, UserProfile} from '@loopback/security'; + +/** + * Login controller for third party oauth provider + */ +export class Oauth2Controller { + constructor() {} + + @authenticate('oauth2') + @get('/auth/thirdparty/{provider}') + /** + * Endpoint: '/auth/thirdparty/{provider}' + * an endpoint for api clients to login via a third party app, redirects to third party app + */ + loginToThirdParty( + @param.path.string('provider') provider: string, + @inject('authentication.redirect.url') + redirectUrl: string, + @inject('authentication.redirect.status') + status: number, + @inject(RestBindings.Http.RESPONSE) + response: Response, + ) { + response.statusCode = status || 302; + response.setHeader('Location', redirectUrl); + response.end(); + return response; + } + + @authenticate('oauth2') + @get('/auth/thirdparty/{provider}/callback') + /** + * Endpoint: '/auth/thirdparty/{provider}/callback' + * an endpoint which serves as a oauth2 callback for the thirdparty app + * this endpoint sets the user profile in the session + */ + async thirdPartyCallBack( + @param.path.string('provider') provider: string, + @inject(SecurityBindings.USER) user: UserProfile, + @inject(RestBindings.Http.REQUEST) request: RequestWithSession, + @inject(RestBindings.Http.RESPONSE) response: Response, + ) { + const profile = { + ...user.profile, + }; + request.session.user = profile; + response.redirect('/auth/account'); + return response; + } +} diff --git a/examples/passport-login/src/controllers/user.controller.ts b/examples/passport-login/src/controllers/user.controller.ts new file mode 100644 index 000000000000..52d0151fab8c --- /dev/null +++ b/examples/passport-login/src/controllers/user.controller.ts @@ -0,0 +1,89 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-access-control-migration +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import {inject} from '@loopback/context'; +import { + post, + requestBody, + Response, + RestBindings, + RequestWithSession, +} from '@loopback/rest'; +import {UserRepository} from '../repositories'; +import {repository} from '@loopback/repository'; +import {SecurityBindings, UserProfile} from '@loopback/security'; +import {authenticate} from '@loopback/authentication'; + +export type Credentials = { + email: string; + password: string; + name: string; +}; + +const CredentialsSchema = { + type: 'object', + required: ['email', 'password'], + properties: { + email: { + type: 'string', + format: 'email', + }, + password: { + type: 'string', + minLength: 8, + }, + }, +}; + +export class UserController { + constructor( + @repository(UserRepository) + public userRepository: UserRepository, + ) {} + + @post('/users/signup') + async signup( + @requestBody({ + description: 'signup user locally', + required: true, + content: { + 'application/x-www-form-urlencoded': {schema: CredentialsSchema}, + }, + }) + credentials: Credentials, + @inject(RestBindings.Http.RESPONSE) response: Response, + ) { + await this.userRepository.create({ + email: credentials.email, + username: credentials.email, + name: credentials.name, + }); + response.redirect('/login'); + return response; + } + + @authenticate('local') + @post('/login') + async login( + @requestBody({ + description: 'login to create a user session', + required: true, + content: { + 'application/x-www-form-urlencoded': {schema: CredentialsSchema}, + }, + }) + credentials: Credentials, + @inject(SecurityBindings.USER) user: UserProfile, + @inject(RestBindings.Http.REQUEST) request: RequestWithSession, + @inject(RestBindings.Http.RESPONSE) response: Response, + ) { + const profile = { + ...user.profile, + }; + request.session.user = profile; + response.redirect('/auth/account'); + return response; + } +} diff --git a/examples/passport-login/src/datasources/db.datasource.config.json b/examples/passport-login/src/datasources/db.datasource.config.json new file mode 100644 index 000000000000..a68f220be986 --- /dev/null +++ b/examples/passport-login/src/datasources/db.datasource.config.json @@ -0,0 +1,6 @@ +{ + "name": "db", + "connector": "memory", + "localStorage": "", + "file": "./data/db.json" +} diff --git a/examples/passport-login/src/datasources/db.datasource.ts b/examples/passport-login/src/datasources/db.datasource.ts new file mode 100644 index 000000000000..d99f3ee90c8e --- /dev/null +++ b/examples/passport-login/src/datasources/db.datasource.ts @@ -0,0 +1,19 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import {inject} from '@loopback/core'; +import {juggler} from '@loopback/repository'; +import config from './db.datasource.config.json'; + +export class DbDataSource extends juggler.DataSource { + static dataSourceName = 'db'; + + constructor( + @inject('datasources.config.db', {optional: true}) + dsConfig: object = config, + ) { + super(dsConfig); + } +} diff --git a/examples/passport-login/src/datasources/index.ts b/examples/passport-login/src/datasources/index.ts new file mode 100644 index 000000000000..ab4f0dc4e8a0 --- /dev/null +++ b/examples/passport-login/src/datasources/index.ts @@ -0,0 +1,6 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +export * from './db.datasource'; diff --git a/examples/passport-login/src/index.ts b/examples/passport-login/src/index.ts new file mode 100644 index 000000000000..093bffaacc7d --- /dev/null +++ b/examples/passport-login/src/index.ts @@ -0,0 +1,16 @@ +// Copyright IBM Corp. 2019. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import {ApplicationConfig} from '@loopback/core'; +import {ExpressServer} from './server'; + +export {ExpressServer}; + +export async function main(options: ApplicationConfig = {}) { + const server = new ExpressServer(options); + await server.boot(); + await server.start(); + console.log(`Server is running at ${server.url}`); +} diff --git a/examples/passport-login/src/models/index.ts b/examples/passport-login/src/models/index.ts new file mode 100644 index 000000000000..187e4f1e819c --- /dev/null +++ b/examples/passport-login/src/models/index.ts @@ -0,0 +1,8 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +export * from './user.model'; +export * from './user-credentials.model'; +export * from './user-identity.model'; diff --git a/examples/passport-login/src/models/user-credentials.model.ts b/examples/passport-login/src/models/user-credentials.model.ts new file mode 100644 index 000000000000..dc9f220c4f01 --- /dev/null +++ b/examples/passport-login/src/models/user-credentials.model.ts @@ -0,0 +1,35 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import {Entity, model, property} from '@loopback/repository'; + +@model({ + settings: { + hiddenProperties: ['password'], + }, +}) +export class UserCredentials extends Entity { + @property({ + type: 'number', + id: true, + }) + id: number; + + @property({ + type: 'string', + required: true, + }) + password: string; + + @property({ + type: 'number', + required: true, + }) + userId: number; + + constructor(data?: Partial) { + super(data); + } +} diff --git a/examples/passport-login/src/models/user-identity.model.ts b/examples/passport-login/src/models/user-identity.model.ts new file mode 100644 index 000000000000..a349c6a47d24 --- /dev/null +++ b/examples/passport-login/src/models/user-identity.model.ts @@ -0,0 +1,54 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import {Entity, model, property} from '@loopback/repository'; + +@model() +export class UserIdentity extends Entity { + @property({ + type: 'string', + id: 1, + }) + id: string; + + @property({ + type: 'string', + required: true, + }) + provider: string; + + @property({ + type: 'object', + required: true, + }) + profile: object; + + @property({ + type: 'object', + }) + credentials?: object; + + @property({ + type: 'string', + required: true, + }) + authScheme: string; + + @property({ + type: 'date', + required: true, + }) + created?: Date; + + @property({ + type: 'number', + required: true, + }) + userId: number; + + constructor(data?: Partial) { + super(data); + } +} diff --git a/examples/passport-login/src/models/user.model.ts b/examples/passport-login/src/models/user.model.ts new file mode 100644 index 000000000000..e011f185795a --- /dev/null +++ b/examples/passport-login/src/models/user.model.ts @@ -0,0 +1,69 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import {Entity, model, property, hasOne, hasMany} from '@loopback/repository'; +import {UserCredentials} from './user-credentials.model'; +import {UserIdentity} from './user-identity.model'; + +@model() +export class User extends Entity { + @property({ + type: 'number', + id: 1, + generated: true, + }) + id: number; + + @property({ + type: 'string', + required: true, + }) + name: string; + + @property({ + type: 'string', + }) + realm?: string; + + // must keep it + @property({ + type: 'string', + required: true, + }) + username: string; + + // must keep it + @property({ + type: 'string', + required: true, + }) + email: string; + + @property({ + type: 'boolean', + }) + emailVerified?: boolean; + + @property({ + type: 'string', + }) + verificationToken?: string; + + @hasOne(() => UserCredentials) + userCredentials?: UserCredentials; + + @hasMany(() => UserIdentity) + profiles?: UserIdentity[]; + + constructor(data?: Partial) { + super(data); + } +} + +export interface UserRelations { + // describe navigational properties here +} + +export type UserWithRelations = User & UserRelations; diff --git a/examples/passport-login/src/repositories/index.ts b/examples/passport-login/src/repositories/index.ts new file mode 100644 index 000000000000..1c2c572030cc --- /dev/null +++ b/examples/passport-login/src/repositories/index.ts @@ -0,0 +1,6 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +export * from './user.repository'; diff --git a/examples/passport-login/src/repositories/user-credentials.repository.ts b/examples/passport-login/src/repositories/user-credentials.repository.ts new file mode 100644 index 000000000000..f74c05f512b6 --- /dev/null +++ b/examples/passport-login/src/repositories/user-credentials.repository.ts @@ -0,0 +1,19 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import {DefaultCrudRepository} from '@loopback/repository'; +import {UserCredentials} from '../models'; +import {DbDataSource} from '../datasources'; +import {inject} from '@loopback/core'; + +export class UserCredentialsRepository extends DefaultCrudRepository< + UserCredentials, + typeof UserCredentials.prototype.id, + UserCredentials +> { + constructor(@inject('datasources.db') dataSource: DbDataSource) { + super(UserCredentials, dataSource); + } +} diff --git a/examples/passport-login/src/repositories/user-identity.repository.ts b/examples/passport-login/src/repositories/user-identity.repository.ts new file mode 100644 index 000000000000..d7ca54c26cb0 --- /dev/null +++ b/examples/passport-login/src/repositories/user-identity.repository.ts @@ -0,0 +1,19 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import {DefaultCrudRepository} from '@loopback/repository'; +import {UserIdentity} from '../models'; +import {DbDataSource} from '../datasources'; +import {inject} from '@loopback/core'; + +export class UserIdentityRepository extends DefaultCrudRepository< + UserIdentity, + typeof UserIdentity.prototype.id, + UserIdentity +> { + constructor(@inject('datasources.db') dataSource: DbDataSource) { + super(UserIdentity, dataSource); + } +} diff --git a/examples/passport-login/src/repositories/user.repository.ts b/examples/passport-login/src/repositories/user.repository.ts new file mode 100644 index 000000000000..590fde4d7ae8 --- /dev/null +++ b/examples/passport-login/src/repositories/user.repository.ts @@ -0,0 +1,37 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import {inject, Getter} from '@loopback/core'; +import { + DefaultCrudRepository, + HasManyRepositoryFactory, + repository, +} from '@loopback/repository'; +import {DbDataSource} from '../datasources'; +import {User, UserIdentity} from '../models'; +import {UserIdentityRepository} from './user-identity.repository'; + +export class UserRepository extends DefaultCrudRepository< + User, + typeof User.prototype.id +> { + public readonly profiles: HasManyRepositoryFactory< + UserIdentity, + typeof User.prototype.id + >; + + constructor( + @inject('datasources.db') dataSource: DbDataSource, + @repository.getter('UserIdentityRepository') + protected profilesGetter: Getter, + ) { + super(User, dataSource); + this.profiles = this.createHasManyRepositoryFactoryFor( + 'profiles', + profilesGetter, + ); + this.registerInclusionResolver('profiles', this.profiles.inclusionResolver); + } +} diff --git a/examples/passport-login/src/sequence.ts b/examples/passport-login/src/sequence.ts new file mode 100644 index 000000000000..5806896dd6ad --- /dev/null +++ b/examples/passport-login/src/sequence.ts @@ -0,0 +1,115 @@ +// Copyright IBM Corp. 2019. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import { + AuthenticateFn, + AuthenticationBindings, + AUTHENTICATION_STRATEGY_NOT_FOUND, + USER_PROFILE_NOT_FOUND, +} from '@loopback/authentication'; +import {inject} from '@loopback/context'; +import { + FindRoute, + InvokeMethod, + ParseParams, + Reject, + RequestContext, + RestBindings, + Send, + SequenceHandler, +} from '@loopback/rest'; +import {StrategyOption} from 'passport-facebook'; +import {StrategyOptions} from 'passport-google-oauth2'; +import {StrategyOptions as CustomOAuth2Options} from 'passport-oauth2'; +const oauth2Providers = require('../../oauth2-providers'); + +/** + * needs improvement + * TODO: + * 1. read provider specific options from a datastore + * 2. store oauth2 provider registrations, ie, app registrations in the datastore, + * so that client_id and client_secrets can be stored securely + */ +const facebookOptions: StrategyOption = { + clientID: + process.env.FACEBOOK_APPID ?? oauth2Providers['facebook-login'].clientID, + clientSecret: oauth2Providers['facebook-login'].clientSecret, + callbackURL: oauth2Providers['facebook-login'].callbackURL, + profileFields: oauth2Providers['facebook-login'].profileFields, +}; + +const googleOptions: StrategyOptions = { + clientID: + process.env.GOOGLE_APPID ?? oauth2Providers['google-login'].clientID, + clientSecret: oauth2Providers['google-login'].clientSecret, + callbackURL: oauth2Providers['google-login'].callbackURL, + scope: oauth2Providers['google-login'].scope, +}; + +const oauth2Options: CustomOAuth2Options = { + clientID: oauth2Providers['oauth2'].clientID, + clientSecret: oauth2Providers['oauth2'].clientSecret, + callbackURL: oauth2Providers['oauth2'].callbackURL, + authorizationURL: oauth2Providers['oauth2'].authorizationURL, + tokenURL: oauth2Providers['oauth2'].tokenURL, +}; + +const SequenceActions = RestBindings.SequenceActions; + +export class MySequence implements SequenceHandler { + constructor( + @inject(SequenceActions.FIND_ROUTE) protected findRoute: FindRoute, + @inject(SequenceActions.PARSE_PARAMS) + protected parseParams: ParseParams, + @inject(SequenceActions.INVOKE_METHOD) protected invoke: InvokeMethod, + @inject(SequenceActions.SEND) protected send: Send, + @inject(SequenceActions.REJECT) protected reject: Reject, + @inject(AuthenticationBindings.AUTH_ACTION) + protected authenticateRequest: AuthenticateFn, + ) {} + + async handle(context: RequestContext) { + try { + const {request, response} = context; + const route = this.findRoute(request); + + // usually authentication is done before proceeding to parse params + // but in our case we need the path params to know the provider name + const args = await this.parseParams(request, route); + + /** + * bind the oauth2 options to request context + * + * TODO: + * bind secrets like client_id and client_secret from here, + * read secrets specific to this request from a datastore + */ + context.bind('facebookOAuth2Options').to(facebookOptions); + context.bind('googleOAuth2Options').to(googleOptions); + context.bind('customOAuth2Options').to(oauth2Options); + + // if provider name is available in the request path params, set it in the query + if (route.pathParams && route.pathParams.provider) { + request.query['oauth2-provider-name'] = route.pathParams.provider; + } + + //call authentication action + await this.authenticateRequest(request); + + // Authentication successful, proceed to invoke controller + const result = await this.invoke(route, args); + this.send(response, result); + } catch (error) { + if ( + error.code === AUTHENTICATION_STRATEGY_NOT_FOUND || + error.code === USER_PROFILE_NOT_FOUND + ) { + Object.assign(error, {statusCode: 401 /* Unauthorized */}); + } + this.reject(context, error); + return; + } + } +} diff --git a/examples/passport-login/src/server.ts b/examples/passport-login/src/server.ts new file mode 100644 index 000000000000..96ec09e873da --- /dev/null +++ b/examples/passport-login/src/server.ts @@ -0,0 +1,70 @@ +// Copyright IBM Corp. 2019. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import {ApplicationConfig} from '@loopback/core'; +import express from 'express'; +import http from 'http'; +import {AddressInfo} from 'net'; +import pEvent from 'p-event'; +import {Oauth2LoginApplication} from './application'; + +/** + * an express server which embeds an express web app and a LB4 API server + * + * The LB4 API server serves to provide Oauth2 interfaces with external providers + */ +export class ExpressServer { + /** + * An express web app which requires local authentication + */ + private webApp: express.Application; + public readonly lbApp: Oauth2LoginApplication; + private server?: http.Server; + public url: String; + + constructor(options: ApplicationConfig = {}) { + // Express Web App + this.webApp = require('../web-application/express-app'); + + // LB4 App + this.lbApp = new Oauth2LoginApplication(options); + + /** + * Mount the LoopBack app in express: + * + * We are able to wrap the LoopBack apis with express middleware + * for saving user profiles as login sessions + */ + this.webApp.use('/api', this.lbApp.requestHandler); + } + + public async boot() { + await this.lbApp.boot(); + } + + /** + * Start the express app and the lb4 app + */ + public async start() { + await this.lbApp.start(); + const port = this.lbApp.restServer.config.port ?? 3000; + const host = this.lbApp.restServer.config.host ?? 'localhost'; + this.server = this.webApp.listen(port, host); + await pEvent(this.server, 'listening'); + const add = this.server.address(); + this.url = `https://${add.address}:${add.port}`; + } + + /** + * Stop lb4 and express apps + */ + public async stop() { + if (!this.server) return; + await this.lbApp.stop(); + this.server.close(); + await pEvent(this.server, 'close'); + this.server = undefined; + } +} diff --git a/examples/passport-login/src/services/index.ts b/examples/passport-login/src/services/index.ts new file mode 100644 index 000000000000..a0035d37f352 --- /dev/null +++ b/examples/passport-login/src/services/index.ts @@ -0,0 +1,2 @@ +export * from './user.service'; +export * from './keys'; diff --git a/examples/passport-login/src/services/keys.ts b/examples/passport-login/src/services/keys.ts new file mode 100644 index 000000000000..237316e2ad41 --- /dev/null +++ b/examples/passport-login/src/services/keys.ts @@ -0,0 +1,15 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import {BindingKey} from '@loopback/core'; +import {Profile as PassportProfile} from 'passport'; +import {UserIdentityService} from '@loopback/authentication'; +import {User} from '../models'; + +export namespace UserServiceBindings { + export const PASSPORT_USER_IDENTITY_SERVICE = BindingKey.create< + UserIdentityService + >('services.passport.identity'); +} diff --git a/examples/passport-login/src/services/user.service.ts b/examples/passport-login/src/services/user.service.ts new file mode 100644 index 000000000000..126e985e7eaf --- /dev/null +++ b/examples/passport-login/src/services/user.service.ts @@ -0,0 +1,112 @@ +// Copyright IBM Corp. 2020. All Rights Reserved. +// Node module: @loopback/example-passport-login +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +import {repository} from '@loopback/repository'; +import {Profile as PassportProfile} from 'passport'; +import {UserIdentityService} from '@loopback/authentication'; +import {UserRepository} from '../repositories'; +import {User} from '../models'; +import {UserIdentityRepository} from '../repositories/user-identity.repository'; + +/** + * User service to accept a 'passport' user profile and save it locally + */ +export class PassportUserIdentityService + implements UserIdentityService { + constructor( + @repository(UserRepository) + public userRepository: UserRepository, + @repository(UserIdentityRepository) + public userIdentityRepository: UserIdentityRepository, + ) {} + + /** + * find a linked local user for an external profile + * create a local user if not created yet. + * @param email + * @param profile + * @param token + */ + async findOrCreateUser(profile: PassportProfile): Promise { + if (!profile.emails || !profile.emails.length) { + throw new Error('email-id is required in returned profile to login'); + } + const email = profile.emails[0].value; + + const users: User[] = await this.userRepository.find({ + where: { + email: email, + }, + }); + let user: User; + if (!users || !users.length) { + user = await this.userRepository.create({ + email: email, + name: profile.displayName, + username: email, + }); + } else { + user = users[0]; + } + user = await this.linkExternalProfile('' + user.id, profile); + return user; + } + + /** + * link external profile with local user + * @param userId + * @param userIdentity + */ + async linkExternalProfile( + userId: string, + userIdentity: PassportProfile, + ): Promise { + let profile; + try { + profile = await this.userIdentityRepository.findById(userIdentity.id); + } catch (err) { + console.log(err); + } + + if (!profile) { + await this.createUser(userId, userIdentity); + } else { + await this.userIdentityRepository.updateById(userIdentity.id, { + profile: { + emails: userIdentity.emails, + }, + created: new Date(), + }); + } + return this.userRepository.findById(parseInt(userId), { + include: [ + { + relation: 'profiles', + }, + ], + }); + } + + /** + * create a copy of the external profile + * @param userId + * @param userIdentity + */ + async createUser( + userId: string, + userIdentity: PassportProfile, + ): Promise { + await this.userIdentityRepository.create({ + id: userIdentity.id, + provider: userIdentity.provider, + authScheme: userIdentity.provider, + userId: parseInt(userId), + profile: { + emails: userIdentity.emails, + }, + created: new Date(), + }); + } +} diff --git a/examples/passport-login/tsconfig.json b/examples/passport-login/tsconfig.json new file mode 100644 index 000000000000..f13a713f509a --- /dev/null +++ b/examples/passport-login/tsconfig.json @@ -0,0 +1,10 @@ +{ + "$schema": "http://json.schemastore.org/tsconfig", + "extends": "@loopback/build/config/tsconfig.common.json", + "compilerOptions": { + "experimentalDecorators": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": ["src"] +} diff --git a/examples/passport-login/web-application/express-app.js b/examples/passport-login/web-application/express-app.js new file mode 100644 index 000000000000..3e9f01bf87b8 --- /dev/null +++ b/examples/passport-login/web-application/express-app.js @@ -0,0 +1,140 @@ +// Copyright IBM Corp. 2014,2015. All Rights Reserved. +// Node module: loopback-example-passport +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT +'use strict'; + +/** + * NOTE: This express web app helps to mock client HTTP sessions + * with user profiles from third party providers. + */ +const express = require('express'); +const session = require('client-sessions'); +const path = require('path'); +const bodyParser = require('body-parser'); +const app = (module.exports = express()); + +/** + * use jade as view engine + * Note: jade templates copied from loopback-example-passport + */ +app.set('views', path.join(__dirname, 'views')); +app.set('view engine', 'jade'); + +// to support json payload in body +app.use('parse', bodyParser.json()); +// to support html form bodies +app.use(bodyParser.text({type: 'text/html'})); +// create application/x-www-form-urlencoded parser +const urlencodedParser = bodyParser.urlencoded({extended: false}); + +/** + * we use 'client-sessions' to enable saving client side sessions + */ +app.use( + session({ + cookieName: 'session', + secret: 'random_string_goes_here', + duration: 30 * 60 * 1000, + activeDuration: 5 * 60 * 1000, + }), +); + +/** + * Middleware to look up user profile in the session + */ +app.use(function (req, res, next) { + if (req.session && req.session.user) { + req.user = req.session.user; + next(); + } else { + next(); + } +}); + +/** + * Middleware to enforce login + * @param {*} req + * @param {*} res + * @param {*} next + */ +function requireLogin(req, res, next) { + if (!req.user) { + res.sendStatus(401); + } else { + next(); + } +} + +/** + * Render Index page + */ +app.get('/', function (req, res, next) { + res.render('pages/index', {user: req.user, url: req.url}); +}); + +/** + * Render account profile + */ +app.get('/auth/account', requireLogin, function (req, res, next) { + res.render('pages/loginProfiles', { + user: req.user, + url: req.url, + }); +}); + +/** + * render login page + */ +app.get('/login', function (req, res, next) { + res.render('pages/login', { + user: req.user, + url: req.url, + }); +}); + +/** + * logout current session + */ +app.get('/logout', function (req, res) { + req.session.reset(); + res.redirect('/'); +}); + +/** + * signup as local user + */ +app.get('/signupOptions', function (req, res, next) { + res.render('pages/signupOptions', { + user: req.user, + url: req.url, + }); +}); + +/** + * render login page + */ +app.get('/signup', function (req, res, next) { + res.render('pages/signup', { + user: req.user, + url: req.url, + }); +}); + +/** + * submit signup request + */ +app.post('/signup', urlencodedParser, function (req, res, next) { + req.url = '/api/users/signup'; + req.headers['accept'] = 'text/json'; + req.app.handle(req, res, next); +}); + +/** + * login submit + */ +app.post('/login_submit', urlencodedParser, function (req, res, next) { + req.url = '/api/login'; + req.headers['accept'] = 'text/json'; + req.app.handle(req, res, next); +}); diff --git a/examples/passport-login/web-application/views/layouts/layout.jade b/examples/passport-login/web-application/views/layouts/layout.jade new file mode 100644 index 000000000000..42968d972c69 --- /dev/null +++ b/examples/passport-login/web-application/views/layouts/layout.jade @@ -0,0 +1,8 @@ +doctype html +html(lang="en") + include ../partials/head + body(style="padding-top: 70px; padding-bottom: 50px;") + include ../partials/navigation + include ../partials/banner + include ../partials/footer + block scripts diff --git a/examples/passport-login/web-application/views/pages/index.jade b/examples/passport-login/web-application/views/pages/index.jade new file mode 100644 index 000000000000..fe9008d6ef8f --- /dev/null +++ b/examples/passport-login/web-application/views/pages/index.jade @@ -0,0 +1,17 @@ +extends ../layouts/layout + +block content + .jumbotron + h1 Passport Authentication Example + h2 From  + img(src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR4AAABkCAMAAABn2a/3AAAAsVBMVEUAAAD///8HWCt8vDMHWCt8vDMHWCt8vDMHWCt8vDMHWCsebC18vDMHWCtpqzJ8vDMHWCt8vDMHWCt8vDMHWCtvsTJ8vDMHWCt8vDMHWCsncy18vDMHWCskcS1ytDJ8vDMHWCt8vDMHWCsodS1rrjJ8vDMHWCsebC10tTJ8vDMHWCsOXiwWZSwday0kcS0sdy4zfi46hC9Cii9JkDBQlzBXnTFfozFmqTJtsDJ1tjN8vDORSmJOAAAAKnRSTlMAABAQICAwMEBAUFBQYGBgcHCAgI+Pj5+fr6+vv7+/v8/P39/f3+/v7+9ljT9GAAAHFElEQVR42u2b63bcJhCAKcYKq1i1jNVqlai1otQ0llOnddPE3vd/sCLEXbCS3bPZ9HjmR5JFoIFPMDMMBP0AskcQIAA8gAfwAB7AA3gAD+ABATyAB/AAHsADeAAP4AE8IIAH8AAewAN4AA/gATyABwTwrMMzCSnrtht421YFQa5g9C0lo6N8W52OkESv2sGRrjD9w1X7Tfs39YMeBw7thjr2ZcohEN2/gg8vBg+pR9WczR6wIY5H0BxeDh4WTA0zp4YEHvnPF49H2R1elzRndfcC8RAS4CmtCSLKHusSUvGXhQcLo8OwgyfvB17qp8VU6vg0zLIXhCfjcu0QxaGnrfrbXXNdpOFUjSnR/ChrRIQ09G1dmAnI2lFHV+f+nM1F1fEJb5ty5jHzqu0HGWmVNtDZgyehZBxgJZu1VebVp6yW2ru2yk2cEjqms8vXetKQdnRc2Jjillg8fQqPb65LN0BSE4s4Zb3te8X99pULCDP/aZct4CFNVEkQs7WmZdF771f+Wgxdt5J/vrra7T44Jodn6Oy3O6/LbEh1KYLHK2l1bORRCCy+g8DyybpEpJXCk/tKavuk8N9TpoIV+QFwM7UU1mUMALe7UXQHcCUw/ioKPn80VAvt13n2PDxF2I86hceasYwPT8OTVDJ/wlKxnDvAdlIi6ez+vpUrqRSduvsiSx7vb02XMdfzDz8DT2SkZQrPoIwV5sPT8KSVRGK2PIFn6PX4zn08u8dPYrmKBrefd1q+3pohmjfxiiyZ5qmoELY0o6yyENpclNTqNcQZKaMZwlQ9UfZf/erl1m6K5ffjcZVUnhJlYWrRQiuZKDClHQsTra2gmnJvd2/F4mqwwbP7abIxd4aOWV4CD+6iu9GoYw+LqDejqWt+vJGWTvQQBFpsEQ/1RqemUu0srcJbaOXsraRzg5ftbouwXGmaxuVUReP5cuctEJePu8ZW4Gn8gokCj4y0sxNfVcJoLZ46qaTzvUFlnbD3Vr2cVcVTXV/jucCy+oTn4c/QXOLKs2HFejxTC2v0etsrf6TMzrLWczEr8PCgsNeo1Ty06Rc7SXw8amKF0cvp25HH9Zl2vp8exM/7iDchNZ/7hWU8NNRahRSoV5NZpGQ1nrSSXP6jCSdzMceDA5BaNu9uLh2Hc5/AI15QdKF3XMZThFGI0+H9eDhajSdPKmGu4fPnaIAnFTHQ4gStwiPDdjOFyDo8s/5RWyGGp/WrrMOTVsJcw2zBVYt4zk9NvD8G2uvwjLG+u7z+J3hoTH34yPt9uXu3vT6zlnMtHuMc+eHwoMCU/Gc8efikjuCp3N9n0kVtkI5IDY03Vwt4dJCIV+Epfcf6BDzWSi7iKZJKnm17Tq48PJXdl53f7MdDbJC/1nN10S+dxNP5FmOl54opmXmG2sQMLBoMZOrQCv0s/PmpwTMlHXiRNwSdvNmLBwV4+D48OEylOUNP4qn8HdBy3JNUkoU95AZCgGeqOWglDG0uhMuiv98O94/b0U7Tnsk8WIWZjweTiBuVnennsUKINAhbqbNwknhUVzviZov24WmSSno/wiwsrgBP7UZINVfmart7HAPBmwuVUpWtxZA+OnjoULuJ1M5yDsLbGJ7C22/j3ulFEo/N/bOSNSt27GklzEtVZM7Wwbfa/t4MhZuKqzETZpCIjfvXOweP+JIlVbGh2gI3dhVMqEmZRZ3ZVH/KXNPeHUcaT7aU0KiZI3ZfPlei9lLTNkhvDZwcKJf5Vb1eOE7hIU5u8a/Hseifjw6eyRr0QW/1Ey5TtjSKJzfTsNWDbtACnnkOK8Djia+k95WUXhcdR2YtiGnirwMPj5M2etCFfwR45puuLp4Oa+fb6UjOdA+eMDe6hAdVycTsXH0qWxjxQjE8Judzl8RTx7J0CTxhB03H9+ER891Mg2YFnqQSY1ENA5zC0+E0ntdpPCRMi9sjMET5Mh5/KlSJMxk6a5nljI1HOLWbE0nhSSkZQfB5pjmCp4rcvdhcT3S2H+7jeKTTytzjmbbwD1wUvH56fTtKFR4zlqaS4wMrWTczxy2xlnYFe408mSmpg1s4Zib2jAShY6Ea9VXi5s7Fze56M2Z9HiJ47LEQIvLeESWJK0mLB7GpxsuXapLHbE9QgmeXpmzcQ2iWeuFmc7o5R+jKHuc4pvl9caxLWM5I1NKuD3PfYuGzbi/eiZDHxyPC6PHnzeXJsegIC9OycR7QXB8iZEfBc/5qeylThm72XZ7nbE8ROiKeQBp0FDxGfvQDjV82CH1HeHp8IDyrJ6W7Ee0LhL4nPB1BB8HTPOW9+o7D/LD4uHgO87HY0D31lpC8SlkTdHzJSjYFNTXLDqOhKJ/TqJkjhZvv8J8GAA/gATyAB/AAHsADAngAD+ABPIAH8AAewAN4QAAP4AE8gAfwAB7AA3gADwjgATyA58DyL4we9xSOmoFDAAAAAElFTkSuQmCC", alt="StrongLoop", width=190) + p + a.btn.btn-lg.btn-primary(href='http://docs.strongloop.com/display/public/LB/LoopBack#getting-started', role='button') View LoopBack docs » + + .row + .col-md-12 + h1 Sample Functionality + p.lead In this sample application you can: + ul + li + a(href='/login') Login to your account using either a local account or social accounts diff --git a/examples/passport-login/web-application/views/pages/login.jade b/examples/passport-login/web-application/views/pages/login.jade new file mode 100644 index 000000000000..cc1d632ac654 --- /dev/null +++ b/examples/passport-login/web-application/views/pages/login.jade @@ -0,0 +1,23 @@ +extends ../layouts/layout + +block content + .row + .col-md-6.col-md-offset-3 + if user + h1 User Logged in! + h3 Hello #{user.name} + ul + li + a(href='/') Home + li + a(href='/auth/logout') Log Out + else + form(role='form', action='/login_submit', method='post') + .form-group + label(for='email') User Name + input.form-control(type='text', name='email', placeholder='Enter user name') + .form-group + label(for='password') Password + input.form-control(type='password', name='password', placeholder='Password') + button.btn.btn-default(type='submit') Submit + br diff --git a/examples/passport-login/web-application/views/pages/loginProfiles.jade b/examples/passport-login/web-application/views/pages/loginProfiles.jade new file mode 100644 index 000000000000..6638bef66066 --- /dev/null +++ b/examples/passport-login/web-application/views/pages/loginProfiles.jade @@ -0,0 +1,11 @@ +extends ../layouts/layout + +block content + h2 Third Party Profile(s) + p.small + if user.profiles && user.profiles.length !== 0 + each val in user.profiles + h4= val.provider + ':' + p.small= JSON.stringify(val) + else + | NONE diff --git a/examples/passport-login/web-application/views/pages/signup.jade b/examples/passport-login/web-application/views/pages/signup.jade new file mode 100644 index 000000000000..1f895a82508d --- /dev/null +++ b/examples/passport-login/web-application/views/pages/signup.jade @@ -0,0 +1,29 @@ +extends ../layouts/layout + +block content + .row + .col-md-6.col-md-offset-3 + if user + h1 User Logged in! + h3 Hello #{user.username} + ul + li + a(href='/') Home + li + a(href='/auth/logout') Log Out + else + form(role='form', action='/api/users/signup', method='post') + .form-group + label(for='name') Your Name + input.form-control(type='text', name='name', placeholder='Enter your name') + .form-group + label(for='username') User Name + input.form-control(type='text', name='username', placeholder='Enter user name') + .form-group + label(for='email') Email address + input.form-control(type='email', name='email', placeholder='Enter your email address') + .form-group + label(for='password') Password + input.form-control(type='password', name='password', placeholder='Password') + button.btn.btn-default(type='submit') Submit + br diff --git a/examples/passport-login/web-application/views/pages/signupOptions.jade b/examples/passport-login/web-application/views/pages/signupOptions.jade new file mode 100644 index 000000000000..16b6ebf68bd9 --- /dev/null +++ b/examples/passport-login/web-application/views/pages/signupOptions.jade @@ -0,0 +1,13 @@ +extends ../layouts/layout + +block content + .row + .col-md-12 + h1 Other sign up options + ul.list-inline.list-unstyled + li + a.btn.btn-primary(href="/api/auth/thirdparty/facebook") Sign up with Facebook + li + a.btn.btn-primary(href="/api/auth/thirdparty/google") Sign up with Google + li + a.btn.btn-primary(href="/api/auth/thirdparty/twitter") Sign up with Twitter diff --git a/examples/passport-login/web-application/views/partials/banner.jade b/examples/passport-login/web-application/views/partials/banner.jade new file mode 100644 index 000000000000..58f737c178bf --- /dev/null +++ b/examples/passport-login/web-application/views/partials/banner.jade @@ -0,0 +1,10 @@ +.container + if user && user.username + .row + .col-md-12 + .well + h1 User Logged in! + h3 Hello: #{user.username} + p.small User Id: #{user.id} + p.small Email: #{user.email} + block content diff --git a/examples/passport-login/web-application/views/partials/footer.jade b/examples/passport-login/web-application/views/partials/footer.jade new file mode 100644 index 000000000000..4dcd781a0919 --- /dev/null +++ b/examples/passport-login/web-application/views/partials/footer.jade @@ -0,0 +1,13 @@ +hr(style="margin-top: 50px;") +.footer(style="text-align: center;") + p + | Copyright ©  + script. + var d = new Date(); + document.write(d.getFullYear()); + |  StrongLoop, Inc., All Rights Reserved.  + a(href='/status') Server Status. + +//- Load Scripts +script(src='//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js') +script(src='//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js') diff --git a/examples/passport-login/web-application/views/partials/head.jade b/examples/passport-login/web-application/views/partials/head.jade new file mode 100644 index 000000000000..7feb55480fcc --- /dev/null +++ b/examples/passport-login/web-application/views/partials/head.jade @@ -0,0 +1,30 @@ +head + //- Behavioral Meta Data + meta(charset='utf-8') + meta(name='x-csrf-token', content=_csrf) + meta(http-equiv='X-UA-Compatible', content='IE=edge') + meta(name='viewport', content='width=device-width, initial-scale=1.0') + + //- SEO Meta Data + title LoopBack API Server + meta(name='author', content='') + meta(name='description', content='') + meta(name='keywords', content='') + + //- Styles + link(rel='stylesheet', href='//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css') + style. + .navbar-brand { + background-image: url(http://loopback.io/images/loopback.svg); + background-repeat: no-repeat; + background-size: 40px; + background-position: left center; + padding-left: 45px; + margin-top: -1px; + margin-left: 15px; + font-size: 22px; + color: #07582B !important; + } + h2 { + color: #07582B; + } diff --git a/examples/passport-login/web-application/views/partials/navigation.jade b/examples/passport-login/web-application/views/partials/navigation.jade new file mode 100644 index 000000000000..ebc80ea911c8 --- /dev/null +++ b/examples/passport-login/web-application/views/partials/navigation.jade @@ -0,0 +1,23 @@ +nav.navbar.navbar-default.navbar-fixed-top(role='navigation') + .container + .navbar-header + button.navbar-toggle.collapsed(type='button', data-toggle='collapse', data-target='#navbar', aria-expanded='false', aria-controls='navbar') + span.sr-only Toggle navigation + span.icon-bar + span.icon-bar + span.icon-bar + a.navbar-brand(href='/') LoopBack + #navbar.navbar-collapse.collapse + ul.nav.navbar-nav.navbar-right + li(class=url=='/'?'active':undefined) + a(href='/') Home + li(class=url=='/auth/account'?'active':undefined) + a(href='/auth/account') View Account + li(class=url=='/signup'?'active':undefined) + a(href='/signup') Sign Up + li(class=url=='/signupOptions'?'active':undefined) + a(href='/signupOptions') Sign Up Options + li(class=url=='/login'?'active':undefined) + a(href='/login') Log in + li(class=url=='/logout'?'active':undefined) + a(href='/logout') Log Out diff --git a/packages/authentication/src/services/index.ts b/packages/authentication/src/services/index.ts index 99ec342f6097..6eff02bd4e14 100644 --- a/packages/authentication/src/services/index.ts +++ b/packages/authentication/src/services/index.ts @@ -5,3 +5,4 @@ export * from './token.service'; export * from './user.service'; +export * from './user-identity.service'; diff --git a/packages/authentication/src/services/user-identity.service.ts b/packages/authentication/src/services/user-identity.service.ts new file mode 100644 index 000000000000..fcce3d656b1e --- /dev/null +++ b/packages/authentication/src/services/user-identity.service.ts @@ -0,0 +1,61 @@ +// Copyright IBM Corp. 2019. All Rights Reserved. +// Node module: @loopback/authentication +// This file is licensed under the MIT License. +// License text available at https://opensource.org/licenses/MIT + +/** + * The User Identity service links a user to profiles from an external source (eg: ldap, oauth2 provider, saml) + * which can identify the user. The profile typically has the following information: + * name, email-id, uuid, roles, authorizations, scope of accessible resources, expiration time for given access + * + * @example + * export class LDAPUserIdentityService implements UserIdentityService { + * constructor( + * @repository(UserRepository) + * public userRepository: UserRepository, + * @repository(UserIdentityRepository) + * public userIdentityRepository: UserIdentityRepository, + * ) {} + * } + */ +export interface UserIdentityService { + /** + * find or create a local user using a profile from an external source + * @param userIdentity + * + * @example + * async findOrCreateUser( + * ldapUser: LDAPUserIdentity, + * ): Promise { + * let user: UserProfile = await this.userRepository.findOrCreate({ + * name: ldapUser.cn, + * username: ldapUser.mail, + * roles: _.map(ldapUser.memberof['ou=roles,dc=mydomain,o=myOrg'], 'cn') + * }); + * await this.linkExternalProfile(user.id, ldapUser); + * return user; + * } + */ + findOrCreateUser(userIdentity: I): Promise; + + /** + * link an external profile with an existing local user id. + * @param userId + * + * @example + * async linkExternalProfile(userId: string, ldapUser: LDAPUserIdentity) { + * return await this.userIdentityRepository.findOrCreate({ + * provider: 'ldap', + * externalId: ldapUser.id, + * authScheme: 'active-directory', + * userId: userId, + * credentials: { + * distinguishedName: ldapUser.dn, + * roles: ldapUser.memberof, + * expirationTime: ldapUser.maxAge} + * }); + * } + * } + */ + linkExternalProfile(userId: string, userIdentity: I): Promise; +} diff --git a/packages/rest/src/types.ts b/packages/rest/src/types.ts index bf14c348e9c3..c0a621e84738 100644 --- a/packages/rest/src/types.ts +++ b/packages/rest/src/types.ts @@ -199,3 +199,28 @@ export type OperationRetval = any; export type GetFromContext = (key: string) => Promise; export type BindElement = (key: string) => Binding; + +/** + * user profile to add in session + */ +export interface SessionUserProfile { + provider: string; + token: string; + email: string; + [attribute: string]: any; +} + +/** + * interface to set variables in user session + */ +export interface Session { + profile: SessionUserProfile; + [key: string]: any; +} + +/** + * extending express request type with a session field + */ +export interface RequestWithSession extends Request { + session: Session; +}