-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customize generation of objectId for a custom class? #4363
Comments
What would be your use case? |
I also wanted to increase the length of objectIds. My use case is simply to make brute forcing attempts more difficult. There is an undocumented config option I haven't set CLP yet but it looks like this would cause problems with setting CLP to a userID. @flovilmart Could you comment on why the config option is undocumented, and what side effects we should expect from changing the objectId size? Maybe that EDIT: I just quickly tested setting CLP in the dashboard by entering a 40 character userId (after setting objectIdSize = 40), and I did not receive the error "not a valid key for class level permissions" I would have expected. |
That’s an omission, and should be fixed in a subsequent PR. |
Thanks. But could you please clarify what exactly is the omission? Is it the undocumented config, or the lack of an error when setting CLP with a 40 character userID? |
I would say both, that we have a regex clearly not failing, and not documenting the option. |
I believe there is a bug with the Postgres storage adapter and objectID's greater than 10. If you look at PostgresStorageAdapter#L28, the |
Hmmm, we'll want to open a PR for these issues soon and add some in-depth tests to make sure we don't have any issues with variable objectId field lengths, but in validation and in storage (postgres). |
I tried setting "objectIdSize", but the server crashed with the following error:
Works fine when I remove the objectIdSize config – thoughts? |
It should be a number; what / how did you set this value? |
As an environment variable just as I add other configuration parameters while starting the server. Set it at 34. |
This is why it’s not properly mapped as a number probably. |
@johndoehelloworld what version of parse-server are your running& |
You were right @flovilmart – typecasting worked. Thanks for your prompt response! |
Is it possible to modify the way to generate objectId for custom class instead of the auto generate 10 pseudo random 10 character string? Is it possible to have more than 10 characters objectId? thanks
The text was updated successfully, but these errors were encountered: