feat: Add Parse Server option allowPublicExplain to allow Parse.Query.explain without master key (#9890)

This commit is contained in:
Lucas Coratger
2025-11-08 17:02:13 +01:00
committed by GitHub
parent 15c8b1abed
commit 4456b02280
12 changed files with 180 additions and 14 deletions

View File

@@ -60,6 +60,26 @@ describe('Security Check Groups', () => {
expect(group.checks()[4].checkState()).toBe(CheckState.fail);
expect(group.checks()[5].checkState()).toBe(CheckState.fail);
});
it_only_db('mongo')('checks succeed correctly (MongoDB specific)', async () => {
config.databaseAdapter = undefined;
config.databaseOptions = { allowPublicExplain: false };
await reconfigureServer(config);
const group = new CheckGroupServerConfig();
await group.run();
expect(group.checks()[6].checkState()).toBe(CheckState.success);
});
it_only_db('mongo')('checks fail correctly (MongoDB specific)', async () => {
config.databaseAdapter = undefined;
config.databaseOptions = { allowPublicExplain: true };
await reconfigureServer(config);
const group = new CheckGroupServerConfig();
await group.run();
expect(group.checks()[6].checkState()).toBe(CheckState.fail);
});
});
describe('CheckGroupDatabase', () => {