-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Description
Issue Description
- By default objectIdSize is set to 10. It can be configured to any fixed length - see Add config for objectId size #3950.
- There is a recent addition allowing to set custom object ids #6101 Let users define objectId #6177.
During CLP validation there is a regEx allowing exactly 10 chars:
const userIdRegex = /^[a-zA-Z0-9]{10}$/;This leads to a problem: if you decide to change objectIdSize:
CLP for user with id.length != 10 won't be accepted by schema controller.
Same for custom ids.
Steps to reproduce
- Launch server with
objectIdSize: 11
it('should aceept class-level permission for custom userid of any length', async done => {
await global.reconfigureServer({
customIdSize: 11,
});
const id = 'e1evenChars';
const { data } = await request({
method: 'POST',
url: 'http://localhost:8378/1/schemas/AClass',
headers: masterKeyHeaders,
json: true,
body: {
classLevelPermissions: {
find: {
[id]: true,
},
},
},
});
expect(data.classLevelPermissions.find[id]).toBe(true);
done();
});Expected Results
schema is accepted
Actual Outcome
'e1evenChars' is not a valid key for class level permissions
Environment Setup
- Server
- parse-server version (Be specific! Don't say 'latest'.) : 3.10.0
Metadata
Metadata
Assignees
Labels
No labels