FileUpload options for Server Config (#7071)
* New: fileUpload options to restrict file uploads * review changes * update review * Update helper.js * added complete fileUpload values for tests * fixed config validation * allow file upload only for authenicated user by default * fixed inconsistent error messages * consolidated and extended tests * minor compacting * removed irregular whitespace * added changelog entry * always allow file upload with master key * fix lint * removed fit Co-authored-by: Manuel Trezza <trezza.m@gmail.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -32,6 +32,7 @@
|
||||
* @property {Boolean} expireInactiveSessions Sets wether we should expire the inactive sessions, defaults to true
|
||||
* @property {String} fileKey Key for your files
|
||||
* @property {Adapter<FilesAdapter>} filesAdapter Adapter module for the files sub-system
|
||||
* @property {FileUploadOptions} fileUpload Options for file uploads
|
||||
* @property {String} graphQLPath Mount path for the GraphQL endpoint, defaults to /graphql
|
||||
* @property {String} graphQLSchema Full path to your GraphQL custom schema.graphql file
|
||||
* @property {String} host The host to serve ParseServer on, defaults to 0.0.0.0
|
||||
@@ -137,3 +138,10 @@
|
||||
* @property {Function} validatorCallback a callback function to be invoked to validate the password
|
||||
* @property {String} validatorPattern a RegExp object or a regex string representing the pattern to enforce
|
||||
*/
|
||||
|
||||
/**
|
||||
* @interface FileUploadOptions
|
||||
* @property {Boolean} enableForAnonymousUser Is true if file upload should be allowed for anonymous users.
|
||||
* @property {Boolean} enableForAuthenticatedUser Is true if file upload should be allowed for authenticated users.
|
||||
* @property {Boolean} enableForPublic Is true if file upload should be allowed for anyone, regardless of user authentication.
|
||||
*/
|
||||
|
||||
@@ -198,6 +198,9 @@ export interface ParseServerOptions {
|
||||
:ENV: PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_OPTIONS
|
||||
:DEFAULT: false */
|
||||
idempotencyOptions: ?IdempotencyOptions;
|
||||
/* Options for file uploads
|
||||
:ENV: PARSE_SERVER_FILE_UPLOAD_OPTIONS */
|
||||
fileUpload: ?FileUploadOptions;
|
||||
/* Full path to your GraphQL custom schema.graphql file */
|
||||
graphQLSchema: ?string;
|
||||
/* Mounts the GraphQL endpoint
|
||||
@@ -315,3 +318,15 @@ export interface PasswordPolicyOptions {
|
||||
/* resend token if it's still valid */
|
||||
resetTokenReuseIfValid: ?boolean;
|
||||
}
|
||||
|
||||
export interface FileUploadOptions {
|
||||
/* Is true if file upload should be allowed for anonymous users.
|
||||
:DEFAULT: false */
|
||||
enableForAnonymousUser: ?boolean;
|
||||
/* Is true if file upload should be allowed for authenticated users.
|
||||
:DEFAULT: true */
|
||||
enableForAuthenticatedUser: ?boolean;
|
||||
/* Is true if file upload should be allowed for anyone, regardless of user authentication.
|
||||
:DEFAULT: false */
|
||||
enableForPublic: ?boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user