Skip to content

Commit b07ec15

Browse files
authored
feat: Add server security check status security.enableCheck to Features Router (#8679)
1 parent 79846f7 commit b07ec15

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

spec/SecurityCheck.spec.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,5 +337,33 @@ describe('Security Check', () => {
337337
expect(logSpy.calls.all()[0].args[0]).toContain(title);
338338
}
339339
});
340+
341+
it('does update featuresRouter', async () => {
342+
let response = await request({
343+
url: 'http://localhost:8378/1/serverInfo',
344+
json: true,
345+
headers: {
346+
'X-Parse-Application-Id': 'test',
347+
'X-Parse-REST-API-Key': 'rest',
348+
'X-Parse-Master-Key': 'test',
349+
},
350+
});
351+
expect(response.data.features.settings.securityCheck).toBeTrue();
352+
await reconfigureServer({
353+
security: {
354+
enableCheck: false,
355+
},
356+
});
357+
response = await request({
358+
url: 'http://localhost:8378/1/serverInfo',
359+
json: true,
360+
headers: {
361+
'X-Parse-Application-Id': 'test',
362+
'X-Parse-REST-API-Key': 'rest',
363+
'X-Parse-Master-Key': 'test',
364+
},
365+
});
366+
expect(response.data.features.settings.securityCheck).toBeFalse();
367+
});
340368
});
341369
});

src/Routers/FeaturesRouter.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ export class FeaturesRouter extends PromiseRouter {
4646
editClassLevelPermissions: true,
4747
editPointerPermissions: true,
4848
},
49+
settings: {
50+
securityCheck: !!config.security?.enableCheck,
51+
},
4952
};
5053

5154
return {

0 commit comments

Comments
 (0)