Skip to content

Commit 0cf58eb

Browse files
authored
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`
1 parent 0e9b6d6 commit 0cf58eb

File tree

5 files changed

+3
-24
lines changed

5 files changed

+3
-24
lines changed

DEPRECATIONS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The following is a list of deprecations, according to the [Deprecation Policy](h
99
| DEPPS3 | Config option `enforcePrivateUsers` defaults to `true` | [#7319](https://github.com/parse-community/parse-server/pull/7319) | 5.0.0 (2022) | 6.0.0 (2023) | removed | - |
1010
| DEPPS4 | Remove convenience method for http request `Parse.Cloud.httpRequest` | [#7589](https://github.com/parse-community/parse-server/pull/7589) | 5.0.0 (2022) | 6.0.0 (2023) | removed | - |
1111
| DEPPS5 | Config option `allowClientClassCreation` defaults to `false` | [#7925](https://github.com/parse-community/parse-server/pull/7925) | 5.3.0 (2022) | 7.0.0 (2024) | deprecated | - |
12-
| DEPPS6 | Auth providers disabled by default | [#7953](https://github.com/parse-community/parse-server/pull/7953) | 5.3.0 (2022) | 7.0.0 (2024) | deprecated | - |
12+
| DEPPS6 | Auth providers disabled by default | [#7953](https://github.com/parse-community/parse-server/pull/7953) | 5.3.0 (2022) | 7.0.0 (2024) | removed | - |
1313
| DEPPS7 | Remove file trigger syntax `Parse.Cloud.beforeSaveFile((request) => {})` | [#7966](https://github.com/parse-community/parse-server/pull/7966) | 5.3.0 (2022) | 7.0.0 (2024) | removed | - |
1414
| DEPPS8 | Login with expired 3rd party authentication token defaults to `false` | [#7079](https://github.com/parse-community/parse-server/pull/7079) | 5.3.0 (2022) | 7.0.0 (2024) | removed | - |
1515
| DEPPS9 | Rename LiveQuery `fields` option to `keys` | [#8389](https://github.com/parse-community/parse-server/issues/8389) | 6.0.0 (2023) | 7.0.0 (2024) | removed | - |

spec/AuthenticationAdapters.spec.js

-14
Original file line numberDiff line numberDiff line change
@@ -589,20 +589,6 @@ describe('AuthenticationProviders', function () {
589589
new Parse.Error(Parse.Error.UNSUPPORTED_SERVICE, 'This authentication method is unsupported.')
590590
);
591591
});
592-
593-
it('can deprecate', async () => {
594-
await reconfigureServer();
595-
const Deprecator = require('../lib/Deprecator/Deprecator');
596-
const spy = spyOn(Deprecator, 'logRuntimeDeprecation').and.callFake(() => {});
597-
const provider = getMockMyOauthProvider();
598-
Parse.User._registerAuthenticationProvider(provider);
599-
await Parse.User._logInWith('myoauth');
600-
expect(spy).toHaveBeenCalledWith({
601-
usage: 'Using the authentication adapter "myoauth" without explicitly enabling it',
602-
solution:
603-
'Enable the authentication adapter by setting the Parse Server option "auth.myoauth.enabled: true".',
604-
});
605-
});
606592
});
607593

608594
describe('instagram auth adapter', () => {

src/Auth.js

-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const Parse = require('parse/node');
22
import { isDeepStrictEqual } from 'util';
33
import { getRequestObject, resolveError } from './triggers';
4-
import Deprecator from './Deprecator/Deprecator';
54
import { logger } from './logger';
65
import RestQuery from './RestQuery';
76
import RestWrite from './RestWrite';
@@ -523,12 +522,6 @@ const handleAuthDataValidation = async (authData, req, foundUser) => {
523522
}
524523
const { validator } = req.config.authDataManager.getValidatorForProvider(provider);
525524
const authProvider = (req.config.auth || {})[provider] || {};
526-
if (authProvider.enabled == null) {
527-
Deprecator.logRuntimeDeprecation({
528-
usage: `Using the authentication adapter "${provider}" without explicitly enabling it`,
529-
solution: `Enable the authentication adapter by setting the Parse Server option "auth.${provider}.enabled: true".`,
530-
});
531-
}
532525
if (!validator || authProvider.enabled === false) {
533526
throw new Parse.Error(
534527
Parse.Error.UNSUPPORTED_SERVICE,

src/Options/Definitions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ module.exports.AuthAdapter = {
10461046
enabled: {
10471047
help: 'Is `true` if the auth adapter is enabled, `false` otherwise.',
10481048
action: parsers.booleanParser,
1049-
default: true,
1049+
default: false,
10501050
},
10511051
};
10521052
module.exports.LogLevels = {

src/Options/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ export interface DatabaseOptions {
600600

601601
export interface AuthAdapter {
602602
/* Is `true` if the auth adapter is enabled, `false` otherwise.
603-
:DEFAULT: true
603+
:DEFAULT: false
604604
:ENV:
605605
*/
606606
enabled: ?boolean;

0 commit comments

Comments
 (0)