feat: Deprecation DEPPS5: Config option allowClientClassCreation defaults to false (#8849)

BREAKING CHANGE: The Parse Server option `allowClientClassCreation` defaults to `false`.
This commit is contained in:
Onur
2024-03-05 22:05:54 +03:00
committed by GitHub
parent fe1e4d9775
commit 29624e0fae
8 changed files with 43 additions and 7 deletions

View File

@@ -90,6 +90,7 @@ export class Config {
rateLimit,
databaseOptions,
extendSessionOnUse,
allowClientClassCreation,
}) {
if (masterKey === readOnlyMasterKey) {
throw new Error('masterKey and readOnlyMasterKey should be different');
@@ -132,6 +133,7 @@ export class Config {
this.validateRateLimit(rateLimit);
this.validateLogLevels(logLevels);
this.validateDatabaseOptions(databaseOptions);
this.validateAllowClientClassCreation(allowClientClassCreation);
}
static validateControllers({
@@ -174,6 +176,12 @@ export class Config {
}
}
static validateAllowClientClassCreation(allowClientClassCreation) {
if (typeof allowClientClassCreation !== 'boolean') {
throw 'Parse Server option allowClientClassCreation must be a boolean.';
}
}
static validateSecurityOptions(security) {
if (Object.prototype.toString.call(security) !== '[object Object]') {
throw 'Parse Server option security must be an object.';

View File

@@ -16,6 +16,5 @@
* If there are no deprecations, this must return an empty array.
*/
module.exports = [
{ optionKey: 'allowClientClassCreation', changeNewDefault: 'false' },
{ optionKey: 'encodeParseObjectInCloudFunction', changeNewDefault: 'true' },
];

View File

@@ -57,9 +57,9 @@ module.exports.ParseServerOptions = {
},
allowClientClassCreation: {
env: 'PARSE_SERVER_ALLOW_CLIENT_CLASS_CREATION',
help: 'Enable (or disable) client class creation, defaults to true',
help: 'Enable (or disable) client class creation, defaults to false',
action: parsers.booleanParser,
default: true,
default: false,
},
allowCustomObjectId: {
env: 'PARSE_SERVER_ALLOW_CUSTOM_OBJECT_ID',

View File

@@ -12,7 +12,7 @@
/**
* @interface ParseServerOptions
* @property {AccountLockoutOptions} accountLockout The account lockout policy for failed login attempts.
* @property {Boolean} allowClientClassCreation Enable (or disable) client class creation, defaults to true
* @property {Boolean} allowClientClassCreation Enable (or disable) client class creation, defaults to false
* @property {Boolean} allowCustomObjectId Enable (or disable) custom objectId
* @property {Boolean} allowExpiredAuthDataToken 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`.
* @property {String[]} allowHeaders Add headers to Access-Control-Allow-Headers

View File

@@ -148,9 +148,9 @@ export interface ParseServerOptions {
:ENV: PARSE_SERVER_ENABLE_ANON_USERS
:DEFAULT: true */
enableAnonymousUsers: ?boolean;
/* Enable (or disable) client class creation, defaults to true
/* Enable (or disable) client class creation, defaults to false
:ENV: PARSE_SERVER_ALLOW_CLIENT_CLASS_CREATION
:DEFAULT: true */
:DEFAULT: false */
allowClientClassCreation: ?boolean;
/* Enable (or disable) custom objectId
:ENV: PARSE_SERVER_ALLOW_CUSTOM_OBJECT_ID