ParseServer.js 88 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _Options = require("./Options");
  7. var _defaults = _interopRequireDefault(require("./defaults"));
  8. var logging = _interopRequireWildcard(require("./logger"));
  9. var _Config = _interopRequireDefault(require("./Config"));
  10. var _PromiseRouter = _interopRequireDefault(require("./PromiseRouter"));
  11. var _requiredParameter = _interopRequireDefault(require("./requiredParameter"));
  12. var _AnalyticsRouter = require("./Routers/AnalyticsRouter");
  13. var _ClassesRouter = require("./Routers/ClassesRouter");
  14. var _FeaturesRouter = require("./Routers/FeaturesRouter");
  15. var _FilesRouter = require("./Routers/FilesRouter");
  16. var _FunctionsRouter = require("./Routers/FunctionsRouter");
  17. var _GlobalConfigRouter = require("./Routers/GlobalConfigRouter");
  18. var _GraphQLRouter = require("./Routers/GraphQLRouter");
  19. var _HooksRouter = require("./Routers/HooksRouter");
  20. var _IAPValidationRouter = require("./Routers/IAPValidationRouter");
  21. var _InstallationsRouter = require("./Routers/InstallationsRouter");
  22. var _LogsRouter = require("./Routers/LogsRouter");
  23. var _ParseLiveQueryServer = require("./LiveQuery/ParseLiveQueryServer");
  24. var _PagesRouter = require("./Routers/PagesRouter");
  25. var _PublicAPIRouter = require("./Routers/PublicAPIRouter");
  26. var _PushRouter = require("./Routers/PushRouter");
  27. var _CloudCodeRouter = require("./Routers/CloudCodeRouter");
  28. var _RolesRouter = require("./Routers/RolesRouter");
  29. var _SchemasRouter = require("./Routers/SchemasRouter");
  30. var _SessionsRouter = require("./Routers/SessionsRouter");
  31. var _UsersRouter = require("./Routers/UsersRouter");
  32. var _PurgeRouter = require("./Routers/PurgeRouter");
  33. var _AudiencesRouter = require("./Routers/AudiencesRouter");
  34. var _AggregateRouter = require("./Routers/AggregateRouter");
  35. var _ParseServerRESTController = require("./ParseServerRESTController");
  36. var controllers = _interopRequireWildcard(require("./Controllers"));
  37. var _ParseGraphQLServer = require("./GraphQL/ParseGraphQLServer");
  38. var _SecurityRouter = require("./Routers/SecurityRouter");
  39. var _CheckRunner = _interopRequireDefault(require("./Security/CheckRunner"));
  40. var _Deprecator = _interopRequireDefault(require("./Deprecator/Deprecator"));
  41. var _DefinedSchemas = require("./SchemaMigrations/DefinedSchemas");
  42. var _Definitions = _interopRequireDefault(require("./Options/Definitions"));
  43. function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
  44. function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
  45. function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
  46. function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
  47. function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
  48. function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
  49. function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
  50. function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
  51. // ParseServer - open-source compatible API Server for Parse apps
  52. var batch = require('./batch'),
  53. bodyParser = require('body-parser'),
  54. express = require('express'),
  55. middlewares = require('./middlewares'),
  56. Parse = require('parse/node').Parse,
  57. {
  58. parse
  59. } = require('graphql'),
  60. path = require('path'),
  61. fs = require('fs');
  62. // Mutate the Parse object to add the Cloud Code handlers
  63. addParseCloud();
  64. // ParseServer works like a constructor of an express app.
  65. // https://parseplatform.org/parse-server/api/master/ParseServerOptions.html
  66. class ParseServer {
  67. /**
  68. * @constructor
  69. * @param {ParseServerOptions} options the parse server initialization options
  70. */
  71. constructor(options) {
  72. // Scan for deprecated Parse Server options
  73. _Deprecator.default.scanParseServerOptions(options);
  74. const interfaces = JSON.parse(JSON.stringify(_Definitions.default));
  75. function getValidObject(root) {
  76. const result = {};
  77. for (const key in root) {
  78. if (Object.prototype.hasOwnProperty.call(root[key], 'type')) {
  79. if (root[key].type.endsWith('[]')) {
  80. result[key] = [getValidObject(interfaces[root[key].type.slice(0, -2)])];
  81. } else {
  82. result[key] = getValidObject(interfaces[root[key].type]);
  83. }
  84. } else {
  85. result[key] = '';
  86. }
  87. }
  88. return result;
  89. }
  90. const optionsBlueprint = getValidObject(interfaces['ParseServerOptions']);
  91. function validateKeyNames(original, ref, name = '') {
  92. let result = [];
  93. const prefix = name + (name !== '' ? '.' : '');
  94. for (const key in original) {
  95. if (!Object.prototype.hasOwnProperty.call(ref, key)) {
  96. result.push(prefix + key);
  97. } else {
  98. if (ref[key] === '') continue;
  99. let res = [];
  100. if (Array.isArray(original[key]) && Array.isArray(ref[key])) {
  101. const type = ref[key][0];
  102. original[key].forEach((item, idx) => {
  103. if (typeof item === 'object' && item !== null) {
  104. res = res.concat(validateKeyNames(item, type, prefix + key + `[${idx}]`));
  105. }
  106. });
  107. } else if (typeof original[key] === 'object' && typeof ref[key] === 'object') {
  108. res = validateKeyNames(original[key], ref[key], prefix + key);
  109. }
  110. result = result.concat(res);
  111. }
  112. }
  113. return result;
  114. }
  115. const diff = validateKeyNames(options, optionsBlueprint);
  116. if (diff.length > 0) {
  117. const logger = logging.logger;
  118. logger.error(`Invalid key(s) found in Parse Server configuration: ${diff.join(', ')}`);
  119. }
  120. // Set option defaults
  121. injectDefaults(options);
  122. const {
  123. appId = (0, _requiredParameter.default)('You must provide an appId!'),
  124. masterKey = (0, _requiredParameter.default)('You must provide a masterKey!'),
  125. javascriptKey,
  126. serverURL = (0, _requiredParameter.default)('You must provide a serverURL!')
  127. } = options;
  128. // Initialize the node client SDK automatically
  129. Parse.initialize(appId, javascriptKey || 'unused', masterKey);
  130. Parse.serverURL = serverURL;
  131. _Config.default.validateOptions(options);
  132. const allControllers = controllers.getControllers(options);
  133. options.state = 'initialized';
  134. this.config = _Config.default.put(Object.assign({}, options, allControllers));
  135. this.config.masterKeyIpsStore = new Map();
  136. this.config.maintenanceKeyIpsStore = new Map();
  137. logging.setLogger(allControllers.loggerController);
  138. }
  139. /**
  140. * Starts Parse Server as an express app; this promise resolves when Parse Server is ready to accept requests.
  141. */
  142. async start() {
  143. try {
  144. var _cacheController$adap;
  145. if (this.config.state === 'ok') {
  146. return this;
  147. }
  148. this.config.state = 'starting';
  149. _Config.default.put(this.config);
  150. const {
  151. databaseController,
  152. hooksController,
  153. cacheController,
  154. cloud,
  155. security,
  156. schema,
  157. liveQueryController
  158. } = this.config;
  159. try {
  160. await databaseController.performInitialization();
  161. } catch (e) {
  162. if (e.code !== Parse.Error.DUPLICATE_VALUE) {
  163. throw e;
  164. }
  165. }
  166. const pushController = await controllers.getPushController(this.config);
  167. await hooksController.load();
  168. const startupPromises = [];
  169. if (schema) {
  170. startupPromises.push(new _DefinedSchemas.DefinedSchemas(schema, this.config).execute());
  171. }
  172. if ((_cacheController$adap = cacheController.adapter) !== null && _cacheController$adap !== void 0 && _cacheController$adap.connect && typeof cacheController.adapter.connect === 'function') {
  173. startupPromises.push(cacheController.adapter.connect());
  174. }
  175. startupPromises.push(liveQueryController.connect());
  176. await Promise.all(startupPromises);
  177. if (cloud) {
  178. addParseCloud();
  179. if (typeof cloud === 'function') {
  180. await Promise.resolve(cloud(Parse));
  181. } else if (typeof cloud === 'string') {
  182. var _json;
  183. let json;
  184. if (process.env.npm_package_json) {
  185. json = require(process.env.npm_package_json);
  186. }
  187. if (process.env.npm_package_type === 'module' || ((_json = json) === null || _json === void 0 ? void 0 : _json.type) === 'module') {
  188. await import(path.resolve(process.cwd(), cloud));
  189. } else {
  190. require(path.resolve(process.cwd(), cloud));
  191. }
  192. } else {
  193. throw "argument 'cloud' must either be a string or a function";
  194. }
  195. await new Promise(resolve => setTimeout(resolve, 10));
  196. }
  197. if (security && security.enableCheck && security.enableCheckLog) {
  198. new _CheckRunner.default(security).run();
  199. }
  200. this.config.state = 'ok';
  201. this.config = _objectSpread(_objectSpread({}, this.config), pushController);
  202. _Config.default.put(this.config);
  203. return this;
  204. } catch (error) {
  205. console.error(error);
  206. this.config.state = 'error';
  207. throw error;
  208. }
  209. }
  210. get app() {
  211. if (!this._app) {
  212. this._app = ParseServer.app(this.config);
  213. }
  214. return this._app;
  215. }
  216. handleShutdown() {
  217. var _this$liveQueryServer;
  218. const promises = [];
  219. const {
  220. adapter: databaseAdapter
  221. } = this.config.databaseController;
  222. if (databaseAdapter && typeof databaseAdapter.handleShutdown === 'function') {
  223. promises.push(databaseAdapter.handleShutdown());
  224. }
  225. const {
  226. adapter: fileAdapter
  227. } = this.config.filesController;
  228. if (fileAdapter && typeof fileAdapter.handleShutdown === 'function') {
  229. promises.push(fileAdapter.handleShutdown());
  230. }
  231. const {
  232. adapter: cacheAdapter
  233. } = this.config.cacheController;
  234. if (cacheAdapter && typeof cacheAdapter.handleShutdown === 'function') {
  235. promises.push(cacheAdapter.handleShutdown());
  236. }
  237. if ((_this$liveQueryServer = this.liveQueryServer) !== null && _this$liveQueryServer !== void 0 && (_this$liveQueryServer = _this$liveQueryServer.server) !== null && _this$liveQueryServer !== void 0 && _this$liveQueryServer.close) {
  238. promises.push(new Promise(resolve => this.liveQueryServer.server.close(resolve)));
  239. }
  240. if (this.liveQueryServer) {
  241. promises.push(this.liveQueryServer.shutdown());
  242. }
  243. return (promises.length > 0 ? Promise.all(promises) : Promise.resolve()).then(() => {
  244. if (this.config.serverCloseComplete) {
  245. this.config.serverCloseComplete();
  246. }
  247. });
  248. }
  249. /**
  250. * @static
  251. * Create an express app for the parse server
  252. * @param {Object} options let you specify the maxUploadSize when creating the express app */
  253. static app(options) {
  254. const {
  255. maxUploadSize = '20mb',
  256. appId,
  257. directAccess,
  258. pages,
  259. rateLimit = []
  260. } = options;
  261. // This app serves the Parse API directly.
  262. // It's the equivalent of https://api.parse.com/1 in the hosted Parse API.
  263. var api = express();
  264. //api.use("/apps", express.static(__dirname + "/public"));
  265. api.use(middlewares.allowCrossDomain(appId));
  266. // File handling needs to be before default middlewares are applied
  267. api.use('/', new _FilesRouter.FilesRouter().expressRouter({
  268. maxUploadSize: maxUploadSize
  269. }));
  270. api.use('/health', function (req, res) {
  271. res.status(options.state === 'ok' ? 200 : 503);
  272. if (options.state === 'starting') {
  273. res.set('Retry-After', 1);
  274. }
  275. res.json({
  276. status: options.state
  277. });
  278. });
  279. api.use('/', bodyParser.urlencoded({
  280. extended: false
  281. }), pages.enableRouter ? new _PagesRouter.PagesRouter(pages).expressRouter() : new _PublicAPIRouter.PublicAPIRouter().expressRouter());
  282. api.use(bodyParser.json({
  283. type: '*/*',
  284. limit: maxUploadSize
  285. }));
  286. api.use(middlewares.allowMethodOverride);
  287. api.use(middlewares.handleParseHeaders);
  288. const routes = Array.isArray(rateLimit) ? rateLimit : [rateLimit];
  289. for (const route of routes) {
  290. middlewares.addRateLimit(route, options);
  291. }
  292. api.use(middlewares.handleParseSession);
  293. const appRouter = ParseServer.promiseRouter({
  294. appId
  295. });
  296. api.use(appRouter.expressRouter());
  297. api.use(middlewares.handleParseErrors);
  298. // run the following when not testing
  299. if (!process.env.TESTING) {
  300. //This causes tests to spew some useless warnings, so disable in test
  301. /* istanbul ignore next */
  302. process.on('uncaughtException', err => {
  303. if (err.code === 'EADDRINUSE') {
  304. // user-friendly message for this common error
  305. process.stderr.write(`Unable to listen on port ${err.port}. The port is already in use.`);
  306. process.exit(0);
  307. } else {
  308. if (err.message) {
  309. process.stderr.write('An uncaught exception occurred: ' + err.message);
  310. }
  311. if (err.stack) {
  312. process.stderr.write('Stack Trace:\n' + err.stack);
  313. } else {
  314. process.stderr.write(err);
  315. }
  316. process.exit(1);
  317. }
  318. });
  319. // verify the server url after a 'mount' event is received
  320. /* istanbul ignore next */
  321. api.on('mount', async function () {
  322. await new Promise(resolve => setTimeout(resolve, 1000));
  323. ParseServer.verifyServerUrl();
  324. });
  325. }
  326. if (process.env.PARSE_SERVER_ENABLE_EXPERIMENTAL_DIRECT_ACCESS === '1' || directAccess) {
  327. Parse.CoreManager.setRESTController((0, _ParseServerRESTController.ParseServerRESTController)(appId, appRouter));
  328. }
  329. return api;
  330. }
  331. static promiseRouter({
  332. appId
  333. }) {
  334. const routers = [new _ClassesRouter.ClassesRouter(), new _UsersRouter.UsersRouter(), new _SessionsRouter.SessionsRouter(), new _RolesRouter.RolesRouter(), new _AnalyticsRouter.AnalyticsRouter(), new _InstallationsRouter.InstallationsRouter(), new _FunctionsRouter.FunctionsRouter(), new _SchemasRouter.SchemasRouter(), new _PushRouter.PushRouter(), new _LogsRouter.LogsRouter(), new _IAPValidationRouter.IAPValidationRouter(), new _FeaturesRouter.FeaturesRouter(), new _GlobalConfigRouter.GlobalConfigRouter(), new _GraphQLRouter.GraphQLRouter(), new _PurgeRouter.PurgeRouter(), new _HooksRouter.HooksRouter(), new _CloudCodeRouter.CloudCodeRouter(), new _AudiencesRouter.AudiencesRouter(), new _AggregateRouter.AggregateRouter(), new _SecurityRouter.SecurityRouter()];
  335. const routes = routers.reduce((memo, router) => {
  336. return memo.concat(router.routes);
  337. }, []);
  338. const appRouter = new _PromiseRouter.default(routes, appId);
  339. batch.mountOnto(appRouter);
  340. return appRouter;
  341. }
  342. /**
  343. * starts the parse server's express app
  344. * @param {ParseServerOptions} options to use to start the server
  345. * @returns {ParseServer} the parse server instance
  346. */
  347. async startApp(options) {
  348. try {
  349. await this.start();
  350. } catch (e) {
  351. console.error('Error on ParseServer.startApp: ', e);
  352. throw e;
  353. }
  354. const app = express();
  355. if (options.middleware) {
  356. let middleware;
  357. if (typeof options.middleware == 'string') {
  358. middleware = require(path.resolve(process.cwd(), options.middleware));
  359. } else {
  360. middleware = options.middleware; // use as-is let express fail
  361. }
  362. app.use(middleware);
  363. }
  364. app.use(options.mountPath, this.app);
  365. if (options.mountGraphQL === true || options.mountPlayground === true) {
  366. let graphQLCustomTypeDefs = undefined;
  367. if (typeof options.graphQLSchema === 'string') {
  368. graphQLCustomTypeDefs = parse(fs.readFileSync(options.graphQLSchema, 'utf8'));
  369. } else if (typeof options.graphQLSchema === 'object' || typeof options.graphQLSchema === 'function') {
  370. graphQLCustomTypeDefs = options.graphQLSchema;
  371. }
  372. const parseGraphQLServer = new _ParseGraphQLServer.ParseGraphQLServer(this, {
  373. graphQLPath: options.graphQLPath,
  374. playgroundPath: options.playgroundPath,
  375. graphQLCustomTypeDefs
  376. });
  377. if (options.mountGraphQL) {
  378. parseGraphQLServer.applyGraphQL(app);
  379. }
  380. if (options.mountPlayground) {
  381. parseGraphQLServer.applyPlayground(app);
  382. }
  383. }
  384. const server = await new Promise(resolve => {
  385. app.listen(options.port, options.host, function () {
  386. resolve(this);
  387. });
  388. });
  389. this.server = server;
  390. if (options.startLiveQueryServer || options.liveQueryServerOptions) {
  391. this.liveQueryServer = await ParseServer.createLiveQueryServer(server, options.liveQueryServerOptions, options);
  392. }
  393. if (options.trustProxy) {
  394. app.set('trust proxy', options.trustProxy);
  395. }
  396. /* istanbul ignore next */
  397. if (!process.env.TESTING) {
  398. configureListeners(this);
  399. }
  400. this.expressApp = app;
  401. return this;
  402. }
  403. /**
  404. * Creates a new ParseServer and starts it.
  405. * @param {ParseServerOptions} options used to start the server
  406. * @returns {ParseServer} the parse server instance
  407. */
  408. static async startApp(options) {
  409. const parseServer = new ParseServer(options);
  410. return parseServer.startApp(options);
  411. }
  412. /**
  413. * Helper method to create a liveQuery server
  414. * @static
  415. * @param {Server} httpServer an optional http server to pass
  416. * @param {LiveQueryServerOptions} config options for the liveQueryServer
  417. * @param {ParseServerOptions} options options for the ParseServer
  418. * @returns {Promise<ParseLiveQueryServer>} the live query server instance
  419. */
  420. static async createLiveQueryServer(httpServer, config, options) {
  421. if (!httpServer || config && config.port) {
  422. var app = express();
  423. httpServer = require('http').createServer(app);
  424. httpServer.listen(config.port);
  425. }
  426. const server = new _ParseLiveQueryServer.ParseLiveQueryServer(httpServer, config, options);
  427. await server.connect();
  428. return server;
  429. }
  430. static async verifyServerUrl() {
  431. // perform a health check on the serverURL value
  432. if (Parse.serverURL) {
  433. var _response$headers;
  434. const isValidHttpUrl = string => {
  435. let url;
  436. try {
  437. url = new URL(string);
  438. } catch (_) {
  439. return false;
  440. }
  441. return url.protocol === 'http:' || url.protocol === 'https:';
  442. };
  443. const url = `${Parse.serverURL.replace(/\/$/, '')}/health`;
  444. if (!isValidHttpUrl(url)) {
  445. console.warn(`\nWARNING, Unable to connect to '${Parse.serverURL}' as the URL is invalid.` + ` Cloud code and push notifications may be unavailable!\n`);
  446. return;
  447. }
  448. const request = require('./request');
  449. const response = await request({
  450. url
  451. }).catch(response => response);
  452. const json = response.data || null;
  453. const retry = (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers['retry-after'];
  454. if (retry) {
  455. await new Promise(resolve => setTimeout(resolve, retry * 1000));
  456. return this.verifyServerUrl();
  457. }
  458. if (response.status !== 200 || (json === null || json === void 0 ? void 0 : json.status) !== 'ok') {
  459. /* eslint-disable no-console */
  460. console.warn(`\nWARNING, Unable to connect to '${Parse.serverURL}'.` + ` Cloud code and push notifications may be unavailable!\n`);
  461. /* eslint-enable no-console */
  462. return;
  463. }
  464. return true;
  465. }
  466. }
  467. }
  468. function addParseCloud() {
  469. const ParseCloud = require('./cloud-code/Parse.Cloud');
  470. const ParseServer = require('./cloud-code/Parse.Server');
  471. Object.defineProperty(Parse, 'Server', {
  472. get() {
  473. const conf = _Config.default.get(Parse.applicationId);
  474. return _objectSpread(_objectSpread({}, conf), ParseServer);
  475. },
  476. set(newVal) {
  477. newVal.appId = Parse.applicationId;
  478. _Config.default.put(newVal);
  479. },
  480. configurable: true
  481. });
  482. Object.assign(Parse.Cloud, ParseCloud);
  483. global.Parse = Parse;
  484. }
  485. function injectDefaults(options) {
  486. Object.keys(_defaults.default).forEach(key => {
  487. if (!Object.prototype.hasOwnProperty.call(options, key)) {
  488. options[key] = _defaults.default[key];
  489. }
  490. });
  491. if (!Object.prototype.hasOwnProperty.call(options, 'serverURL')) {
  492. options.serverURL = `http://localhost:${options.port}${options.mountPath}`;
  493. }
  494. // Reserved Characters
  495. if (options.appId) {
  496. const regex = /[!#$%'()*+&/:;=?@[\]{}^,|<>]/g;
  497. if (options.appId.match(regex)) {
  498. console.warn(`\nWARNING, appId that contains special characters can cause issues while using with urls.\n`);
  499. }
  500. }
  501. // Backwards compatibility
  502. if (options.userSensitiveFields) {
  503. /* eslint-disable no-console */
  504. !process.env.TESTING && console.warn(`\nDEPRECATED: userSensitiveFields has been replaced by protectedFields allowing the ability to protect fields in all classes with CLP. \n`);
  505. /* eslint-enable no-console */
  506. const userSensitiveFields = Array.from(new Set([...(_defaults.default.userSensitiveFields || []), ...(options.userSensitiveFields || [])]));
  507. // If the options.protectedFields is unset,
  508. // it'll be assigned the default above.
  509. // Here, protect against the case where protectedFields
  510. // is set, but doesn't have _User.
  511. if (!('_User' in options.protectedFields)) {
  512. options.protectedFields = Object.assign({
  513. _User: []
  514. }, options.protectedFields);
  515. }
  516. options.protectedFields['_User']['*'] = Array.from(new Set([...(options.protectedFields['_User']['*'] || []), ...userSensitiveFields]));
  517. }
  518. // Merge protectedFields options with defaults.
  519. Object.keys(_defaults.default.protectedFields).forEach(c => {
  520. const cur = options.protectedFields[c];
  521. if (!cur) {
  522. options.protectedFields[c] = _defaults.default.protectedFields[c];
  523. } else {
  524. Object.keys(_defaults.default.protectedFields[c]).forEach(r => {
  525. const unq = new Set([...(options.protectedFields[c][r] || []), ..._defaults.default.protectedFields[c][r]]);
  526. options.protectedFields[c][r] = Array.from(unq);
  527. });
  528. }
  529. });
  530. }
  531. // Those can't be tested as it requires a subprocess
  532. /* istanbul ignore next */
  533. function configureListeners(parseServer) {
  534. const server = parseServer.server;
  535. const sockets = {};
  536. /* Currently, express doesn't shut down immediately after receiving SIGINT/SIGTERM if it has client connections that haven't timed out. (This is a known issue with node - https://github.com/nodejs/node/issues/2642)
  537. This function, along with `destroyAliveConnections()`, intend to fix this behavior such that parse server will close all open connections and initiate the shutdown process as soon as it receives a SIGINT/SIGTERM signal. */
  538. server.on('connection', socket => {
  539. const socketId = socket.remoteAddress + ':' + socket.remotePort;
  540. sockets[socketId] = socket;
  541. socket.on('close', () => {
  542. delete sockets[socketId];
  543. });
  544. });
  545. const destroyAliveConnections = function () {
  546. for (const socketId in sockets) {
  547. try {
  548. sockets[socketId].destroy();
  549. } catch (e) {
  550. /* */
  551. }
  552. }
  553. };
  554. const handleShutdown = function () {
  555. process.stdout.write('Termination signal received. Shutting down.');
  556. destroyAliveConnections();
  557. server.close();
  558. parseServer.handleShutdown();
  559. };
  560. process.on('SIGTERM', handleShutdown);
  561. process.on('SIGINT', handleShutdown);
  562. }
  563. var _default = exports.default = ParseServer;
  564. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfT3B0aW9ucyIsInJlcXVpcmUiLCJfZGVmYXVsdHMiLCJfaW50ZXJvcFJlcXVpcmVEZWZhdWx0IiwibG9nZ2luZyIsIl9pbnRlcm9wUmVxdWlyZVdpbGRjYXJkIiwiX0NvbmZpZyIsIl9Qcm9taXNlUm91dGVyIiwiX3JlcXVpcmVkUGFyYW1ldGVyIiwiX0FuYWx5dGljc1JvdXRlciIsIl9DbGFzc2VzUm91dGVyIiwiX0ZlYXR1cmVzUm91dGVyIiwiX0ZpbGVzUm91dGVyIiwiX0Z1bmN0aW9uc1JvdXRlciIsIl9HbG9iYWxDb25maWdSb3V0ZXIiLCJfR3JhcGhRTFJvdXRlciIsIl9Ib29rc1JvdXRlciIsIl9JQVBWYWxpZGF0aW9uUm91dGVyIiwiX0luc3RhbGxhdGlvbnNSb3V0ZXIiLCJfTG9nc1JvdXRlciIsIl9QYXJzZUxpdmVRdWVyeVNlcnZlciIsIl9QYWdlc1JvdXRlciIsIl9QdWJsaWNBUElSb3V0ZXIiLCJf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ICAgICAgY29uc3QgcmVzdWx0ID0ge307XG4gICAgICBmb3IgKGNvbnN0IGtleSBpbiByb290KSB7XG4gICAgICAgIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocm9vdFtrZXldLCAndHlwZScpKSB7XG4gICAgICAgICAgaWYgKHJvb3Rba2V5XS50eXBlLmVuZHNXaXRoKCdbXScpKSB7XG4gICAgICAgICAgICByZXN1bHRba2V5XSA9IFtnZXRWYWxpZE9iamVjdChpbnRlcmZhY2VzW3Jvb3Rba2V5XS50eXBlLnNsaWNlKDAsIC0yKV0pXTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzdWx0W2tleV0gPSBnZXRWYWxpZE9iamVjdChpbnRlcmZhY2VzW3Jvb3Rba2V5XS50eXBlXSk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHJlc3VsdFtrZXldID0gJyc7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY29uc3Qgb3B0aW9uc0JsdWVwcmludCA9IGdldFZhbGlkT2JqZWN0KGludGVyZmFjZXNbJ1BhcnNlU2VydmVyT3B0aW9ucyddKTtcblxuICAgIGZ1bmN0aW9uIHZhbGlkYXRlS2V5TmFtZXMob3JpZ2luYWwsIHJlZiwgbmFtZSA9ICcnKSB7XG4gICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICBjb25zdCBwcmVmaXggPSBuYW1lICsgKG5hbWUgIT09ICcnID8gJy4nIDogJycpO1xuICAgICAgZm9yIChjb25zdCBrZXkgaW4gb3JpZ2luYWwpIHtcbiAgICAgICAgaWYgKCFPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocmVmLCBrZXkpKSB7XG4gICAgICAgICAgcmVzdWx0LnB1c2gocHJlZml4ICsga2V5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAg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