-
-
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
Generates a javascriptKey if not passed for CloudCode #652
Conversation
bf0d892
to
98c6506
Compare
@flovilmart updated the pull request. |
I'm not sure why this fixes it? It looks like they are issues with not providing a serverURL... |
Test that here: https://github.com/flovilmart/parse-server-testing |
I can confirm that this fixes the issue, at least what is discussed in 356. |
…ryProblem Generates a javascriptKey if not passed for CloudCode
@@ -79,7 +80,7 @@ function ParseServer({ | |||
cloud, | |||
collectionPrefix = '', | |||
clientKey = '', | |||
javascriptKey = '', | |||
javascriptKey = randomString(20), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to cause a problem. If any client key is set (clientKey, javascriptKey, restAPIKey, dotNetKey) then all requests to the server must use a valid client key... What was the actual issue, something with the SDK initialization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue was that when you omit the javascriptKey the parse SDK gets initialized wig an '' and doesn't like it when communicating with cloud code. If a user don't pass a JS key, the it means he doesn't want to use the JS SDK, so I init it to a random string. Actually, because it's init as an empty string, all the JS calls would have failed already as it would expect a javascriptKey header to be set to something empty and not undefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to fix this a different way, like passing an unused key to the SDK. We can't require client keys, and this change will do that..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that's not ideal, but the cloud code SDK breaks when no JS key is set, we could throw if JS key is not set and .cloud is set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm suggesting #680...
Another related issue #654 |
Proposed fix for #651 #356