MCPcopy Create free account
hub / github.com/parse-community/parse-server / setupProtectedClass

Function setupProtectedClass

spec/vulnerabilities.spec.js:3697–3717  ·  view source on GitHub ↗
(className)

Source from the content-addressed store, hash-verified

3695 }
3696
3697 async function setupProtectedClass(className) {
3698 const config = Config.get(Parse.applicationId);
3699 const schemaController = await config.database.loadSchema();
3700 await schemaController.addClassIfNotExists(className, {
3701 secretField: { type: 'String' },
3702 publicField: { type: 'String' },
3703 });
3704 await schemaController.updateClass(
3705 className,
3706 {},
3707 {
3708 find: { '*': true },
3709 get: { '*': true },
3710 create: { '*': true },
3711 update: { '*': true },
3712 delete: { '*': true },
3713 addField: {},
3714 protectedFields: { '*': ['secretField'] },
3715 }
3716 );
3717 }
3718
3719 it('should deliver protected fields to master key LiveQuery client', async () => {
3720 const className = 'MasterKeyProtectedClass';

Callers 1

Calls 4

loadSchemaMethod · 0.80
addClassIfNotExistsMethod · 0.80
updateClassMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…