feat: Deprecation DEPPS6: Authentication adapters disabled by default (#8858)

BREAKING CHANGE: Authentication adapters are disabled by default; to use an authentication adapter it needs to be explicitly enabled in the Parse Server authentication adapter option `auth.<provider>.enabled: true`
This commit is contained in:
Onur
2024-02-15 03:28:09 +03:00
committed by GitHub
parent 0e9b6d69ef
commit 0cf58eb8d6
5 changed files with 3 additions and 24 deletions

View File

@@ -1,7 +1,6 @@
const Parse = require('parse/node');
import { isDeepStrictEqual } from 'util';
import { getRequestObject, resolveError } from './triggers';
import Deprecator from './Deprecator/Deprecator';
import { logger } from './logger';
import RestQuery from './RestQuery';
import RestWrite from './RestWrite';
@@ -523,12 +522,6 @@ const handleAuthDataValidation = async (authData, req, foundUser) => {
}
const { validator } = req.config.authDataManager.getValidatorForProvider(provider);
const authProvider = (req.config.auth || {})[provider] || {};
if (authProvider.enabled == null) {
Deprecator.logRuntimeDeprecation({
usage: `Using the authentication adapter "${provider}" without explicitly enabling it`,
solution: `Enable the authentication adapter by setting the Parse Server option "auth.${provider}.enabled: true".`,
});
}
if (!validator || authProvider.enabled === false) {
throw new Parse.Error(
Parse.Error.UNSUPPORTED_SERVICE,

View File

@@ -1046,7 +1046,7 @@ module.exports.AuthAdapter = {
enabled: {
help: 'Is `true` if the auth adapter is enabled, `false` otherwise.',
action: parsers.booleanParser,
default: true,
default: false,
},
};
module.exports.LogLevels = {

View File

@@ -600,7 +600,7 @@ export interface DatabaseOptions {
export interface AuthAdapter {
/* Is `true` if the auth adapter is enabled, `false` otherwise.
:DEFAULT: true
:DEFAULT: false
:ENV:
*/
enabled: ?boolean;