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:
@@ -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,
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user