-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Disable record creation from client code. #4894
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
Comments
How about using CLP with masterKey only write access ? |
Destroys the point of CLP, if I just set every Demo code:
And during the call, from cloud code:
And if someone tries to do a |
Yes, I just noticed that using masterKey with CLP will also affect individual object ACL since its using masterKey, I apologize for my mistake. |
Why can’t you use CLP on this case? Your secret key is basically a master key. If you don’t want to share that masterKey, then that’s another issue. As for your snippet, this works with cloud code, and I don’t see any issue with it |
Can you show a snippet of how you try to achieve this with CLP. |
@flovilmart |
CLP are processed before the ACL’s. If you restrict object creation or object to master key only, you’ll need to use the masterKey to update the object. THhen obviously the ACL Will not matter as the masterKey will be used. |
Yes, that is what I meant. |
The server auth key is basically a master key in the sense it’s being used. Not sure there anything to do in parse server. You could also use a custom header, as they are forwarded to all cloud code functions |
I don't understand why things get closed without everyone coming to a conclusion. If I see there is a conclusion or if my requirements are met, I will close it myself. Setting |
@srameshr this is my input on this. Now, this solution won't work if you want to restrict Write completely from Client endpoint because you will also have to uncheck The solution you have provided to do so in a cloud function is valid and the best one for now for record creation.
|
If you decide to go ahead with what you proposed and already doing, I suggest you create a helper module that secures any function you want with an internally generated key.
Where secure could do most of this work and then calls 'theSecuredFunction'
And when you want to save an object, you do Hope it makes sense |
@georgesjamous I had a similar one, for the sake of simplicity and brevity I chose the above example. |
@srameshr I closed the issue because this is not a bug with parse server but an implementation detail to which you already have a proper solution. |
@flovilmart If you read my question again, you will see that I was asking for a configuration, possibly while instantiating |
Maybe this request is liked to this one : parse-community/Parse-SDK-JS#583 |
I’m not sure we’ll implement a system where only the masterKey would work, as you can implement it through CLP. As always, if it’s a feature that you need, we’re open for pull requests. As it stands, i believe this is an unnecessary burden. In your case you’re Using another ‘secret’ (that should be passed as a header instead of an object property) which is very specific for your use case, and doesn’t follow the rest of the philosophy of this project. On a small note, you can easily wrap all your cloud code in a secure method that checks for your custom secret |
Issue Description
Is it possible to disable
record
creation on anyClass
via client code by a simple configuration on the server?Basically, I want
save
orsaveAll
operations to be triggered by cloud code only, without using anybeforeSave
trigger on anyClass
.Steps to reproduce
N/A
Expected Results
Do this via, chrome JS console.
Actual Outcome
N/A
Environment Setup
Server
Database
Logs/Trace
Include all relevant logs. You can turn on additional logging by configuring VERBOSE=1 in your environment.
The text was updated successfully, but these errors were encountered: