Skip to content
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

update function and freeze schema #97

Closed
wants to merge 4 commits into from
Closed

update function and freeze schema #97

wants to merge 4 commits into from

Conversation

lucianmat
Copy link

added user, isMaster, installationId on functions as Parse.Cloud.FunctionRequest specs .

changed route path to '/functions/:functionName+', that way function can be requested with extra path components as : Parse.Cloud.run('workflows/list', {})

@lucianmat
Copy link
Author

As discused in #90 :)

@lucianmat
Copy link
Author

@natanrolnik If you use Parse JS Sdk, you will get installationId by default, on every request, as it is sent on body payload :

_ApplicationId: "myAppId"
_ClientVersion: "js1.6.14"
_InstallationId: "472605e6-8067-57e1-6c01-c69bd6502d03"
_JavaScriptKey: "unused"

@natanrolnik
Copy link
Contributor

Cool. I'll check regarding the iOS SDK. Maybe @nlutsenko can quickly answer here?

@lucianmat lucianmat changed the title update function update function and freeze schema Jan 31, 2016
@lucianmat
Copy link
Author

have also #39 fix proposed.
Schema creation/update is locked unless NODE_ENV==='development' or master key is used

@nlutsenko
Copy link
Contributor

Installation ID is passed as a header to every single API request sent against a server.
@gfosco, I couldn't find the code for parsing it - do we inflate the installation id from the header or is it only handled as a parameter for _Installation collection?

}

router.route('POST', '/functions/:functionName', handleCloudFunction);
router.route('POST', '/functions/:functionName+', handleCloudFunction);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the + sign here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • will allow to have a structured calls on functions, such as
Parse.Cloud.run('workflow/list', { objs : true}), 

extending functions reach.
It is an optional route parameter from express, it will be ignored if it is not present and it will work as pervious.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It requires latest express and path-to-regexp version, otherwise it will fallback to initial behaviour.

@gfosco
Copy link
Contributor

gfosco commented Feb 1, 2016

The installation id is parsed from the headers here: https://github.com/ParsePlatform/parse-server/blob/master/middlewares.js#L22

This is a reasonable solution for the client class creation option... I wanted it to be an option passed to ParseServer, but this is easier and makes sense. Anyone have an issue with it?

@andrewoons
Copy link

I think it's better to provide an option that you can pass to ParseServer, so you have more control (e.g. sometimes I don't want schema to update in dev env or sometimes I do want it to update on production).

Maybe that should be in a separate PR too?

@lucianmat
Copy link
Author

A more complex solution will be needed if/when ParseServer will be multi-application, and this may be an architectural decision. This is the reason why I did preferred to get up-and-running, solution.

@andrewoons : Env variable may be easily changed outside of code, and if you send masterKey you may be able to change everything. May be used a distinct env variable name to configure, but I don't think it will make a real difference.

@lucianmat lucianmat closed this Feb 2, 2016
@natanrolnik
Copy link
Contributor

@lucianmat any specific reason made you close this PR?
I ask because although #90 was closed, it still depends on this PR if I'm correct.

@gfosco
Copy link
Contributor

gfosco commented Feb 2, 2016

Yeah I'd still like to see the freeze method here for disabling client-class-creation... I understand if you were just cleaning this up because of all the rebasing.. Also, the req.user issue with functions got updated already in #172.

@natanrolnik
Copy link
Contributor

Awesome!

@lucianmat
Copy link
Author

@natanrolnik it needed to rebase the code, as @gfosco had guessed . I'll resubmit PR after cleaning up, and adding some tests and documentation for proposed behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants