middlewares.js 85 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.addRateLimit = exports.DEFAULT_ALLOWED_HEADERS = void 0;
  6. exports.allowCrossDomain = allowCrossDomain;
  7. exports.allowMethodOverride = allowMethodOverride;
  8. exports.checkIp = void 0;
  9. exports.enforceMasterKeyAccess = enforceMasterKeyAccess;
  10. exports.handleParseErrors = handleParseErrors;
  11. exports.handleParseHeaders = handleParseHeaders;
  12. exports.handleParseSession = void 0;
  13. exports.promiseEnforceMasterKeyAccess = promiseEnforceMasterKeyAccess;
  14. exports.promiseEnsureIdempotency = promiseEnsureIdempotency;
  15. var _cache = _interopRequireDefault(require("./cache"));
  16. var _node = _interopRequireDefault(require("parse/node"));
  17. var _Auth = _interopRequireDefault(require("./Auth"));
  18. var _Config = _interopRequireDefault(require("./Config"));
  19. var _ClientSDK = _interopRequireDefault(require("./ClientSDK"));
  20. var _logger = _interopRequireDefault(require("./logger"));
  21. var _rest = _interopRequireDefault(require("./rest"));
  22. var _MongoStorageAdapter = _interopRequireDefault(require("./Adapters/Storage/Mongo/MongoStorageAdapter"));
  23. var _PostgresStorageAdapter = _interopRequireDefault(require("./Adapters/Storage/Postgres/PostgresStorageAdapter"));
  24. var _expressRateLimit = _interopRequireDefault(require("express-rate-limit"));
  25. var _Definitions = require("./Options/Definitions");
  26. var _pathToRegexp = require("path-to-regexp");
  27. var _rateLimitRedis = _interopRequireDefault(require("rate-limit-redis"));
  28. var _redis = require("redis");
  29. var _net = require("net");
  30. function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
  31. const DEFAULT_ALLOWED_HEADERS = exports.DEFAULT_ALLOWED_HEADERS = 'X-Parse-Master-Key, X-Parse-REST-API-Key, X-Parse-Javascript-Key, X-Parse-Application-Id, X-Parse-Client-Version, X-Parse-Session-Token, X-Requested-With, X-Parse-Revocable-Session, X-Parse-Request-Id, Content-Type, Pragma, Cache-Control';
  32. const getMountForRequest = function (req) {
  33. const mountPathLength = req.originalUrl.length - req.url.length;
  34. const mountPath = req.originalUrl.slice(0, mountPathLength);
  35. return req.protocol + '://' + req.get('host') + mountPath;
  36. };
  37. const getBlockList = (ipRangeList, store) => {
  38. if (store.get('blockList')) return store.get('blockList');
  39. const blockList = new _net.BlockList();
  40. ipRangeList.forEach(fullIp => {
  41. if (fullIp === '::/0' || fullIp === '::') {
  42. store.set('allowAllIpv6', true);
  43. return;
  44. }
  45. if (fullIp === '0.0.0.0/0' || fullIp === '0.0.0.0') {
  46. store.set('allowAllIpv4', true);
  47. return;
  48. }
  49. const [ip, mask] = fullIp.split('/');
  50. if (!mask) {
  51. blockList.addAddress(ip, (0, _net.isIPv4)(ip) ? 'ipv4' : 'ipv6');
  52. } else {
  53. blockList.addSubnet(ip, Number(mask), (0, _net.isIPv4)(ip) ? 'ipv4' : 'ipv6');
  54. }
  55. });
  56. store.set('blockList', blockList);
  57. return blockList;
  58. };
  59. const checkIp = (ip, ipRangeList, store) => {
  60. const incomingIpIsV4 = (0, _net.isIPv4)(ip);
  61. const blockList = getBlockList(ipRangeList, store);
  62. if (store.get(ip)) return true;
  63. if (store.get('allowAllIpv4') && incomingIpIsV4) return true;
  64. if (store.get('allowAllIpv6') && !incomingIpIsV4) return true;
  65. const result = blockList.check(ip, incomingIpIsV4 ? 'ipv4' : 'ipv6');
  66. // If the ip is in the list, we store the result in the store
  67. // so we have a optimized path for the next request
  68. if (ipRangeList.includes(ip) && result) {
  69. store.set(ip, result);
  70. }
  71. return result;
  72. };
  73. // Checks that the request is authorized for this app and checks user
  74. // auth too.
  75. // The bodyparser should run before this middleware.
  76. // Adds info to the request:
  77. // req.config - the Config for this app
  78. // req.auth - the Auth for this request
  79. exports.checkIp = checkIp;
  80. function handleParseHeaders(req, res, next) {
  81. var mount = getMountForRequest(req);
  82. let context = {};
  83. if (req.get('X-Parse-Cloud-Context') != null) {
  84. try {
  85. context = JSON.parse(req.get('X-Parse-Cloud-Context'));
  86. if (Object.prototype.toString.call(context) !== '[object Object]') {
  87. throw 'Context is not an object';
  88. }
  89. } catch (e) {
  90. return malformedContext(req, res);
  91. }
  92. }
  93. var info = {
  94. appId: req.get('X-Parse-Application-Id'),
  95. sessionToken: req.get('X-Parse-Session-Token'),
  96. masterKey: req.get('X-Parse-Master-Key'),
  97. maintenanceKey: req.get('X-Parse-Maintenance-Key'),
  98. installationId: req.get('X-Parse-Installation-Id'),
  99. clientKey: req.get('X-Parse-Client-Key'),
  100. javascriptKey: req.get('X-Parse-Javascript-Key'),
  101. dotNetKey: req.get('X-Parse-Windows-Key'),
  102. restAPIKey: req.get('X-Parse-REST-API-Key'),
  103. clientVersion: req.get('X-Parse-Client-Version'),
  104. context: context
  105. };
  106. var basicAuth = httpAuth(req);
  107. if (basicAuth) {
  108. var basicAuthAppId = basicAuth.appId;
  109. if (_cache.default.get(basicAuthAppId)) {
  110. info.appId = basicAuthAppId;
  111. info.masterKey = basicAuth.masterKey || info.masterKey;
  112. info.javascriptKey = basicAuth.javascriptKey || info.javascriptKey;
  113. }
  114. }
  115. if (req.body) {
  116. // Unity SDK sends a _noBody key which needs to be removed.
  117. // Unclear at this point if action needs to be taken.
  118. delete req.body._noBody;
  119. }
  120. var fileViaJSON = false;
  121. if (!info.appId || !_cache.default.get(info.appId)) {
  122. // See if we can find the app id on the body.
  123. if (req.body instanceof Buffer) {
  124. // The only chance to find the app id is if this is a file
  125. // upload that actually is a JSON body. So try to parse it.
  126. // https://github.com/parse-community/parse-server/issues/6589
  127. // It is also possible that the client is trying to upload a file but forgot
  128. // to provide x-parse-app-id in header and parse a binary file will fail
  129. try {
  130. req.body = JSON.parse(req.body);
  131. } catch (e) {
  132. return invalidRequest(req, res);
  133. }
  134. fileViaJSON = true;
  135. }
  136. if (req.body) {
  137. delete req.body._RevocableSession;
  138. }
  139. if (req.body && req.body._ApplicationId && _cache.default.get(req.body._ApplicationId) && (!info.masterKey || _cache.default.get(req.body._ApplicationId).masterKey === info.masterKey)) {
  140. info.appId = req.body._ApplicationId;
  141. info.javascriptKey = req.body._JavaScriptKey || '';
  142. delete req.body._ApplicationId;
  143. delete req.body._JavaScriptKey;
  144. // TODO: test that the REST API formats generated by the other
  145. // SDKs are handled ok
  146. if (req.body._ClientVersion) {
  147. info.clientVersion = req.body._ClientVersion;
  148. delete req.body._ClientVersion;
  149. }
  150. if (req.body._InstallationId) {
  151. info.installationId = req.body._InstallationId;
  152. delete req.body._InstallationId;
  153. }
  154. if (req.body._SessionToken) {
  155. info.sessionToken = req.body._SessionToken;
  156. delete req.body._SessionToken;
  157. }
  158. if (req.body._MasterKey) {
  159. info.masterKey = req.body._MasterKey;
  160. delete req.body._MasterKey;
  161. }
  162. if (req.body._context) {
  163. if (req.body._context instanceof Object) {
  164. info.context = req.body._context;
  165. } else {
  166. try {
  167. info.context = JSON.parse(req.body._context);
  168. if (Object.prototype.toString.call(info.context) !== '[object Object]') {
  169. throw 'Context is not an object';
  170. }
  171. } catch (e) {
  172. return malformedContext(req, res);
  173. }
  174. }
  175. delete req.body._context;
  176. }
  177. if (req.body._ContentType) {
  178. req.headers['content-type'] = req.body._ContentType;
  179. delete req.body._ContentType;
  180. }
  181. } else {
  182. return invalidRequest(req, res);
  183. }
  184. }
  185. if (info.sessionToken && typeof info.sessionToken !== 'string') {
  186. info.sessionToken = info.sessionToken.toString();
  187. }
  188. if (info.clientVersion) {
  189. info.clientSDK = _ClientSDK.default.fromString(info.clientVersion);
  190. }
  191. if (fileViaJSON) {
  192. req.fileData = req.body.fileData;
  193. // We need to repopulate req.body with a buffer
  194. var base64 = req.body.base64;
  195. req.body = Buffer.from(base64, 'base64');
  196. }
  197. const clientIp = getClientIp(req);
  198. const config = _Config.default.get(info.appId, mount);
  199. if (config.state && config.state !== 'ok') {
  200. res.status(500);
  201. res.json({
  202. code: _node.default.Error.INTERNAL_SERVER_ERROR,
  203. error: `Invalid server state: ${config.state}`
  204. });
  205. return;
  206. }
  207. info.app = _cache.default.get(info.appId);
  208. req.config = config;
  209. req.config.headers = req.headers || {};
  210. req.config.ip = clientIp;
  211. req.info = info;
  212. const isMaintenance = req.config.maintenanceKey && info.maintenanceKey === req.config.maintenanceKey;
  213. if (isMaintenance) {
  214. var _req$config;
  215. if (checkIp(clientIp, req.config.maintenanceKeyIps || [], req.config.maintenanceKeyIpsStore)) {
  216. req.auth = new _Auth.default.Auth({
  217. config: req.config,
  218. installationId: info.installationId,
  219. isMaintenance: true
  220. });
  221. next();
  222. return;
  223. }
  224. const log = ((_req$config = req.config) === null || _req$config === void 0 ? void 0 : _req$config.loggerController) || _logger.default;
  225. log.error(`Request using maintenance key rejected as the request IP address '${clientIp}' is not set in Parse Server option 'maintenanceKeyIps'.`);
  226. }
  227. let isMaster = info.masterKey === req.config.masterKey;
  228. if (isMaster && !checkIp(clientIp, req.config.masterKeyIps || [], req.config.masterKeyIpsStore)) {
  229. var _req$config2;
  230. const log = ((_req$config2 = req.config) === null || _req$config2 === void 0 ? void 0 : _req$config2.loggerController) || _logger.default;
  231. log.error(`Request using master key rejected as the request IP address '${clientIp}' is not set in Parse Server option 'masterKeyIps'.`);
  232. isMaster = false;
  233. const error = new Error();
  234. error.status = 403;
  235. error.message = `unauthorized`;
  236. throw error;
  237. }
  238. if (isMaster) {
  239. req.auth = new _Auth.default.Auth({
  240. config: req.config,
  241. installationId: info.installationId,
  242. isMaster: true
  243. });
  244. return handleRateLimit(req, res, next);
  245. }
  246. var isReadOnlyMaster = info.masterKey === req.config.readOnlyMasterKey;
  247. if (typeof req.config.readOnlyMasterKey != 'undefined' && req.config.readOnlyMasterKey && isReadOnlyMaster) {
  248. req.auth = new _Auth.default.Auth({
  249. config: req.config,
  250. installationId: info.installationId,
  251. isMaster: true,
  252. isReadOnly: true
  253. });
  254. return handleRateLimit(req, res, next);
  255. }
  256. // Client keys are not required in parse-server, but if any have been configured in the server, validate them
  257. // to preserve original behavior.
  258. const keys = ['clientKey', 'javascriptKey', 'dotNetKey', 'restAPIKey'];
  259. const oneKeyConfigured = keys.some(function (key) {
  260. return req.config[key] !== undefined;
  261. });
  262. const oneKeyMatches = keys.some(function (key) {
  263. return req.config[key] !== undefined && info[key] === req.config[key];
  264. });
  265. if (oneKeyConfigured && !oneKeyMatches) {
  266. return invalidRequest(req, res);
  267. }
  268. if (req.url == '/login') {
  269. delete info.sessionToken;
  270. }
  271. if (req.userFromJWT) {
  272. req.auth = new _Auth.default.Auth({
  273. config: req.config,
  274. installationId: info.installationId,
  275. isMaster: false,
  276. user: req.userFromJWT
  277. });
  278. return handleRateLimit(req, res, next);
  279. }
  280. if (!info.sessionToken) {
  281. req.auth = new _Auth.default.Auth({
  282. config: req.config,
  283. installationId: info.installationId,
  284. isMaster: false
  285. });
  286. }
  287. handleRateLimit(req, res, next);
  288. }
  289. const handleRateLimit = async (req, res, next) => {
  290. const rateLimits = req.config.rateLimits || [];
  291. try {
  292. await Promise.all(rateLimits.map(async limit => {
  293. const pathExp = new RegExp(limit.path);
  294. if (pathExp.test(req.url)) {
  295. await limit.handler(req, res, err => {
  296. if (err) {
  297. if (err.code === _node.default.Error.CONNECTION_FAILED) {
  298. throw err;
  299. }
  300. req.config.loggerController.error('An unknown error occured when attempting to apply the rate limiter: ', err);
  301. }
  302. });
  303. }
  304. }));
  305. } catch (error) {
  306. res.status(429);
  307. res.json({
  308. code: _node.default.Error.CONNECTION_FAILED,
  309. error: error.message
  310. });
  311. return;
  312. }
  313. next();
  314. };
  315. const handleParseSession = async (req, res, next) => {
  316. try {
  317. const info = req.info;
  318. if (req.auth || req.url === '/sessions/me') {
  319. next();
  320. return;
  321. }
  322. let requestAuth = null;
  323. if (info.sessionToken && req.url === '/upgradeToRevocableSession' && info.sessionToken.indexOf('r:') != 0) {
  324. requestAuth = await _Auth.default.getAuthForLegacySessionToken({
  325. config: req.config,
  326. installationId: info.installationId,
  327. sessionToken: info.sessionToken
  328. });
  329. } else {
  330. requestAuth = await _Auth.default.getAuthForSessionToken({
  331. config: req.config,
  332. installationId: info.installationId,
  333. sessionToken: info.sessionToken
  334. });
  335. }
  336. req.auth = requestAuth;
  337. next();
  338. } catch (error) {
  339. if (error instanceof _node.default.Error) {
  340. next(error);
  341. return;
  342. }
  343. // TODO: Determine the correct error scenario.
  344. req.config.loggerController.error('error getting auth for sessionToken', error);
  345. throw new _node.default.Error(_node.default.Error.UNKNOWN_ERROR, error);
  346. }
  347. };
  348. exports.handleParseSession = handleParseSession;
  349. function getClientIp(req) {
  350. return req.ip;
  351. }
  352. function httpAuth(req) {
  353. if (!(req.req || req).headers.authorization) return;
  354. var header = (req.req || req).headers.authorization;
  355. var appId, masterKey, javascriptKey;
  356. // parse header
  357. var authPrefix = 'basic ';
  358. var match = header.toLowerCase().indexOf(authPrefix);
  359. if (match == 0) {
  360. var encodedAuth = header.substring(authPrefix.length, header.length);
  361. var credentials = decodeBase64(encodedAuth).split(':');
  362. if (credentials.length == 2) {
  363. appId = credentials[0];
  364. var key = credentials[1];
  365. var jsKeyPrefix = 'javascript-key=';
  366. var matchKey = key.indexOf(jsKeyPrefix);
  367. if (matchKey == 0) {
  368. javascriptKey = key.substring(jsKeyPrefix.length, key.length);
  369. } else {
  370. masterKey = key;
  371. }
  372. }
  373. }
  374. return {
  375. appId: appId,
  376. masterKey: masterKey,
  377. javascriptKey: javascriptKey
  378. };
  379. }
  380. function decodeBase64(str) {
  381. return Buffer.from(str, 'base64').toString();
  382. }
  383. function allowCrossDomain(appId) {
  384. return (req, res, next) => {
  385. const config = _Config.default.get(appId, getMountForRequest(req));
  386. let allowHeaders = DEFAULT_ALLOWED_HEADERS;
  387. if (config && config.allowHeaders) {
  388. allowHeaders += `, ${config.allowHeaders.join(', ')}`;
  389. }
  390. const baseOrigins = typeof (config === null || config === void 0 ? void 0 : config.allowOrigin) === 'string' ? [config.allowOrigin] : (config === null || config === void 0 ? void 0 : config.allowOrigin) ?? ['*'];
  391. const requestOrigin = req.headers.origin;
  392. const allowOrigins = requestOrigin && baseOrigins.includes(requestOrigin) ? requestOrigin : baseOrigins[0];
  393. res.header('Access-Control-Allow-Origin', allowOrigins);
  394. res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
  395. res.header('Access-Control-Allow-Headers', allowHeaders);
  396. res.header('Access-Control-Expose-Headers', 'X-Parse-Job-Status-Id, X-Parse-Push-Status-Id');
  397. // intercept OPTIONS method
  398. if ('OPTIONS' == req.method) {
  399. res.sendStatus(200);
  400. } else {
  401. next();
  402. }
  403. };
  404. }
  405. function allowMethodOverride(req, res, next) {
  406. if (req.method === 'POST' && req.body._method) {
  407. req.originalMethod = req.method;
  408. req.method = req.body._method;
  409. delete req.body._method;
  410. }
  411. next();
  412. }
  413. function handleParseErrors(err, req, res, next) {
  414. const log = req.config && req.config.loggerController || _logger.default;
  415. if (err instanceof _node.default.Error) {
  416. if (req.config && req.config.enableExpressErrorHandler) {
  417. return next(err);
  418. }
  419. let httpStatus;
  420. // TODO: fill out this mapping
  421. switch (err.code) {
  422. case _node.default.Error.INTERNAL_SERVER_ERROR:
  423. httpStatus = 500;
  424. break;
  425. case _node.default.Error.OBJECT_NOT_FOUND:
  426. httpStatus = 404;
  427. break;
  428. default:
  429. httpStatus = 400;
  430. }
  431. res.status(httpStatus);
  432. res.json({
  433. code: err.code,
  434. error: err.message
  435. });
  436. log.error('Parse error: ', err);
  437. } else if (err.status && err.message) {
  438. res.status(err.status);
  439. res.json({
  440. error: err.message
  441. });
  442. if (!(process && process.env.TESTING)) {
  443. next(err);
  444. }
  445. } else {
  446. log.error('Uncaught internal server error.', err, err.stack);
  447. res.status(500);
  448. res.json({
  449. code: _node.default.Error.INTERNAL_SERVER_ERROR,
  450. message: 'Internal server error.'
  451. });
  452. if (!(process && process.env.TESTING)) {
  453. next(err);
  454. }
  455. }
  456. }
  457. function enforceMasterKeyAccess(req, res, next) {
  458. if (!req.auth.isMaster) {
  459. res.status(403);
  460. res.end('{"error":"unauthorized: master key is required"}');
  461. return;
  462. }
  463. next();
  464. }
  465. function promiseEnforceMasterKeyAccess(request) {
  466. if (!request.auth.isMaster) {
  467. const error = new Error();
  468. error.status = 403;
  469. error.message = 'unauthorized: master key is required';
  470. throw error;
  471. }
  472. return Promise.resolve();
  473. }
  474. const addRateLimit = (route, config, cloud) => {
  475. if (typeof config === 'string') {
  476. config = _Config.default.get(config);
  477. }
  478. for (const key in route) {
  479. if (!_Definitions.RateLimitOptions[key]) {
  480. throw `Invalid rate limit option "${key}"`;
  481. }
  482. }
  483. if (!config.rateLimits) {
  484. config.rateLimits = [];
  485. }
  486. const redisStore = {
  487. connectionPromise: Promise.resolve(),
  488. store: null
  489. };
  490. if (route.redisUrl) {
  491. const client = (0, _redis.createClient)({
  492. url: route.redisUrl
  493. });
  494. redisStore.connectionPromise = async () => {
  495. if (client.isOpen) {
  496. return;
  497. }
  498. try {
  499. await client.connect();
  500. } catch (e) {
  501. var _config;
  502. const log = ((_config = config) === null || _config === void 0 ? void 0 : _config.loggerController) || _logger.default;
  503. log.error(`Could not connect to redisURL in rate limit: ${e}`);
  504. }
  505. };
  506. redisStore.connectionPromise();
  507. redisStore.store = new _rateLimitRedis.default({
  508. sendCommand: async (...args) => {
  509. await redisStore.connectionPromise();
  510. return client.sendCommand(args);
  511. }
  512. });
  513. }
  514. let transformPath = route.requestPath.split('/*').join('/(.*)');
  515. if (transformPath === '*') {
  516. transformPath = '(.*)';
  517. }
  518. config.rateLimits.push({
  519. path: (0, _pathToRegexp.pathToRegexp)(transformPath),
  520. handler: (0, _expressRateLimit.default)({
  521. windowMs: route.requestTimeWindow,
  522. max: route.requestCount,
  523. message: route.errorResponseMessage || _Definitions.RateLimitOptions.errorResponseMessage.default,
  524. handler: (request, response, next, options) => {
  525. throw {
  526. code: _node.default.Error.CONNECTION_FAILED,
  527. message: options.message
  528. };
  529. },
  530. skip: request => {
  531. var _request$auth;
  532. if (request.ip === '127.0.0.1' && !route.includeInternalRequests) {
  533. return true;
  534. }
  535. if (route.includeMasterKey) {
  536. return false;
  537. }
  538. if (route.requestMethods) {
  539. if (Array.isArray(route.requestMethods)) {
  540. if (!route.requestMethods.includes(request.method)) {
  541. return true;
  542. }
  543. } else {
  544. const regExp = new RegExp(route.requestMethods);
  545. if (!regExp.test(request.method)) {
  546. return true;
  547. }
  548. }
  549. }
  550. return (_request$auth = request.auth) === null || _request$auth === void 0 ? void 0 : _request$auth.isMaster;
  551. },
  552. keyGenerator: async request => {
  553. if (route.zone === _node.default.Server.RateLimitZone.global) {
  554. return request.config.appId;
  555. }
  556. const token = request.info.sessionToken;
  557. if (route.zone === _node.default.Server.RateLimitZone.session && token) {
  558. return token;
  559. }
  560. if (route.zone === _node.default.Server.RateLimitZone.user && token) {
  561. var _request$auth2;
  562. if (!request.auth) {
  563. await new Promise(resolve => handleParseSession(request, null, resolve));
  564. }
  565. if ((_request$auth2 = request.auth) !== null && _request$auth2 !== void 0 && (_request$auth2 = _request$auth2.user) !== null && _request$auth2 !== void 0 && _request$auth2.id && request.zone === 'user') {
  566. return request.auth.user.id;
  567. }
  568. }
  569. return request.config.ip;
  570. },
  571. store: redisStore.store
  572. }),
  573. cloud
  574. });
  575. _Config.default.put(config);
  576. };
  577. /**
  578. * Deduplicates a request to ensure idempotency. Duplicates are determined by the request ID
  579. * in the request header. If a request has no request ID, it is executed anyway.
  580. * @param {*} req The request to evaluate.
  581. * @returns Promise<{}>
  582. */
  583. exports.addRateLimit = addRateLimit;
  584. function promiseEnsureIdempotency(req) {
  585. // Enable feature only for MongoDB
  586. if (!(req.config.database.adapter instanceof _MongoStorageAdapter.default || req.config.database.adapter instanceof _PostgresStorageAdapter.default)) {
  587. return Promise.resolve();
  588. }
  589. // Get parameters
  590. const config = req.config;
  591. const requestId = ((req || {}).headers || {})['x-parse-request-id'];
  592. const {
  593. paths,
  594. ttl
  595. } = config.idempotencyOptions;
  596. if (!requestId || !config.idempotencyOptions) {
  597. return Promise.resolve();
  598. }
  599. // Request path may contain trailing slashes, depending on the original request, so remove
  600. // leading and trailing slashes to make it easier to specify paths in the configuration
  601. const reqPath = req.path.replace(/^\/|\/$/, '');
  602. // Determine whether idempotency is enabled for current request path
  603. let match = false;
  604. for (const path of paths) {
  605. // Assume one wants a path to always match from the beginning to prevent any mistakes
  606. const regex = new RegExp(path.charAt(0) === '^' ? path : '^' + path);
  607. if (reqPath.match(regex)) {
  608. match = true;
  609. break;
  610. }
  611. }
  612. if (!match) {
  613. return Promise.resolve();
  614. }
  615. // Try to store request
  616. const expiryDate = new Date(new Date().setSeconds(new Date().getSeconds() + ttl));
  617. return _rest.default.create(config, _Auth.default.master(config), '_Idempotency', {
  618. reqId: requestId,
  619. expire: _node.default._encode(expiryDate)
  620. }).catch(e => {
  621. if (e.code == _node.default.Error.DUPLICATE_VALUE) {
  622. throw new _node.default.Error(_node.default.Error.DUPLICATE_REQUEST, 'Duplicate request');
  623. }
  624. throw e;
  625. });
  626. }
  627. function invalidRequest(req, res) {
  628. res.status(403);
  629. res.end('{"error":"unauthorized"}');
  630. }
  631. function malformedContext(req, res) {
  632. res.status(400);
  633. res.json({
  634. code: _node.default.Error.INVALID_JSON,
  635. error: 'Invalid object for context.'
  636. });
  637. }
  638. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfY2FjaGUiLCJfaW50ZXJvcFJlcXVpcmVEZWZhdWx0IiwicmVxdWlyZSIsIl9ub2RlIiwiX0F1dGgiLCJfQ29uZmlnIiwiX0NsaWVudFNESyIsIl9sb2dnZXIiLCJfcmVzdCIsIl9Nb25nb1N0b3JhZ2VBZGFwdGVyIiwiX1Bvc3RncmVzU3RvcmFnZUFkYXB0ZXIiLCJfZXhwcmVzc1JhdGVMaW1pdCIsIl9EZWZpbml0aW9ucyIsIl9wYXRoVG9SZWdleHAiLCJfcmF0ZUxpbWl0UmVkaXMiLCJfcmVkaXMiLCJfbmV0IiwiZSIsIl9fZXNNb2R1bGUiLCJkZWZhdWx0IiwiREVGQVVMVF9BTExPV0VEX0hFQURFUlMiLCJleHBvcnRzIiwiZ2V0TW91bnRGb3JSZXF1ZXN0IiwicmVxIiwibW91bnRQYXRoTGVuZ3RoIiwib3JpZ2luYWxVcmwiLCJsZW5ndGgiLCJ1cmwiLCJtb3VudFBhdGgiLCJzbGljZSIsInByb3RvY29sIiwiZ2V0IiwiZ2V0QmxvY2tMaXN0IiwiaXBSYW5nZUxpc3QiLCJzdG9yZSIsImJsb2NrTGlzdCIsIkJsb2NrTGlzdCIsImZvckVhY2giLCJmdWxsSXAiLCJzZXQiLCJpcCIsIm1hc2siLCJzcGxpdCIsImFkZEFkZHJlc3MiLCJpc0lQdjQiLCJhZGRTdWJuZXQiLCJOdW1iZXIiLCJjaGVja0lwIiwiaW5jb21pbmdJcElzVjQiLCJyZXN1bHQiLCJjaGVjayIsImluY2x1ZGVzIiwiaGFuZGxlUGFyc2VIZWFkZXJzIiwicmVzIiw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