Skip to content

Commit

Permalink
feat: Add server security check status security.enableCheck to Feat…
Browse files Browse the repository at this point in the history
…ures Router (#8679)
  • Loading branch information
dblythy committed Mar 24, 2024
1 parent 79846f7 commit b07ec15
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
28 changes: 28 additions & 0 deletions spec/SecurityCheck.spec.js
Expand Up @@ -337,5 +337,33 @@ describe('Security Check', () => {
expect(logSpy.calls.all()[0].args[0]).toContain(title);
}
});

it('does update featuresRouter', async () => {
let response = await request({
url: 'http://localhost:8378/1/serverInfo',
json: true,
headers: {
'X-Parse-Application-Id': 'test',
'X-Parse-REST-API-Key': 'rest',
'X-Parse-Master-Key': 'test',
},
});
expect(response.data.features.settings.securityCheck).toBeTrue();
await reconfigureServer({
security: {
enableCheck: false,
},
});
response = await request({
url: 'http://localhost:8378/1/serverInfo',
json: true,
headers: {
'X-Parse-Application-Id': 'test',
'X-Parse-REST-API-Key': 'rest',
'X-Parse-Master-Key': 'test',
},
});
expect(response.data.features.settings.securityCheck).toBeFalse();
});
});
});
3 changes: 3 additions & 0 deletions src/Routers/FeaturesRouter.js
Expand Up @@ -46,6 +46,9 @@ export class FeaturesRouter extends PromiseRouter {
editClassLevelPermissions: true,
editPointerPermissions: true,
},
settings: {
securityCheck: !!config.security?.enableCheck,
},
};

return {
Expand Down

0 comments on commit b07ec15

Please sign in to comment.