├── .gitignore ├── LICENSE ├── README.md ├── app.js ├── model.js ├── mongo ├── model │ ├── client.js │ ├── token.js │ └── user.js └── schema │ ├── client.js │ ├── token.js │ └── user.js ├── package-lock.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Pedro Trujillo (pedroetb) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # node-oauth2-server with MongoDB example 2 | 3 | This is a basic example of a OAuth2 server, using [node-oauth2-server](https://github.com/oauthjs/node-oauth2-server) (version 3.0.1) with MongoDB storage and the minimum (only the required to work) model configuration. 4 | 5 | If you want a simpler example without MongoDB storage, you should go to [node-oauth2-server-example](https://github.com/pedroetb/node-oauth2-server-example) instead. 6 | 7 | ## Setup 8 | 9 | First, you should have [MongoDB](https://www.mongodb.com/) installed and running on your machine. 10 | 11 | You also need to install **nodejs** and **npm** and then, simply run `npm install` and `npm start`. The server should now be running at `http://localhost:3000`. 12 | 13 | ## Usage 14 | 15 | You can use different grant types to get an access token. By now, `password`, `client_credentials` and `refresh_token` are available. 16 | 17 | ### Checking example data 18 | 19 | Firstly, you should create some entries in your **MongoDB** database. 20 | 21 | > You can call the `loadExampleData` function at `model.js` in order to create these entries automatically, and `dump` function to inspect the database content. 22 | 23 | #### With *password* grant 24 | 25 | You need to add a client. For example: 26 | 27 | * **clientId**: `application` 28 | * **clientSecret**: `secret` 29 | 30 | And you have to add a user too. For example: 31 | 32 | * **username**: `pedroetb` 33 | * **password**: `password` 34 | 35 | #### With *client_credentials* grant 36 | 37 | You need to add a confidential client. For example: 38 | 39 | * **clientId**: `confidentialApplication` 40 | * **clientSecret**: `topSecret` 41 | 42 | You don't need any user to use this grant type, but for security is only available to confidential clients. 43 | 44 | #### With *refresh_token* grant 45 | 46 | There is one client added to server and ready to work: 47 | 48 | * **clientId**: `application` 49 | * **clientSecret**: `secret` 50 | 51 | You don't need any user to use this grant type, it was already provided when original token was obtained (by *password* grant type, for example). 52 | 53 | ### Obtaining a token 54 | 55 | To obtain a token you should POST to `http://localhost:3000/oauth/token`. 56 | 57 | #### With *password* grant 58 | 59 | You need to include the client credentials in request headers and the user credentials and grant type in request body: 60 | 61 | * **Headers** 62 | * **Authorization**: `"Basic " + clientId:clientSecret base64'd` 63 | * (for example, to use `application:secret`, you should send `Basic YXBwbGljYXRpb246c2VjcmV0`) 64 | 65 | * **Content-Type**: `application/x-www-form-urlencoded` 66 | * **Body** 67 | * `grant_type=password&username=pedroetb&password=password` 68 | * (contains 3 parameters: `grant_type`, `username` and `password`) 69 | 70 | For example, using `curl`: 71 | ``` 72 | curl http://localhost:3000/oauth/token \ 73 | -d "grant_type=password" \ 74 | -d "username=pedroetb" \ 75 | -d "password=password" \ 76 | -H "Authorization: Basic YXBwbGljYXRpb246c2VjcmV0" \ 77 | -H "Content-Type: application/x-www-form-urlencoded" 78 | ``` 79 | 80 | If all goes as planned, you should receive a response like this: 81 | 82 | ``` 83 | { 84 | "accessToken": "951d6f603c2ce322c5def00ce58952ed2d096a72", 85 | "accessTokenExpiresAt": "2018-11-18T16:18:25.852Z", 86 | "refreshToken": "67c8300ad53efa493c2278acf12d92bdb71832f9", 87 | "refreshTokenExpiresAt": "2018-12-02T15:18:25.852Z", 88 | "client": { 89 | "id": "application" 90 | }, 91 | "user": { 92 | "id": "pedroetb" 93 | } 94 | } 95 | ``` 96 | 97 | #### With *client_credentials* grant 98 | 99 | You need to include the client credentials in request headers and the grant type in request body: 100 | 101 | * **Headers** 102 | * **Authorization**: `"Basic " + clientId:clientSecret base64'd` 103 | * (for example, to use `confidentialApplication:topSecret`, you should send `Basic Y29uZmlkZW50aWFsQXBwbGljYXRpb246dG9wU2VjcmV0`) 104 | 105 | * **Content-Type**: `application/x-www-form-urlencoded` 106 | * **Body** 107 | * `grant_type=client_credentials` 108 | 109 | For example, using `curl`: 110 | ``` 111 | curl http://localhost:3000/oauth/token \ 112 | -d "grant_type=client_credentials" \ 113 | -H "Authorization: Basic Y29uZmlkZW50aWFsQXBwbGljYXRpb246dG9wU2VjcmV0" \ 114 | -H "Content-Type: application/x-www-form-urlencoded" 115 | ``` 116 | 117 | If all goes as planned, you should receive a response like this: 118 | 119 | ``` 120 | { 121 | "accessToken": "951d6f603c2ce322c5def00ce58952ed2d096a72", 122 | "accessTokenExpiresAt": "2018-11-18T16:18:25.852Z", 123 | "client": { 124 | "id": "confidentialApplication" 125 | }, 126 | "user": { 127 | "id": "confidentialApplication" 128 | } 129 | } 130 | ``` 131 | 132 | #### With *refresh_token* grant 133 | 134 | When obtaining an access token using *password* grant, you get also a refresh token. 135 | With this token you can get a new access token, using only that value (username and password are not needed), while it has not been expired. 136 | 137 | > Remember that, if you refresh a token while it was still valid, the old access and refresh tokens get revoked, and only the new access and refresh tokens are valid to be used. 138 | You need to include the client credentials in request headers and the refresh token and grant type in request body: 139 | 140 | * **Headers** 141 | * **Authorization**: `"Basic " + clientId:clientSecret base64'd` 142 | * (for example, to use `application:secret`, you should send `Basic YXBwbGljYXRpb246c2VjcmV0`) 143 | 144 | * **Content-Type**: `application/x-www-form-urlencoded` 145 | * **Body** 146 | * `grant_type=refresh_token&refresh_token=67c8300ad53efa493c2278acf12d92bdb71832f9` 147 | * (contains 2 parameters: `grant_type` and `refresh_token`) 148 | 149 | For example, using `curl`: 150 | ``` 151 | curl http://localhost:3000/oauth/token \ 152 | -d "grant_type=refresh_token" \ 153 | -d "refresh_token=67c8300ad53efa493c2278acf12d92bdb71832f9" \ 154 | -H "Authorization: Basic YXBwbGljYXRpb246c2VjcmV0" \ 155 | -H "Content-Type: application/x-www-form-urlencoded" 156 | ``` 157 | 158 | If all goes as planned, you should receive a response like this: 159 | 160 | ``` 161 | { 162 | "accessToken": "17be4ee45b177651db3fd9d286042de75d48eb3b", 163 | "accessTokenExpiresAt": "2018-11-18T16:18:35.248Z", 164 | "refreshToken": "37eaff895c8fc9fc839c0098cf3fb01858097908", 165 | "refreshTokenExpiresAt": "2018-12-02T15:18:35.248Z", 166 | "client": { 167 | "id": "application" 168 | }, 169 | "user": { 170 | "id": "pedroetb" 171 | } 172 | } 173 | ``` 174 | 175 | ### Using the token 176 | 177 | Now, you can use your brand-new token to access restricted areas. For example, you can GET to `http://localhost:3000/` including your token at headers: 178 | 179 | * **Headers** 180 | * **Authorization**: `"Bearer " + accessToken` 181 | * (for example, `Bearer 951d6f603c2ce322c5def00ce58952ed2d096a72`) 182 | 183 | For example, using `curl`: 184 | ``` 185 | curl http://localhost:3000 \ 186 | -H "Authorization: Bearer 951d6f603c2ce322c5def00ce58952ed2d096a72" 187 | ``` 188 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | var express = require('express'), 2 | bodyParser = require('body-parser'), 3 | mongoose = require('mongoose'), 4 | OAuth2Server = require('oauth2-server'), 5 | Request = OAuth2Server.Request, 6 | Response = OAuth2Server.Response; 7 | 8 | var app = express(); 9 | 10 | app.use(bodyParser.urlencoded({ extended: true })); 11 | 12 | app.use(bodyParser.json()); 13 | 14 | var mongoUri = 'mongodb://localhost/oauth'; 15 | 16 | mongoose.connect(mongoUri, { 17 | useCreateIndex: true, 18 | useNewUrlParser: true 19 | }, function(err, res) { 20 | 21 | if (err) { 22 | return console.error('Error connecting to "%s":', mongoUri, err); 23 | } 24 | console.log('Connected successfully to "%s"', mongoUri); 25 | }); 26 | 27 | app.oauth = new OAuth2Server({ 28 | model: require('./model.js'), 29 | accessTokenLifetime: 60 * 60, 30 | allowBearerTokensInQueryString: true 31 | }); 32 | 33 | app.all('/oauth/token', obtainToken); 34 | 35 | app.get('/', authenticateRequest, function(req, res) { 36 | 37 | res.send('Congratulations, you are in a secret area!'); 38 | }); 39 | 40 | app.listen(3000); 41 | 42 | function obtainToken(req, res) { 43 | 44 | var request = new Request(req); 45 | var response = new Response(res); 46 | 47 | return app.oauth.token(request, response) 48 | .then(function(token) { 49 | 50 | res.json(token); 51 | }).catch(function(err) { 52 | 53 | res.status(err.code || 500).json(err); 54 | }); 55 | } 56 | 57 | function authenticateRequest(req, res, next) { 58 | 59 | var request = new Request(req); 60 | var response = new Response(res); 61 | 62 | return app.oauth.authenticate(request, response) 63 | .then(function(token) { 64 | 65 | next(); 66 | }).catch(function(err) { 67 | 68 | res.status(err.code || 500).json(err); 69 | }); 70 | } 71 | -------------------------------------------------------------------------------- /model.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'); 2 | 3 | /** 4 | * Configuration. 5 | */ 6 | 7 | var clientModel = require('./mongo/model/client'), 8 | tokenModel = require('./mongo/model/token'), 9 | userModel = require('./mongo/model/user'); 10 | 11 | /** 12 | * Add example client and user to the database (for debug). 13 | */ 14 | 15 | var loadExampleData = function() { 16 | 17 | var client1 = new clientModel({ 18 | id: 'application', // TODO: Needed by refresh_token grant, because there is a bug at line 103 in https://github.com/oauthjs/node-oauth2-server/blob/v3.0.1/lib/grant-types/refresh-token-grant-type.js (used client.id instead of client.clientId) 19 | clientId: 'application', 20 | clientSecret: 'secret', 21 | grants: [ 22 | 'password', 23 | 'refresh_token' 24 | ], 25 | redirectUris: [] 26 | }); 27 | 28 | var client2 = new clientModel({ 29 | clientId: 'confidentialApplication', 30 | clientSecret: 'topSecret', 31 | grants: [ 32 | 'password', 33 | 'client_credentials' 34 | ], 35 | redirectUris: [] 36 | }); 37 | 38 | var user = new userModel({ 39 | username: 'pedroetb', 40 | password: 'password' 41 | }); 42 | 43 | client1.save(function(err, client) { 44 | 45 | if (err) { 46 | return console.error(err); 47 | } 48 | console.log('Created client', client); 49 | }); 50 | 51 | user.save(function(err, user) { 52 | 53 | if (err) { 54 | return console.error(err); 55 | } 56 | console.log('Created user', user); 57 | }); 58 | 59 | client2.save(function(err, client) { 60 | 61 | if (err) { 62 | return console.error(err); 63 | } 64 | console.log('Created client', client); 65 | }); 66 | }; 67 | 68 | /** 69 | * Dump the database content (for debug). 70 | */ 71 | 72 | var dump = function() { 73 | 74 | clientModel.find(function(err, clients) { 75 | 76 | if (err) { 77 | return console.error(err); 78 | } 79 | console.log('clients', clients); 80 | }); 81 | 82 | tokenModel.find(function(err, tokens) { 83 | 84 | if (err) { 85 | return console.error(err); 86 | } 87 | console.log('tokens', tokens); 88 | }); 89 | 90 | userModel.find(function(err, users) { 91 | 92 | if (err) { 93 | return console.error(err); 94 | } 95 | console.log('users', users); 96 | }); 97 | }; 98 | 99 | /* 100 | * Methods used by all grant types. 101 | */ 102 | 103 | var getAccessToken = function(token, callback) { 104 | 105 | tokenModel.findOne({ 106 | accessToken: token 107 | }).lean().exec((function(callback, err, token) { 108 | 109 | if (!token) { 110 | console.error('Token not found'); 111 | } 112 | 113 | callback(err, token); 114 | }).bind(null, callback)); 115 | }; 116 | 117 | var getClient = function(clientId, clientSecret, callback) { 118 | 119 | clientModel.findOne({ 120 | clientId: clientId, 121 | clientSecret: clientSecret 122 | }).lean().exec((function(callback, err, client) { 123 | 124 | if (!client) { 125 | console.error('Client not found'); 126 | } 127 | 128 | callback(err, client); 129 | }).bind(null, callback)); 130 | }; 131 | 132 | var saveToken = function(token, client, user, callback) { 133 | 134 | token.client = { 135 | id: client.clientId 136 | }; 137 | 138 | token.user = { 139 | username: user.username 140 | }; 141 | 142 | var tokenInstance = new tokenModel(token); 143 | tokenInstance.save((function(callback, err, token) { 144 | 145 | if (!token) { 146 | console.error('Token not saved'); 147 | } else { 148 | token = token.toObject(); 149 | delete token._id; 150 | delete token.__v; 151 | } 152 | 153 | callback(err, token); 154 | }).bind(null, callback)); 155 | }; 156 | 157 | /* 158 | * Method used only by password grant type. 159 | */ 160 | 161 | var getUser = function(username, password, callback) { 162 | 163 | userModel.findOne({ 164 | username: username, 165 | password: password 166 | }).lean().exec((function(callback, err, user) { 167 | 168 | if (!user) { 169 | console.error('User not found'); 170 | } 171 | 172 | callback(err, user); 173 | }).bind(null, callback)); 174 | }; 175 | 176 | /* 177 | * Method used only by client_credentials grant type. 178 | */ 179 | 180 | var getUserFromClient = function(client, callback) { 181 | 182 | clientModel.findOne({ 183 | clientId: client.clientId, 184 | clientSecret: client.clientSecret, 185 | grants: 'client_credentials' 186 | }).lean().exec((function(callback, err, client) { 187 | 188 | if (!client) { 189 | console.error('Client not found'); 190 | } 191 | 192 | callback(err, { 193 | username: '' 194 | }); 195 | }).bind(null, callback)); 196 | }; 197 | 198 | /* 199 | * Methods used only by refresh_token grant type. 200 | */ 201 | 202 | var getRefreshToken = function(refreshToken, callback) { 203 | 204 | tokenModel.findOne({ 205 | refreshToken: refreshToken 206 | }).lean().exec((function(callback, err, token) { 207 | 208 | if (!token) { 209 | console.error('Token not found'); 210 | } 211 | 212 | callback(err, token); 213 | }).bind(null, callback)); 214 | }; 215 | 216 | var revokeToken = function(token, callback) { 217 | 218 | tokenModel.deleteOne({ 219 | refreshToken: token.refreshToken 220 | }).exec((function(callback, err, results) { 221 | 222 | var deleteSuccess = results && results.deletedCount === 1; 223 | 224 | if (!deleteSuccess) { 225 | console.error('Token not deleted'); 226 | } 227 | 228 | callback(err, deleteSuccess); 229 | }).bind(null, callback)); 230 | }; 231 | 232 | /** 233 | * Export model definition object. 234 | */ 235 | 236 | module.exports = { 237 | getAccessToken: getAccessToken, 238 | getClient: getClient, 239 | saveToken: saveToken, 240 | getUser: getUser, 241 | getUserFromClient: getUserFromClient, 242 | getRefreshToken: getRefreshToken, 243 | revokeToken: revokeToken 244 | }; 245 | -------------------------------------------------------------------------------- /mongo/model/client.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'), 2 | modelName = 'client', 3 | schemaDefinition = require('../schema/' + modelName), 4 | schemaInstance = mongoose.Schema(schemaDefinition), 5 | modelInstance = mongoose.model(modelName, schemaInstance); 6 | 7 | module.exports = modelInstance; 8 | -------------------------------------------------------------------------------- /mongo/model/token.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'), 2 | modelName = 'token', 3 | schemaDefinition = require('../schema/' + modelName), 4 | schemaInstance = mongoose.Schema(schemaDefinition); 5 | 6 | schemaInstance.index({ "refreshTokenExpiresAt": 1 }, { expireAfterSeconds: 0 }); 7 | 8 | var modelInstance = mongoose.model(modelName, schemaInstance); 9 | 10 | module.exports = modelInstance; 11 | -------------------------------------------------------------------------------- /mongo/model/user.js: -------------------------------------------------------------------------------- 1 | var mongoose = require('mongoose'), 2 | modelName = 'user', 3 | schemaDefinition = require('../schema/' + modelName), 4 | schemaInstance = mongoose.Schema(schemaDefinition), 5 | modelInstance = mongoose.model(modelName, schemaInstance); 6 | 7 | module.exports = modelInstance; 8 | -------------------------------------------------------------------------------- /mongo/schema/client.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | id: String, 3 | clientId: String, 4 | clientSecret: String, 5 | grants: [String], 6 | redirectUris: [String] 7 | }; 8 | -------------------------------------------------------------------------------- /mongo/schema/token.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | accessToken: String, 3 | accessTokenExpiresAt: Date, 4 | refreshToken: String, 5 | refreshTokenExpiresAt: Date, 6 | client: Object, 7 | user: Object 8 | }; 9 | -------------------------------------------------------------------------------- /mongo/schema/user.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | username: String, 3 | password: String 4 | }; 5 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-oauth2-server-mongo-example", 3 | "version": "1.3.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "accepts": { 8 | "version": "1.3.7", 9 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", 10 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", 11 | "requires": { 12 | "mime-types": "~2.1.24", 13 | "negotiator": "0.6.2" 14 | }, 15 | "dependencies": { 16 | "mime-db": { 17 | "version": "1.40.0", 18 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", 19 | "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" 20 | }, 21 | "mime-types": { 22 | "version": "2.1.24", 23 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", 24 | "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", 25 | "requires": { 26 | "mime-db": "1.40.0" 27 | } 28 | } 29 | } 30 | }, 31 | "array-flatten": { 32 | "version": "1.1.1", 33 | "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", 34 | "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" 35 | }, 36 | "basic-auth": { 37 | "version": "2.0.1", 38 | "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", 39 | "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", 40 | "requires": { 41 | "safe-buffer": "5.1.2" 42 | } 43 | }, 44 | "bluebird": { 45 | "version": "3.5.3", 46 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", 47 | "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==" 48 | }, 49 | "body-parser": { 50 | "version": "1.19.0", 51 | "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", 52 | "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", 53 | "requires": { 54 | "bytes": "3.1.0", 55 | "content-type": "~1.0.4", 56 | "debug": "2.6.9", 57 | "depd": "~1.1.2", 58 | "http-errors": "1.7.2", 59 | "iconv-lite": "0.4.24", 60 | "on-finished": "~2.3.0", 61 | "qs": "6.7.0", 62 | "raw-body": "2.4.0", 63 | "type-is": "~1.6.17" 64 | }, 65 | "dependencies": { 66 | "mime-db": { 67 | "version": "1.40.0", 68 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", 69 | "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" 70 | }, 71 | "mime-types": { 72 | "version": "2.1.24", 73 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", 74 | "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", 75 | "requires": { 76 | "mime-db": "1.40.0" 77 | } 78 | }, 79 | "type-is": { 80 | "version": "1.6.18", 81 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 82 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 83 | "requires": { 84 | "media-typer": "0.3.0", 85 | "mime-types": "~2.1.24" 86 | } 87 | } 88 | } 89 | }, 90 | "bson": { 91 | "version": "1.1.1", 92 | "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.1.tgz", 93 | "integrity": "sha512-jCGVYLoYMHDkOsbwJZBCqwMHyH4c+wzgI9hG7Z6SZJRXWr+x58pdIbm2i9a/jFGCkRJqRUr8eoI7lDWa0hTkxg==" 94 | }, 95 | "bytes": { 96 | "version": "3.1.0", 97 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", 98 | "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" 99 | }, 100 | "co-bluebird": { 101 | "version": "1.1.0", 102 | "resolved": "https://registry.npmjs.org/co-bluebird/-/co-bluebird-1.1.0.tgz", 103 | "integrity": "sha1-yLnzqTIKftMJh9zKGlw8/1llXHw=", 104 | "requires": { 105 | "bluebird": "^2.10.0", 106 | "co-use": "^1.1.0" 107 | }, 108 | "dependencies": { 109 | "bluebird": { 110 | "version": "2.11.0", 111 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", 112 | "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=" 113 | } 114 | } 115 | }, 116 | "co-use": { 117 | "version": "1.1.0", 118 | "resolved": "https://registry.npmjs.org/co-use/-/co-use-1.1.0.tgz", 119 | "integrity": "sha1-xrs83xDLc17Kqdru2kbXJclKTmI=" 120 | }, 121 | "content-disposition": { 122 | "version": "0.5.3", 123 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", 124 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", 125 | "requires": { 126 | "safe-buffer": "5.1.2" 127 | } 128 | }, 129 | "content-type": { 130 | "version": "1.0.4", 131 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 132 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 133 | }, 134 | "cookie": { 135 | "version": "0.4.0", 136 | "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", 137 | "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==" 138 | }, 139 | "cookie-signature": { 140 | "version": "1.0.6", 141 | "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", 142 | "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" 143 | }, 144 | "debug": { 145 | "version": "2.6.9", 146 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 147 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 148 | "requires": { 149 | "ms": "2.0.0" 150 | } 151 | }, 152 | "depd": { 153 | "version": "1.1.2", 154 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 155 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 156 | }, 157 | "destroy": { 158 | "version": "1.0.4", 159 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 160 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 161 | }, 162 | "ee-first": { 163 | "version": "1.1.1", 164 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 165 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 166 | }, 167 | "encodeurl": { 168 | "version": "1.0.2", 169 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 170 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" 171 | }, 172 | "escape-html": { 173 | "version": "1.0.3", 174 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 175 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 176 | }, 177 | "etag": { 178 | "version": "1.8.1", 179 | "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", 180 | "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" 181 | }, 182 | "express": { 183 | "version": "4.17.1", 184 | "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", 185 | "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", 186 | "requires": { 187 | "accepts": "~1.3.7", 188 | "array-flatten": "1.1.1", 189 | "body-parser": "1.19.0", 190 | "content-disposition": "0.5.3", 191 | "content-type": "~1.0.4", 192 | "cookie": "0.4.0", 193 | "cookie-signature": "1.0.6", 194 | "debug": "2.6.9", 195 | "depd": "~1.1.2", 196 | "encodeurl": "~1.0.2", 197 | "escape-html": "~1.0.3", 198 | "etag": "~1.8.1", 199 | "finalhandler": "~1.1.2", 200 | "fresh": "0.5.2", 201 | "merge-descriptors": "1.0.1", 202 | "methods": "~1.1.2", 203 | "on-finished": "~2.3.0", 204 | "parseurl": "~1.3.3", 205 | "path-to-regexp": "0.1.7", 206 | "proxy-addr": "~2.0.5", 207 | "qs": "6.7.0", 208 | "range-parser": "~1.2.1", 209 | "safe-buffer": "5.1.2", 210 | "send": "0.17.1", 211 | "serve-static": "1.14.1", 212 | "setprototypeof": "1.1.1", 213 | "statuses": "~1.5.0", 214 | "type-is": "~1.6.18", 215 | "utils-merge": "1.0.1", 216 | "vary": "~1.1.2" 217 | }, 218 | "dependencies": { 219 | "mime-db": { 220 | "version": "1.40.0", 221 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", 222 | "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" 223 | }, 224 | "mime-types": { 225 | "version": "2.1.24", 226 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", 227 | "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", 228 | "requires": { 229 | "mime-db": "1.40.0" 230 | } 231 | }, 232 | "type-is": { 233 | "version": "1.6.18", 234 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 235 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 236 | "requires": { 237 | "media-typer": "0.3.0", 238 | "mime-types": "~2.1.24" 239 | } 240 | } 241 | } 242 | }, 243 | "finalhandler": { 244 | "version": "1.1.2", 245 | "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", 246 | "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", 247 | "requires": { 248 | "debug": "2.6.9", 249 | "encodeurl": "~1.0.2", 250 | "escape-html": "~1.0.3", 251 | "on-finished": "~2.3.0", 252 | "parseurl": "~1.3.3", 253 | "statuses": "~1.5.0", 254 | "unpipe": "~1.0.0" 255 | } 256 | }, 257 | "forwarded": { 258 | "version": "0.1.2", 259 | "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", 260 | "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" 261 | }, 262 | "fresh": { 263 | "version": "0.5.2", 264 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 265 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 266 | }, 267 | "http-errors": { 268 | "version": "1.7.2", 269 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", 270 | "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", 271 | "requires": { 272 | "depd": "~1.1.2", 273 | "inherits": "2.0.3", 274 | "setprototypeof": "1.1.1", 275 | "statuses": ">= 1.5.0 < 2", 276 | "toidentifier": "1.0.0" 277 | } 278 | }, 279 | "iconv-lite": { 280 | "version": "0.4.24", 281 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 282 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 283 | "requires": { 284 | "safer-buffer": ">= 2.1.2 < 3" 285 | } 286 | }, 287 | "inherits": { 288 | "version": "2.0.3", 289 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 290 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 291 | }, 292 | "ipaddr.js": { 293 | "version": "1.9.0", 294 | "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", 295 | "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" 296 | }, 297 | "is-generator": { 298 | "version": "1.0.3", 299 | "resolved": "https://registry.npmjs.org/is-generator/-/is-generator-1.0.3.tgz", 300 | "integrity": "sha1-wUwhBX7TbjKNuANHlmxpP4hjifM=" 301 | }, 302 | "kareem": { 303 | "version": "2.3.1", 304 | "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.1.tgz", 305 | "integrity": "sha512-l3hLhffs9zqoDe8zjmb/mAN4B8VT3L56EUvKNqLFVs9YlFA+zx7ke1DO8STAdDyYNkeSo1nKmjuvQeI12So8Xw==" 306 | }, 307 | "lodash": { 308 | "version": "4.17.14", 309 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", 310 | "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==" 311 | }, 312 | "media-typer": { 313 | "version": "0.3.0", 314 | "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 315 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 316 | }, 317 | "merge-descriptors": { 318 | "version": "1.0.1", 319 | "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", 320 | "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" 321 | }, 322 | "methods": { 323 | "version": "1.1.2", 324 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 325 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 326 | }, 327 | "mime": { 328 | "version": "1.6.0", 329 | "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", 330 | "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" 331 | }, 332 | "mime-db": { 333 | "version": "1.37.0", 334 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", 335 | "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" 336 | }, 337 | "mime-types": { 338 | "version": "2.1.21", 339 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", 340 | "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", 341 | "requires": { 342 | "mime-db": "~1.37.0" 343 | } 344 | }, 345 | "mongodb": { 346 | "version": "3.3.2", 347 | "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.3.2.tgz", 348 | "integrity": "sha512-fqJt3iywelk4yKu/lfwQg163Bjpo5zDKhXiohycvon4iQHbrfflSAz9AIlRE6496Pm/dQKQK5bMigdVo2s6gBg==", 349 | "requires": { 350 | "bson": "^1.1.1", 351 | "require_optional": "^1.0.1", 352 | "safe-buffer": "^5.1.2" 353 | } 354 | }, 355 | "mongoose": { 356 | "version": "5.7.5", 357 | "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.7.5.tgz", 358 | "integrity": "sha512-BZ4FxtnbTurc/wcm/hLltLdI4IDxo4nsE0D9q58YymTdZwreNzwO62CcjVtaHhmr8HmJtOInp2W/T12FZaMf8g==", 359 | "requires": { 360 | "bson": "~1.1.1", 361 | "kareem": "2.3.1", 362 | "mongodb": "3.3.2", 363 | "mongoose-legacy-pluralize": "1.0.2", 364 | "mpath": "0.6.0", 365 | "mquery": "3.2.2", 366 | "ms": "2.1.2", 367 | "regexp-clone": "1.0.0", 368 | "safe-buffer": "5.1.2", 369 | "sift": "7.0.1", 370 | "sliced": "1.0.1" 371 | }, 372 | "dependencies": { 373 | "ms": { 374 | "version": "2.1.2", 375 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 376 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" 377 | } 378 | } 379 | }, 380 | "mongoose-legacy-pluralize": { 381 | "version": "1.0.2", 382 | "resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz", 383 | "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" 384 | }, 385 | "mpath": { 386 | "version": "0.6.0", 387 | "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.6.0.tgz", 388 | "integrity": "sha512-i75qh79MJ5Xo/sbhxrDrPSEG0H/mr1kcZXJ8dH6URU5jD/knFxCVqVC/gVSW7GIXL/9hHWlT9haLbCXWOll3qw==" 389 | }, 390 | "mquery": { 391 | "version": "3.2.2", 392 | "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.2.tgz", 393 | "integrity": "sha512-XB52992COp0KP230I3qloVUbkLUxJIu328HBP2t2EsxSFtf4W1HPSOBWOXf1bqxK4Xbb66lfMJ+Bpfd9/yZE1Q==", 394 | "requires": { 395 | "bluebird": "3.5.1", 396 | "debug": "3.1.0", 397 | "regexp-clone": "^1.0.0", 398 | "safe-buffer": "5.1.2", 399 | "sliced": "1.0.1" 400 | }, 401 | "dependencies": { 402 | "bluebird": { 403 | "version": "3.5.1", 404 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", 405 | "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" 406 | }, 407 | "debug": { 408 | "version": "3.1.0", 409 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 410 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 411 | "requires": { 412 | "ms": "2.0.0" 413 | } 414 | } 415 | } 416 | }, 417 | "ms": { 418 | "version": "2.0.0", 419 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 420 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 421 | }, 422 | "negotiator": { 423 | "version": "0.6.2", 424 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", 425 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" 426 | }, 427 | "oauth2-server": { 428 | "version": "3.0.1", 429 | "resolved": "https://registry.npmjs.org/oauth2-server/-/oauth2-server-3.0.1.tgz", 430 | "integrity": "sha512-LFAT4MeTaOgdW+b8YMVMsPhJ8LrbSfVkYZRPgRmELJEJoXcchb/L4b9/lEmgpeNtjH8PlFiqof+YwI+y/oJuOg==", 431 | "requires": { 432 | "basic-auth": "^2.0.0", 433 | "bluebird": "^3.5.1", 434 | "lodash": "^4.17.10", 435 | "promisify-any": "^2.0.1", 436 | "statuses": "^1.5.0", 437 | "type-is": "^1.6.16" 438 | } 439 | }, 440 | "on-finished": { 441 | "version": "2.3.0", 442 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 443 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 444 | "requires": { 445 | "ee-first": "1.1.1" 446 | } 447 | }, 448 | "parseurl": { 449 | "version": "1.3.3", 450 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 451 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" 452 | }, 453 | "path-to-regexp": { 454 | "version": "0.1.7", 455 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", 456 | "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" 457 | }, 458 | "promisify-any": { 459 | "version": "2.0.1", 460 | "resolved": "https://registry.npmjs.org/promisify-any/-/promisify-any-2.0.1.tgz", 461 | "integrity": "sha1-QD4AqIE/F1JCq1D+M6afjuzkcwU=", 462 | "requires": { 463 | "bluebird": "^2.10.0", 464 | "co-bluebird": "^1.1.0", 465 | "is-generator": "^1.0.2" 466 | }, 467 | "dependencies": { 468 | "bluebird": { 469 | "version": "2.11.0", 470 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", 471 | "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=" 472 | } 473 | } 474 | }, 475 | "proxy-addr": { 476 | "version": "2.0.5", 477 | "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", 478 | "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", 479 | "requires": { 480 | "forwarded": "~0.1.2", 481 | "ipaddr.js": "1.9.0" 482 | } 483 | }, 484 | "qs": { 485 | "version": "6.7.0", 486 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", 487 | "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" 488 | }, 489 | "range-parser": { 490 | "version": "1.2.1", 491 | "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", 492 | "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" 493 | }, 494 | "raw-body": { 495 | "version": "2.4.0", 496 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", 497 | "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", 498 | "requires": { 499 | "bytes": "3.1.0", 500 | "http-errors": "1.7.2", 501 | "iconv-lite": "0.4.24", 502 | "unpipe": "1.0.0" 503 | } 504 | }, 505 | "regexp-clone": { 506 | "version": "1.0.0", 507 | "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz", 508 | "integrity": "sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==" 509 | }, 510 | "require_optional": { 511 | "version": "1.0.1", 512 | "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", 513 | "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", 514 | "requires": { 515 | "resolve-from": "^2.0.0", 516 | "semver": "^5.1.0" 517 | } 518 | }, 519 | "resolve-from": { 520 | "version": "2.0.0", 521 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", 522 | "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" 523 | }, 524 | "safe-buffer": { 525 | "version": "5.1.2", 526 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 527 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 528 | }, 529 | "safer-buffer": { 530 | "version": "2.1.2", 531 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 532 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 533 | }, 534 | "semver": { 535 | "version": "5.7.1", 536 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 537 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" 538 | }, 539 | "send": { 540 | "version": "0.17.1", 541 | "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", 542 | "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", 543 | "requires": { 544 | "debug": "2.6.9", 545 | "depd": "~1.1.2", 546 | "destroy": "~1.0.4", 547 | "encodeurl": "~1.0.2", 548 | "escape-html": "~1.0.3", 549 | "etag": "~1.8.1", 550 | "fresh": "0.5.2", 551 | "http-errors": "~1.7.2", 552 | "mime": "1.6.0", 553 | "ms": "2.1.1", 554 | "on-finished": "~2.3.0", 555 | "range-parser": "~1.2.1", 556 | "statuses": "~1.5.0" 557 | }, 558 | "dependencies": { 559 | "ms": { 560 | "version": "2.1.1", 561 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", 562 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" 563 | } 564 | } 565 | }, 566 | "serve-static": { 567 | "version": "1.14.1", 568 | "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", 569 | "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", 570 | "requires": { 571 | "encodeurl": "~1.0.2", 572 | "escape-html": "~1.0.3", 573 | "parseurl": "~1.3.3", 574 | "send": "0.17.1" 575 | } 576 | }, 577 | "setprototypeof": { 578 | "version": "1.1.1", 579 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", 580 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" 581 | }, 582 | "sift": { 583 | "version": "7.0.1", 584 | "resolved": "https://registry.npmjs.org/sift/-/sift-7.0.1.tgz", 585 | "integrity": "sha512-oqD7PMJ+uO6jV9EQCl0LrRw1OwsiPsiFQR5AR30heR+4Dl7jBBbDLnNvWiak20tzZlSE1H7RB30SX/1j/YYT7g==" 586 | }, 587 | "sliced": { 588 | "version": "1.0.1", 589 | "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", 590 | "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" 591 | }, 592 | "statuses": { 593 | "version": "1.5.0", 594 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 595 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" 596 | }, 597 | "toidentifier": { 598 | "version": "1.0.0", 599 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", 600 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" 601 | }, 602 | "type-is": { 603 | "version": "1.6.16", 604 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", 605 | "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", 606 | "requires": { 607 | "media-typer": "0.3.0", 608 | "mime-types": "~2.1.18" 609 | } 610 | }, 611 | "unpipe": { 612 | "version": "1.0.0", 613 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 614 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 615 | }, 616 | "utils-merge": { 617 | "version": "1.0.1", 618 | "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", 619 | "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" 620 | }, 621 | "vary": { 622 | "version": "1.1.2", 623 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 624 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 625 | } 626 | } 627 | } 628 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-oauth2-server-mongo-example", 3 | "version": "1.3.1", 4 | "description": "Working oauth2 server with MongoDB and minimal configuration", 5 | "keywords": [ 6 | "oauth2-server", 7 | "oauth2", 8 | "oauth", 9 | "mongodb-storage", 10 | "mongodb", 11 | "grant", 12 | "password", 13 | "client-credentials" 14 | ], 15 | "homepage": "https://github.com/pedroetb/node-oauth2-server-mongo-example", 16 | "license": "MIT", 17 | "author": "Pedro Trujillo", 18 | "contributors": [ 19 | { 20 | "name": "Pedro Trujillo", 21 | "email": "pedroetb@gmail.com" 22 | } 23 | ], 24 | "main": "app.js", 25 | "repository": { 26 | "type": "git", 27 | "url": "https://github.com/pedroetb/node-oauth2-server-mongo-example.git" 28 | }, 29 | "scripts": { 30 | "start": "node app.js" 31 | }, 32 | "dependencies": { 33 | "body-parser": "^1.19.0", 34 | "express": "^4.17.1", 35 | "mongoose": "^5.7.5", 36 | "oauth2-server": "^3.0.1" 37 | }, 38 | "engines": { 39 | "node": ">=4.0.0", 40 | "npm": ">=2.14.2" 41 | } 42 | } 43 | --------------------------------------------------------------------------------