-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
Copy pathDefinitions.js
1155 lines (1155 loc) · 54.7 KB
/
Definitions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
**** GENERATED CODE ****
This code has been generated by resources/buildConfigDefinitions.js
Do not edit manually, but update Options/index.js
*/
var parsers = require('./parsers');
module.exports.SchemaOptions = {
afterMigration: {
env: 'PARSE_SERVER_SCHEMA_AFTER_MIGRATION',
help: 'Execute a callback after running schema migrations.',
},
beforeMigration: {
env: 'PARSE_SERVER_SCHEMA_BEFORE_MIGRATION',
help: 'Execute a callback before running schema migrations.',
},
definitions: {
env: 'PARSE_SERVER_SCHEMA_DEFINITIONS',
help:
'Rest representation on Parse.Schema https://docs.parseplatform.org/rest/guide/#adding-a-schema',
required: true,
action: parsers.objectParser,
default: [],
},
deleteExtraFields: {
env: 'PARSE_SERVER_SCHEMA_DELETE_EXTRA_FIELDS',
help:
'Is true if Parse Server should delete any fields not defined in a schema definition. This should only be used during development.',
action: parsers.booleanParser,
default: false,
},
lockSchemas: {
env: 'PARSE_SERVER_SCHEMA_LOCK_SCHEMAS',
help:
'Is true if Parse Server will reject any attempts to modify the schema while the server is running.',
action: parsers.booleanParser,
default: false,
},
recreateModifiedFields: {
env: 'PARSE_SERVER_SCHEMA_RECREATE_MODIFIED_FIELDS',
help:
'Is true if Parse Server should recreate any fields that are different between the current database schema and theschema definition. This should only be used during development.',
action: parsers.booleanParser,
default: false,
},
strict: {
env: 'PARSE_SERVER_SCHEMA_STRICT',
help: 'Is true if Parse Server should exit if schema update fail.',
action: parsers.booleanParser,
default: false,
},
};
module.exports.ParseServerOptions = {
accountLockout: {
env: 'PARSE_SERVER_ACCOUNT_LOCKOUT',
help: 'The account lockout policy for failed login attempts.',
action: parsers.objectParser,
type: 'AccountLockoutOptions',
},
allowClientClassCreation: {
env: 'PARSE_SERVER_ALLOW_CLIENT_CLASS_CREATION',
help: 'Enable (or disable) client class creation, defaults to false',
action: parsers.booleanParser,
default: false,
},
allowCustomObjectId: {
env: 'PARSE_SERVER_ALLOW_CUSTOM_OBJECT_ID',
help: 'Enable (or disable) custom objectId',
action: parsers.booleanParser,
default: false,
},
allowExpiredAuthDataToken: {
env: 'PARSE_SERVER_ALLOW_EXPIRED_AUTH_DATA_TOKEN',
help:
'Allow a user to log in even if the 3rd party authentication token that was used to sign in to their account has expired. If this is set to `false`, then the token will be validated every time the user signs in to their account. This refers to the token that is stored in the `_User.authData` field. Defaults to `false`.',
action: parsers.booleanParser,
default: false,
},
allowHeaders: {
env: 'PARSE_SERVER_ALLOW_HEADERS',
help: 'Add headers to Access-Control-Allow-Headers',
action: parsers.arrayParser,
},
allowOrigin: {
env: 'PARSE_SERVER_ALLOW_ORIGIN',
help:
'Sets origins for Access-Control-Allow-Origin. This can be a string for a single origin or an array of strings for multiple origins.',
action: parsers.arrayParser,
},
analyticsAdapter: {
env: 'PARSE_SERVER_ANALYTICS_ADAPTER',
help: 'Adapter module for the analytics',
action: parsers.moduleOrObjectParser,
},
appId: {
env: 'PARSE_SERVER_APPLICATION_ID',
help: 'Your Parse Application ID',
required: true,
},
appName: {
env: 'PARSE_SERVER_APP_NAME',
help: 'Sets the app name',
},
auth: {
env: 'PARSE_SERVER_AUTH_PROVIDERS',
help:
'Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication',
},
cacheAdapter: {
env: 'PARSE_SERVER_CACHE_ADAPTER',
help: 'Adapter module for the cache',
action: parsers.moduleOrObjectParser,
},
cacheMaxSize: {
env: 'PARSE_SERVER_CACHE_MAX_SIZE',
help: 'Sets the maximum size for the in memory cache, defaults to 10000',
action: parsers.numberParser('cacheMaxSize'),
default: 10000,
},
cacheTTL: {
env: 'PARSE_SERVER_CACHE_TTL',
help: 'Sets the TTL for the in memory cache (in ms), defaults to 5000 (5 seconds)',
action: parsers.numberParser('cacheTTL'),
default: 5000,
},
clientKey: {
env: 'PARSE_SERVER_CLIENT_KEY',
help: 'Key for iOS, MacOS, tvOS clients',
},
cloud: {
env: 'PARSE_SERVER_CLOUD',
help: 'Full path to your cloud code main.js',
},
cluster: {
env: 'PARSE_SERVER_CLUSTER',
help: 'Run with cluster, optionally set the number of processes default to os.cpus().length',
action: parsers.numberOrBooleanParser,
},
collectionPrefix: {
env: 'PARSE_SERVER_COLLECTION_PREFIX',
help: 'A collection prefix for the classes',
default: '',
},
convertEmailToLowercase: {
env: 'PARSE_SERVER_CONVERT_EMAIL_TO_LOWERCASE',
help:
'Optional. If set to `true`, the `email` property of a user is automatically converted to lowercase before being stored in the database. Consequently, queries must match the case as stored in the database, which would be lowercase in this scenario. If `false`, the `email` property is stored as set, without any case modifications. Default is `false`.',
action: parsers.booleanParser,
default: false,
},
convertUsernameToLowercase: {
env: 'PARSE_SERVER_CONVERT_USERNAME_TO_LOWERCASE',
help:
'Optional. If set to `true`, the `username` property of a user is automatically converted to lowercase before being stored in the database. Consequently, queries must match the case as stored in the database, which would be lowercase in this scenario. If `false`, the `username` property is stored as set, without any case modifications. Default is `false`.',
action: parsers.booleanParser,
default: false,
},
customPages: {
env: 'PARSE_SERVER_CUSTOM_PAGES',
help: 'custom pages for password validation and reset',
action: parsers.objectParser,
type: 'CustomPagesOptions',
default: {},
},
databaseAdapter: {
env: 'PARSE_SERVER_DATABASE_ADAPTER',
help:
'Adapter module for the database; any options that are not explicitly described here are passed directly to the database client.',
action: parsers.moduleOrObjectParser,
},
databaseOptions: {
env: 'PARSE_SERVER_DATABASE_OPTIONS',
help: 'Options to pass to the database client',
action: parsers.objectParser,
type: 'DatabaseOptions',
},
databaseURI: {
env: 'PARSE_SERVER_DATABASE_URI',
help: 'The full URI to your database. Supported databases are mongodb or postgres.',
required: true,
default: 'mongodb://localhost:27017/parse',
},
defaultLimit: {
env: 'PARSE_SERVER_DEFAULT_LIMIT',
help: 'Default value for limit option on queries, defaults to `100`.',
action: parsers.numberParser('defaultLimit'),
default: 100,
},
directAccess: {
env: 'PARSE_SERVER_DIRECT_ACCESS',
help:
'Set to `true` if Parse requests within the same Node.js environment as Parse Server should be routed to Parse Server directly instead of via the HTTP interface. Default is `false`.<br><br>If set to `false` then Parse requests within the same Node.js environment as Parse Server are executed as HTTP requests sent to Parse Server via the `serverURL`. For example, a `Parse.Query` in Cloud Code is calling Parse Server via a HTTP request. The server is essentially making a HTTP request to itself, unnecessarily using network resources such as network ports.<br><br>\u26A0\uFE0F In environments where multiple Parse Server instances run behind a load balancer and Parse requests within the current Node.js environment should be routed via the load balancer and distributed as HTTP requests among all instances via the `serverURL`, this should be set to `false`.',
action: parsers.booleanParser,
default: true,
},
dotNetKey: {
env: 'PARSE_SERVER_DOT_NET_KEY',
help: 'Key for Unity and .Net SDK',
},
emailAdapter: {
env: 'PARSE_SERVER_EMAIL_ADAPTER',
help: 'Adapter module for email sending',
action: parsers.moduleOrObjectParser,
},
emailVerifyTokenReuseIfValid: {
env: 'PARSE_SERVER_EMAIL_VERIFY_TOKEN_REUSE_IF_VALID',
help:
'Set to `true` if a email verification token should be reused in case another token is requested but there is a token that is still valid, i.e. has not expired. This avoids the often observed issue that a user requests multiple emails and does not know which link contains a valid token because each newly generated token would invalidate the previous token.<br><br>Default is `false`.<br>Requires option `verifyUserEmails: true`.',
action: parsers.booleanParser,
default: false,
},
emailVerifyTokenValidityDuration: {
env: 'PARSE_SERVER_EMAIL_VERIFY_TOKEN_VALIDITY_DURATION',
help:
'Set the validity duration of the email verification token in seconds after which the token expires. The token is used in the link that is set in the email. After the token expires, the link becomes invalid and a new link has to be sent. If the option is not set or set to `undefined`, then the token never expires.<br><br>For example, to expire the token after 2 hours, set a value of 7200 seconds (= 60 seconds * 60 minutes * 2 hours).<br><br>Default is `undefined`.<br>Requires option `verifyUserEmails: true`.',
action: parsers.numberParser('emailVerifyTokenValidityDuration'),
},
enableAnonymousUsers: {
env: 'PARSE_SERVER_ENABLE_ANON_USERS',
help: 'Enable (or disable) anonymous users, defaults to true',
action: parsers.booleanParser,
default: true,
},
enableCollationCaseComparison: {
env: 'PARSE_SERVER_ENABLE_COLLATION_CASE_COMPARISON',
help:
'Optional. If set to `true`, the collation rule of case comparison for queries and indexes is enabled. Enable this option to run Parse Server with MongoDB Atlas Serverless or AWS Amazon DocumentDB. If `false`, the collation rule of case comparison is disabled. Default is `false`.',
action: parsers.booleanParser,
default: false,
},
enableExpressErrorHandler: {
env: 'PARSE_SERVER_ENABLE_EXPRESS_ERROR_HANDLER',
help: 'Enables the default express error handler for all errors',
action: parsers.booleanParser,
default: false,
},
encodeParseObjectInCloudFunction: {
env: 'PARSE_SERVER_ENCODE_PARSE_OBJECT_IN_CLOUD_FUNCTION',
help:
'If set to `true`, a `Parse.Object` that is in the payload when calling a Cloud Function will be converted to an instance of `Parse.Object`. If `false`, the object will not be converted and instead be a plain JavaScript object, which contains the raw data of a `Parse.Object` but is not an actual instance of `Parse.Object`. Default is `false`. <br><br>\u2139\uFE0F The expected behavior would be that the object is converted to an instance of `Parse.Object`, so you would normally set this option to `true`. The default is `false` because this is a temporary option that has been introduced to avoid a breaking change when fixing a bug where JavaScript objects are not converted to actual instances of `Parse.Object`.',
action: parsers.booleanParser,
default: true,
},
encryptionKey: {
env: 'PARSE_SERVER_ENCRYPTION_KEY',
help: 'Key for encrypting your files',
},
enforcePrivateUsers: {
env: 'PARSE_SERVER_ENFORCE_PRIVATE_USERS',
help: 'Set to true if new users should be created without public read and write access.',
action: parsers.booleanParser,
default: true,
},
expireInactiveSessions: {
env: 'PARSE_SERVER_EXPIRE_INACTIVE_SESSIONS',
help:
'Sets whether we should expire the inactive sessions, defaults to true. If false, all new sessions are created with no expiration date.',
action: parsers.booleanParser,
default: true,
},
extendSessionOnUse: {
env: 'PARSE_SERVER_EXTEND_SESSION_ON_USE',
help:
"Whether Parse Server should automatically extend a valid session by the sessionLength. In order to reduce the number of session updates in the database, a session will only be extended when a request is received after at least half of the current session's lifetime has passed.",
action: parsers.booleanParser,
default: false,
},
fileKey: {
env: 'PARSE_SERVER_FILE_KEY',
help: 'Key for your files',
},
filesAdapter: {
env: 'PARSE_SERVER_FILES_ADAPTER',
help: 'Adapter module for the files sub-system',
action: parsers.moduleOrObjectParser,
},
fileUpload: {
env: 'PARSE_SERVER_FILE_UPLOAD_OPTIONS',
help: 'Options for file uploads',
action: parsers.objectParser,
type: 'FileUploadOptions',
default: {},
},
graphQLPath: {
env: 'PARSE_SERVER_GRAPHQL_PATH',
help: 'Mount path for the GraphQL endpoint, defaults to /graphql',
default: '/graphql',
},
graphQLSchema: {
env: 'PARSE_SERVER_GRAPH_QLSCHEMA',
help: 'Full path to your GraphQL custom schema.graphql file',
},
host: {
env: 'PARSE_SERVER_HOST',
help: 'The host to serve ParseServer on, defaults to 0.0.0.0',
default: '0.0.0.0',
},
idempotencyOptions: {
env: 'PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_OPTIONS',
help:
'Options for request idempotency to deduplicate identical requests that may be caused by network issues. Caution, this is an experimental feature that may not be appropriate for production.',
action: parsers.objectParser,
type: 'IdempotencyOptions',
default: {},
},
javascriptKey: {
env: 'PARSE_SERVER_JAVASCRIPT_KEY',
help: 'Key for the Javascript SDK',
},
jsonLogs: {
env: 'JSON_LOGS',
help: 'Log as structured JSON objects',
action: parsers.booleanParser,
},
liveQuery: {
env: 'PARSE_SERVER_LIVE_QUERY',
help: "parse-server's LiveQuery configuration object",
action: parsers.objectParser,
type: 'LiveQueryOptions',
},
liveQueryServerOptions: {
env: 'PARSE_SERVER_LIVE_QUERY_SERVER_OPTIONS',
help: 'Live query server configuration options (will start the liveQuery server)',
action: parsers.objectParser,
type: 'LiveQueryServerOptions',
},
loggerAdapter: {
env: 'PARSE_SERVER_LOGGER_ADAPTER',
help: 'Adapter module for the logging sub-system',
action: parsers.moduleOrObjectParser,
},
logLevel: {
env: 'PARSE_SERVER_LOG_LEVEL',
help: 'Sets the level for logs',
},
logLevels: {
env: 'PARSE_SERVER_LOG_LEVELS',
help: '(Optional) Overrides the log levels used internally by Parse Server to log events.',
action: parsers.objectParser,
type: 'LogLevels',
default: {},
},
logsFolder: {
env: 'PARSE_SERVER_LOGS_FOLDER',
help: "Folder for the logs (defaults to './logs'); set to null to disable file based logging",
default: './logs',
},
maintenanceKey: {
env: 'PARSE_SERVER_MAINTENANCE_KEY',
help:
'(Optional) The maintenance key is used for modifying internal and read-only fields of Parse Server.<br><br>\u26A0\uFE0F This key is not intended to be used as part of a regular operation of Parse Server. This key is intended to conduct out-of-band changes such as one-time migrations or data correction tasks. Internal fields are not officially documented and may change at any time without publication in release changelogs. We strongly advice not to rely on internal fields as part of your regular operation and to investigate the implications of any planned changes *directly in the source code* of your current version of Parse Server.',
required: true,
},
maintenanceKeyIps: {
env: 'PARSE_SERVER_MAINTENANCE_KEY_IPS',
help:
"(Optional) Restricts the use of maintenance key permissions to a list of IP addresses or ranges.<br><br>This option accepts a list of single IP addresses, for example `['10.0.0.1', '10.0.0.2']`. You can also use CIDR notation to specify an IP address range, for example `['10.0.1.0/24']`.<br><br><b>Special scenarios:</b><br>- Setting an empty array `[]` means that the maintenance key cannot be used even in Parse Server Cloud Code. This value cannot be set via an environment variable as there is no way to pass an empty array to Parse Server via an environment variable.<br>- Setting `['0.0.0.0/0', '::0']` means to allow any IPv4 and IPv6 address to use the maintenance key and effectively disables the IP filter.<br><br><b>Considerations:</b><br>- IPv4 and IPv6 addresses are not compared against each other. Each IP version (IPv4 and IPv6) needs to be considered separately. For example, `['0.0.0.0/0']` allows any IPv4 address and blocks every IPv6 address. Conversely, `['::0']` allows any IPv6 address and blocks every IPv4 address.<br>- Keep in mind that the IP version in use depends on the network stack of the environment in which Parse Server runs. A local environment may use a different IP version than a remote environment. For example, it's possible that locally the value `['0.0.0.0/0']` allows the request IP because the environment is using IPv4, but when Parse Server is deployed remotely the request IP is blocked because the remote environment is using IPv6.<br>- When setting the option via an environment variable the notation is a comma-separated string, for example `\"0.0.0.0/0,::0\"`.<br>- IPv6 zone indices (`%` suffix) are not supported, for example `fe80::1%eth0`, `fe80::1%1` or `::1%lo`.<br><br>Defaults to `['127.0.0.1', '::1']` which means that only `localhost`, the server instance on which Parse Server runs, is allowed to use the maintenance key.",
action: parsers.arrayParser,
default: ['127.0.0.1', '::1'],
},
masterKey: {
env: 'PARSE_SERVER_MASTER_KEY',
help: 'Your Parse Master Key',
required: true,
},
masterKeyIps: {
env: 'PARSE_SERVER_MASTER_KEY_IPS',
help:
"(Optional) Restricts the use of master key permissions to a list of IP addresses or ranges.<br><br>This option accepts a list of single IP addresses, for example `['10.0.0.1', '10.0.0.2']`. You can also use CIDR notation to specify an IP address range, for example `['10.0.1.0/24']`.<br><br><b>Special scenarios:</b><br>- Setting an empty array `[]` means that the master key cannot be used even in Parse Server Cloud Code. This value cannot be set via an environment variable as there is no way to pass an empty array to Parse Server via an environment variable.<br>- Setting `['0.0.0.0/0', '::0']` means to allow any IPv4 and IPv6 address to use the master key and effectively disables the IP filter.<br><br><b>Considerations:</b><br>- IPv4 and IPv6 addresses are not compared against each other. Each IP version (IPv4 and IPv6) needs to be considered separately. For example, `['0.0.0.0/0']` allows any IPv4 address and blocks every IPv6 address. Conversely, `['::0']` allows any IPv6 address and blocks every IPv4 address.<br>- Keep in mind that the IP version in use depends on the network stack of the environment in which Parse Server runs. A local environment may use a different IP version than a remote environment. For example, it's possible that locally the value `['0.0.0.0/0']` allows the request IP because the environment is using IPv4, but when Parse Server is deployed remotely the request IP is blocked because the remote environment is using IPv6.<br>- When setting the option via an environment variable the notation is a comma-separated string, for example `\"0.0.0.0/0,::0\"`.<br>- IPv6 zone indices (`%` suffix) are not supported, for example `fe80::1%eth0`, `fe80::1%1` or `::1%lo`.<br><br>Defaults to `['127.0.0.1', '::1']` which means that only `localhost`, the server instance on which Parse Server runs, is allowed to use the master key.",
action: parsers.arrayParser,
default: ['127.0.0.1', '::1'],
},
masterKeyTtl: {
env: 'PARSE_SERVER_MASTER_KEY_TTL',
help:
'(Optional) The duration in seconds for which the current `masterKey` is being used before it is requested again if `masterKey` is set to a function. If `masterKey` is not set to a function, this option has no effect. Default is `0`, which means the master key is requested by invoking the `masterKey` function every time the master key is used internally by Parse Server.',
action: parsers.numberParser('masterKeyTtl'),
},
maxLimit: {
env: 'PARSE_SERVER_MAX_LIMIT',
help: 'Max value for limit option on queries, defaults to unlimited',
action: parsers.numberParser('maxLimit'),
},
maxLogFiles: {
env: 'PARSE_SERVER_MAX_LOG_FILES',
help:
"Maximum number of logs to keep. If not set, no logs will be removed. This can be a number of files or number of days. If using days, add 'd' as the suffix. (default: null)",
action: parsers.numberOrStringParser('maxLogFiles'),
},
maxUploadSize: {
env: 'PARSE_SERVER_MAX_UPLOAD_SIZE',
help: 'Max file size for uploads, defaults to 20mb',
default: '20mb',
},
middleware: {
env: 'PARSE_SERVER_MIDDLEWARE',
help: 'middleware for express server, can be string or function',
},
mountGraphQL: {
env: 'PARSE_SERVER_MOUNT_GRAPHQL',
help: 'Mounts the GraphQL endpoint',
action: parsers.booleanParser,
default: false,
},
mountPath: {
env: 'PARSE_SERVER_MOUNT_PATH',
help: 'Mount path for the server, defaults to /parse',
default: '/parse',
},
mountPlayground: {
env: 'PARSE_SERVER_MOUNT_PLAYGROUND',
help: 'Mounts the GraphQL Playground - never use this option in production',
action: parsers.booleanParser,
default: false,
},
objectIdSize: {
env: 'PARSE_SERVER_OBJECT_ID_SIZE',
help: "Sets the number of characters in generated object id's, default 10",
action: parsers.numberParser('objectIdSize'),
default: 10,
},
pages: {
env: 'PARSE_SERVER_PAGES',
help: 'The options for pages such as password reset and email verification.',
action: parsers.objectParser,
type: 'PagesOptions',
default: {},
},
passwordPolicy: {
env: 'PARSE_SERVER_PASSWORD_POLICY',
help: 'The password policy for enforcing password related rules.',
action: parsers.objectParser,
type: 'PasswordPolicyOptions',
},
playgroundPath: {
env: 'PARSE_SERVER_PLAYGROUND_PATH',
help: 'Mount path for the GraphQL Playground, defaults to /playground',
default: '/playground',
},
port: {
env: 'PORT',
help: 'The port to run the ParseServer, defaults to 1337.',
action: parsers.numberParser('port'),
default: 1337,
},
preserveFileName: {
env: 'PARSE_SERVER_PRESERVE_FILE_NAME',
help: 'Enable (or disable) the addition of a unique hash to the file names',
action: parsers.booleanParser,
default: false,
},
preventLoginWithUnverifiedEmail: {
env: 'PARSE_SERVER_PREVENT_LOGIN_WITH_UNVERIFIED_EMAIL',
help:
'Set to `true` to prevent a user from logging in if the email has not yet been verified and email verification is required.<br><br>Default is `false`.<br>Requires option `verifyUserEmails: true`.',
action: parsers.booleanParser,
default: false,
},
preventSignupWithUnverifiedEmail: {
env: 'PARSE_SERVER_PREVENT_SIGNUP_WITH_UNVERIFIED_EMAIL',
help:
"If set to `true` it prevents a user from signing up if the email has not yet been verified and email verification is required. In that case the server responds to the sign-up with HTTP status 400 and a Parse Error 205 `EMAIL_NOT_FOUND`. If set to `false` the server responds with HTTP status 200, and client SDKs return an unauthenticated Parse User without session token. In that case subsequent requests fail until the user's email address is verified.<br><br>Default is `false`.<br>Requires option `verifyUserEmails: true`.",
action: parsers.booleanParser,
default: false,
},
protectedFields: {
env: 'PARSE_SERVER_PROTECTED_FIELDS',
help: 'Protected fields that should be treated with extra security when fetching details.',
action: parsers.objectParser,
default: {
_User: {
'*': ['email'],
},
},
},
publicServerURL: {
env: 'PARSE_PUBLIC_SERVER_URL',
help: 'Public URL to your parse server with http:// or https://.',
},
push: {
env: 'PARSE_SERVER_PUSH',
help:
'Configuration for push, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#push-notifications',
action: parsers.objectParser,
},
rateLimit: {
env: 'PARSE_SERVER_RATE_LIMIT',
help:
"Options to limit repeated requests to Parse Server APIs. This can be used to protect sensitive endpoints such as `/requestPasswordReset` from brute-force attacks or Parse Server as a whole from denial-of-service (DoS) attacks.<br><br>\u2139\uFE0F Mind the following limitations:<br>- rate limits applied per IP address; this limits protection against distributed denial-of-service (DDoS) attacks where many requests are coming from various IP addresses<br>- if multiple Parse Server instances are behind a load balancer or ran in a cluster, each instance will calculate it's own request rates, independent from other instances; this limits the applicability of this feature when using a load balancer and another rate limiting solution that takes requests across all instances into account may be more suitable<br>- this feature provides basic protection against denial-of-service attacks, but a more sophisticated solution works earlier in the request flow and prevents a malicious requests to even reach a server instance; it's therefore recommended to implement a solution according to architecture and user case.",
action: parsers.arrayParser,
type: 'RateLimitOptions[]',
default: [],
},
readOnlyMasterKey: {
env: 'PARSE_SERVER_READ_ONLY_MASTER_KEY',
help: 'Read-only key, which has the same capabilities as MasterKey without writes',
},
requestKeywordDenylist: {
env: 'PARSE_SERVER_REQUEST_KEYWORD_DENYLIST',
help:
'An array of keys and values that are prohibited in database read and write requests to prevent potential security vulnerabilities. It is possible to specify only a key (`{"key":"..."}`), only a value (`{"value":"..."}`) or a key-value pair (`{"key":"...","value":"..."}`). The specification can use the following types: `boolean`, `numeric` or `string`, where `string` will be interpreted as a regex notation. Request data is deep-scanned for matching definitions to detect also any nested occurrences. Defaults are patterns that are likely to be used in malicious requests. Setting this option will override the default patterns.',
action: parsers.arrayParser,
default: [
{
key: '_bsontype',
value: 'Code',
},
{
key: 'constructor',
},
{
key: '__proto__',
},
],
},
restAPIKey: {
env: 'PARSE_SERVER_REST_API_KEY',
help: 'Key for REST calls',
},
revokeSessionOnPasswordReset: {
env: 'PARSE_SERVER_REVOKE_SESSION_ON_PASSWORD_RESET',
help:
"When a user changes their password, either through the reset password email or while logged in, all sessions are revoked if this is true. Set to false if you don't want to revoke sessions.",
action: parsers.booleanParser,
default: true,
},
scheduledPush: {
env: 'PARSE_SERVER_SCHEDULED_PUSH',
help: 'Configuration for push scheduling, defaults to false.',
action: parsers.booleanParser,
default: false,
},
schema: {
env: 'PARSE_SERVER_SCHEMA',
help: 'Defined schema',
action: parsers.objectParser,
type: 'SchemaOptions',
},
security: {
env: 'PARSE_SERVER_SECURITY',
help: 'The security options to identify and report weak security settings.',
action: parsers.objectParser,
type: 'SecurityOptions',
default: {},
},
sendUserEmailVerification: {
env: 'PARSE_SERVER_SEND_USER_EMAIL_VERIFICATION',
help:
'Set to `false` to prevent sending of verification email. Supports a function with a return value of `true` or `false` for conditional email sending.<br><br>Default is `true`.<br>',
default: true,
},
serverCloseComplete: {
env: 'PARSE_SERVER_SERVER_CLOSE_COMPLETE',
help: 'Callback when server has closed',
},
serverURL: {
env: 'PARSE_SERVER_URL',
help: 'URL to your parse server with http:// or https://.',
required: true,
},
sessionLength: {
env: 'PARSE_SERVER_SESSION_LENGTH',
help: 'Session duration, in seconds, defaults to 1 year',
action: parsers.numberParser('sessionLength'),
default: 31536000,
},
silent: {
env: 'SILENT',
help: 'Disables console output',
action: parsers.booleanParser,
},
startLiveQueryServer: {
env: 'PARSE_SERVER_START_LIVE_QUERY_SERVER',
help: 'Starts the liveQuery server',
action: parsers.booleanParser,
},
trustProxy: {
env: 'PARSE_SERVER_TRUST_PROXY',
help:
'The trust proxy settings. It is important to understand the exact setup of the reverse proxy, since this setting will trust values provided in the Parse Server API request. See the <a href="https://expressjs.com/en/guide/behind-proxies.html">express trust proxy settings</a> documentation. Defaults to `false`.',
action: parsers.objectParser,
default: [],
},
userSensitiveFields: {
env: 'PARSE_SERVER_USER_SENSITIVE_FIELDS',
help:
'Personally identifiable information fields in the user table the should be removed for non-authorized users. Deprecated @see protectedFields',
action: parsers.arrayParser,
},
verbose: {
env: 'VERBOSE',
help: 'Set the logging to verbose',
action: parsers.booleanParser,
},
verifyUserEmails: {
env: 'PARSE_SERVER_VERIFY_USER_EMAILS',
help:
'Set to `true` to require users to verify their email address to complete the sign-up process. Supports a function with a return value of `true` or `false` for conditional verification.<br><br>Default is `false`.',
default: false,
},
webhookKey: {
env: 'PARSE_SERVER_WEBHOOK_KEY',
help: 'Key sent with outgoing webhook calls',
},
};
module.exports.RateLimitOptions = {
errorResponseMessage: {
env: 'PARSE_SERVER_RATE_LIMIT_ERROR_RESPONSE_MESSAGE',
help:
'The error message that should be returned in the body of the HTTP 429 response when the rate limit is hit. Default is `Too many requests.`.',
default: 'Too many requests.',
},
includeInternalRequests: {
env: 'PARSE_SERVER_RATE_LIMIT_INCLUDE_INTERNAL_REQUESTS',
help:
'Optional, if `true` the rate limit will also apply to requests that are made in by Cloud Code, default is `false`. Note that a public Cloud Code function that triggers internal requests may circumvent rate limiting and be vulnerable to attacks.',
action: parsers.booleanParser,
default: false,
},
includeMasterKey: {
env: 'PARSE_SERVER_RATE_LIMIT_INCLUDE_MASTER_KEY',
help:
'Optional, if `true` the rate limit will also apply to requests using the `masterKey`, default is `false`. Note that a public Cloud Code function that triggers internal requests using the `masterKey` may circumvent rate limiting and be vulnerable to attacks.',
action: parsers.booleanParser,
default: false,
},
redisUrl: {
env: 'PARSE_SERVER_RATE_LIMIT_REDIS_URL',
help:
'Optional, the URL of the Redis server to store rate limit data. This allows to rate limit requests for multiple servers by calculating the sum of all requests across all servers. This is useful if multiple servers are processing requests behind a load balancer. For example, the limit of 10 requests is reached if each of 2 servers processed 5 requests.',
},
requestCount: {
env: 'PARSE_SERVER_RATE_LIMIT_REQUEST_COUNT',
help:
'The number of requests that can be made per IP address within the time window set in `requestTimeWindow` before the rate limit is applied.',
action: parsers.numberParser('requestCount'),
},
requestMethods: {
env: 'PARSE_SERVER_RATE_LIMIT_REQUEST_METHODS',
help:
'Optional, the HTTP request methods to which the rate limit should be applied, default is all methods.',
action: parsers.arrayParser,
},
requestPath: {
env: 'PARSE_SERVER_RATE_LIMIT_REQUEST_PATH',
help:
'The path of the API route to be rate limited. Route paths, in combination with a request method, define the endpoints at which requests can be made. Route paths can be strings, string patterns, or regular expression. See: https://expressjs.com/en/guide/routing.html',
required: true,
},
requestTimeWindow: {
env: 'PARSE_SERVER_RATE_LIMIT_REQUEST_TIME_WINDOW',
help:
'The window of time in milliseconds within which the number of requests set in `requestCount` can be made before the rate limit is applied.',
action: parsers.numberParser('requestTimeWindow'),
},
zone: {
env: 'PARSE_SERVER_RATE_LIMIT_ZONE',
help:
"The type of rate limit to apply. The following types are supported:<br><br>- `global`: rate limit based on the number of requests made by all users <br>- `ip`: rate limit based on the IP address of the request <br>- `user`: rate limit based on the user ID of the request <br>- `session`: rate limit based on the session token of the request <br><br><br>:default: 'ip'",
},
};
module.exports.SecurityOptions = {
checkGroups: {
env: 'PARSE_SERVER_SECURITY_CHECK_GROUPS',
help:
'The security check groups to run. This allows to add custom security checks or override existing ones. Default are the groups defined in `CheckGroups.js`.',
action: parsers.arrayParser,
},
enableCheck: {
env: 'PARSE_SERVER_SECURITY_ENABLE_CHECK',
help: 'Is true if Parse Server should check for weak security settings.',
action: parsers.booleanParser,
default: false,
},
enableCheckLog: {
env: 'PARSE_SERVER_SECURITY_ENABLE_CHECK_LOG',
help:
'Is true if the security check report should be written to logs. This should only be enabled temporarily to not expose weak security settings in logs.',
action: parsers.booleanParser,
default: false,
},
};
module.exports.PagesOptions = {
customRoutes: {
env: 'PARSE_SERVER_PAGES_CUSTOM_ROUTES',
help: 'The custom routes.',
action: parsers.arrayParser,
type: 'PagesRoute[]',
default: [],
},
customUrls: {
env: 'PARSE_SERVER_PAGES_CUSTOM_URLS',
help: 'The URLs to the custom pages.',
action: parsers.objectParser,
type: 'PagesCustomUrlsOptions',
default: {},
},
enableLocalization: {
env: 'PARSE_SERVER_PAGES_ENABLE_LOCALIZATION',
help: 'Is true if pages should be localized; this has no effect on custom page redirects.',
action: parsers.booleanParser,
default: false,
},
enableRouter: {
env: 'PARSE_SERVER_PAGES_ENABLE_ROUTER',
help:
'Is true if the pages router should be enabled; this is required for any of the pages options to take effect.',
action: parsers.booleanParser,
default: false,
},
forceRedirect: {
env: 'PARSE_SERVER_PAGES_FORCE_REDIRECT',
help:
'Is true if responses should always be redirects and never content, false if the response type should depend on the request type (GET request -> content response; POST request -> redirect response).',
action: parsers.booleanParser,
default: false,
},
localizationFallbackLocale: {
env: 'PARSE_SERVER_PAGES_LOCALIZATION_FALLBACK_LOCALE',
help:
'The fallback locale for localization if no matching translation is provided for the given locale. This is only relevant when providing translation resources via JSON file.',
default: 'en',
},
localizationJsonPath: {
env: 'PARSE_SERVER_PAGES_LOCALIZATION_JSON_PATH',
help:
'The path to the JSON file for localization; the translations will be used to fill template placeholders according to the locale.',
},
pagesEndpoint: {
env: 'PARSE_SERVER_PAGES_PAGES_ENDPOINT',
help: "The API endpoint for the pages. Default is 'apps'.",
default: 'apps',
},
pagesPath: {
env: 'PARSE_SERVER_PAGES_PAGES_PATH',
help:
"The path to the pages directory; this also defines where the static endpoint '/apps' points to. Default is the './public/' directory.",
default: './public',
},
placeholders: {
env: 'PARSE_SERVER_PAGES_PLACEHOLDERS',
help:
'The placeholder keys and values which will be filled in pages; this can be a simple object or a callback function.',
action: parsers.objectParser,
default: {},
},
};
module.exports.PagesRoute = {
handler: {
env: 'PARSE_SERVER_PAGES_ROUTE_HANDLER',
help: 'The route handler that is an async function.',
required: true,
},
method: {
env: 'PARSE_SERVER_PAGES_ROUTE_METHOD',
help: "The route method, e.g. 'GET' or 'POST'.",
required: true,
},
path: {
env: 'PARSE_SERVER_PAGES_ROUTE_PATH',
help: 'The route path.',
required: true,
},
};
module.exports.PagesCustomUrlsOptions = {
emailVerificationLinkExpired: {
env: 'PARSE_SERVER_PAGES_CUSTOM_URL_EMAIL_VERIFICATION_LINK_EXPIRED',
help: 'The URL to the custom page for email verification -> link expired.',
},
emailVerificationLinkInvalid: {
env: 'PARSE_SERVER_PAGES_CUSTOM_URL_EMAIL_VERIFICATION_LINK_INVALID',
help: 'The URL to the custom page for email verification -> link invalid.',
},
emailVerificationSendFail: {
env: 'PARSE_SERVER_PAGES_CUSTOM_URL_EMAIL_VERIFICATION_SEND_FAIL',
help: 'The URL to the custom page for email verification -> link send fail.',
},
emailVerificationSendSuccess: {
env: 'PARSE_SERVER_PAGES_CUSTOM_URL_EMAIL_VERIFICATION_SEND_SUCCESS',
help: 'The URL to the custom page for email verification -> resend link -> success.',
},
emailVerificationSuccess: {
env: 'PARSE_SERVER_PAGES_CUSTOM_URL_EMAIL_VERIFICATION_SUCCESS',
help: 'The URL to the custom page for email verification -> success.',
},
passwordReset: {
env: 'PARSE_SERVER_PAGES_CUSTOM_URL_PASSWORD_RESET',
help: 'The URL to the custom page for password reset.',
},
passwordResetLinkInvalid: {
env: 'PARSE_SERVER_PAGES_CUSTOM_URL_PASSWORD_RESET_LINK_INVALID',
help: 'The URL to the custom page for password reset -> link invalid.',
},
passwordResetSuccess: {
env: 'PARSE_SERVER_PAGES_CUSTOM_URL_PASSWORD_RESET_SUCCESS',
help: 'The URL to the custom page for password reset -> success.',
},
};
module.exports.CustomPagesOptions = {
choosePassword: {
env: 'PARSE_SERVER_CUSTOM_PAGES_CHOOSE_PASSWORD',
help: 'choose password page path',
},
expiredVerificationLink: {
env: 'PARSE_SERVER_CUSTOM_PAGES_EXPIRED_VERIFICATION_LINK',
help: 'expired verification link page path',
},
invalidLink: {
env: 'PARSE_SERVER_CUSTOM_PAGES_INVALID_LINK',
help: 'invalid link page path',
},
invalidPasswordResetLink: {
env: 'PARSE_SERVER_CUSTOM_PAGES_INVALID_PASSWORD_RESET_LINK',
help: 'invalid password reset link page path',
},
invalidVerificationLink: {
env: 'PARSE_SERVER_CUSTOM_PAGES_INVALID_VERIFICATION_LINK',
help: 'invalid verification link page path',
},
linkSendFail: {
env: 'PARSE_SERVER_CUSTOM_PAGES_LINK_SEND_FAIL',
help: 'verification link send fail page path',
},
linkSendSuccess: {
env: 'PARSE_SERVER_CUSTOM_PAGES_LINK_SEND_SUCCESS',
help: 'verification link send success page path',
},
parseFrameURL: {
env: 'PARSE_SERVER_CUSTOM_PAGES_PARSE_FRAME_URL',
help: 'for masking user-facing pages',
},
passwordResetSuccess: {
env: 'PARSE_SERVER_CUSTOM_PAGES_PASSWORD_RESET_SUCCESS',
help: 'password reset success page path',
},
verifyEmailSuccess: {
env: 'PARSE_SERVER_CUSTOM_PAGES_VERIFY_EMAIL_SUCCESS',
help: 'verify email success page path',
},
};
module.exports.LiveQueryOptions = {
classNames: {
env: 'PARSE_SERVER_LIVEQUERY_CLASSNAMES',
help: "parse-server's LiveQuery classNames",
action: parsers.arrayParser,
},
pubSubAdapter: {
env: 'PARSE_SERVER_LIVEQUERY_PUB_SUB_ADAPTER',
help: 'LiveQuery pubsub adapter',
action: parsers.moduleOrObjectParser,
},
redisOptions: {
env: 'PARSE_SERVER_LIVEQUERY_REDIS_OPTIONS',
help: "parse-server's LiveQuery redisOptions",
action: parsers.objectParser,
},
redisURL: {
env: 'PARSE_SERVER_LIVEQUERY_REDIS_URL',
help: "parse-server's LiveQuery redisURL",
},
wssAdapter: {
env: 'PARSE_SERVER_LIVEQUERY_WSS_ADAPTER',
help: 'Adapter module for the WebSocketServer',
action: parsers.moduleOrObjectParser,
},
};
module.exports.LiveQueryServerOptions = {
appId: {
env: 'PARSE_LIVE_QUERY_SERVER_APP_ID',
help:
'This string should match the appId in use by your Parse Server. If you deploy the LiveQuery server alongside Parse Server, the LiveQuery server will try to use the same appId.',
},
cacheTimeout: {
env: 'PARSE_LIVE_QUERY_SERVER_CACHE_TIMEOUT',
help:
"Number in milliseconds. When clients provide the sessionToken to the LiveQuery server, the LiveQuery server will try to fetch its ParseUser's objectId from parse server and store it in the cache. The value defines the duration of the cache. Check the following Security section and our protocol specification for details, defaults to 5 * 1000 ms (5 seconds).",
action: parsers.numberParser('cacheTimeout'),
},
keyPairs: {
env: 'PARSE_LIVE_QUERY_SERVER_KEY_PAIRS',
help:
'A JSON object that serves as a whitelist of keys. It is used for validating clients when they try to connect to the LiveQuery server. Check the following Security section and our protocol specification for details.',
action: parsers.objectParser,
},
logLevel: {
env: 'PARSE_LIVE_QUERY_SERVER_LOG_LEVEL',
help:
'This string defines the log level of the LiveQuery server. We support VERBOSE, INFO, ERROR, NONE, defaults to INFO.',
},
masterKey: {
env: 'PARSE_LIVE_QUERY_SERVER_MASTER_KEY',
help:
'This string should match the masterKey in use by your Parse Server. If you deploy the LiveQuery server alongside Parse Server, the LiveQuery server will try to use the same masterKey.',
},
port: {
env: 'PARSE_LIVE_QUERY_SERVER_PORT',
help: 'The port to run the LiveQuery server, defaults to 1337.',
action: parsers.numberParser('port'),
default: 1337,
},
pubSubAdapter: {
env: 'PARSE_LIVE_QUERY_SERVER_PUB_SUB_ADAPTER',
help: 'LiveQuery pubsub adapter',
action: parsers.moduleOrObjectParser,
},
redisOptions: {
env: 'PARSE_LIVE_QUERY_SERVER_REDIS_OPTIONS',
help: "parse-server's LiveQuery redisOptions",
action: parsers.objectParser,
},
redisURL: {
env: 'PARSE_LIVE_QUERY_SERVER_REDIS_URL',
help: "parse-server's LiveQuery redisURL",
},
serverURL: {
env: 'PARSE_LIVE_QUERY_SERVER_SERVER_URL',
help:
'This string should match the serverURL in use by your Parse Server. If you deploy the LiveQuery server alongside Parse Server, the LiveQuery server will try to use the same serverURL.',
},
websocketTimeout: {
env: 'PARSE_LIVE_QUERY_SERVER_WEBSOCKET_TIMEOUT',
help:
'Number of milliseconds between ping/pong frames. The WebSocket server sends ping/pong frames to the clients to keep the WebSocket alive. This value defines the interval of the ping/pong frame from the server to clients, defaults to 10 * 1000 ms (10 s).',
action: parsers.numberParser('websocketTimeout'),
},
wssAdapter: {
env: 'PARSE_LIVE_QUERY_SERVER_WSS_ADAPTER',
help: 'Adapter module for the WebSocketServer',
action: parsers.moduleOrObjectParser,
},
};
module.exports.IdempotencyOptions = {
paths: {
env: 'PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_PATHS',
help:
'An array of paths for which the feature should be enabled. The mount path must not be included, for example instead of `/parse/functions/myFunction` specifiy `functions/myFunction`. The entries are interpreted as regular expression, for example `functions/.*` matches all functions, `jobs/.*` matches all jobs, `classes/.*` matches all classes, `.*` matches all paths.',
action: parsers.arrayParser,
default: [],
},
ttl: {
env: 'PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_TTL',
help:
'The duration in seconds after which a request record is discarded from the database, defaults to 300s.',
action: parsers.numberParser('ttl'),
default: 300,
},
};
module.exports.AccountLockoutOptions = {
duration: {
env: 'PARSE_SERVER_ACCOUNT_LOCKOUT_DURATION',
help:
'Set the duration in minutes that a locked-out account remains locked out before automatically becoming unlocked.<br><br>Valid values are greater than `0` and less than `100000`.',
action: parsers.numberParser('duration'),
},
threshold: {
env: 'PARSE_SERVER_ACCOUNT_LOCKOUT_THRESHOLD',
help:
'Set the number of failed sign-in attempts that will cause a user account to be locked. If the account is locked. The account will unlock after the duration set in the `duration` option has passed and no further login attempts have been made.<br><br>Valid values are greater than `0` and less than `1000`.',
action: parsers.numberParser('threshold'),
},
unlockOnPasswordReset: {
env: 'PARSE_SERVER_ACCOUNT_LOCKOUT_UNLOCK_ON_PASSWORD_RESET',
help:
'Set to `true` if the account should be unlocked after a successful password reset.<br><br>Default is `false`.<br>Requires options `duration` and `threshold` to be set.',
action: parsers.booleanParser,
default: false,
},
};
module.exports.PasswordPolicyOptions = {
doNotAllowUsername: {
env: 'PARSE_SERVER_PASSWORD_POLICY_DO_NOT_ALLOW_USERNAME',
help:
'Set to `true` to disallow the username as part of the password.<br><br>Default is `false`.',
action: parsers.booleanParser,
default: false,
},
maxPasswordAge: {
env: 'PARSE_SERVER_PASSWORD_POLICY_MAX_PASSWORD_AGE',
help:
'Set the number of days after which a password expires. Login attempts fail if the user does not reset the password before expiration.',
action: parsers.numberParser('maxPasswordAge'),
},
maxPasswordHistory: {
env: 'PARSE_SERVER_PASSWORD_POLICY_MAX_PASSWORD_HISTORY',
help:
'Set the number of previous password that will not be allowed to be set as new password. If the option is not set or set to `0`, no previous passwords will be considered.<br><br>Valid values are >= `0` and <= `20`.<br>Default is `0`.',
action: parsers.numberParser('maxPasswordHistory'),
},
resetPasswordSuccessOnInvalidEmail: {
env: 'PARSE_SERVER_PASSWORD_POLICY_RESET_PASSWORD_SUCCESS_ON_INVALID_EMAIL',
help:
'Set to `true` if a request to reset the password should return a success response even if the provided email address is invalid, or `false` if the request should return an error response if the email address is invalid.<br><br>Default is `true`.',
action: parsers.booleanParser,
default: true,
},
resetTokenReuseIfValid: {
env: 'PARSE_SERVER_PASSWORD_POLICY_RESET_TOKEN_REUSE_IF_VALID',
help:
'Set to `true` if a password reset token should be reused in case another token is requested but there is a token that is still valid, i.e. has not expired. This avoids the often observed issue that a user requests multiple emails and does not know which link contains a valid token because each newly generated token would invalidate the previous token.<br><br>Default is `false`.',
action: parsers.booleanParser,
default: false,