-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Passing {useMasterKey: true} to REST api requests in cloud code #3891
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
Yes, hard coding in the master key is a bad idea... glad you didn't go that route. Some examples
|
You are probably using environment variables to initialize the server, no? If not, you should, instead of hard coding in your index.js. |
@natanrolnik ah yes, that's perfect. Thanks! |
We could also add the useMasterKey option to the Parse.Cloud.httpRequest options ;) |
There should be a section in the cloud code guide that explains how to use this, just as @MobileVet posted above. With some nice examples :-) |
Feel free to edit the guides in the docs repo and open a PR |
I'm writing a cloud code function that calls the /schemas endpoint while processing requests. Since this function requires the masterKey, I thought I'd use Parse.Cloud.httpRequest to make the request, but HTTPOptions doesn't seem to have a useMasterKey property.
How would I go about doing something like this? Hard coding the masterKey in the cloud code function's request headers seems like a bad idea.
The text was updated successfully, but these errors were encountered: