Repository navigation
Implementing GET /config and POST /config support - #283
Conversation
| className === '_Session' || | ||
| className === '_SCHEMA' || //TODO: remove this, as _SCHEMA is not a valid class name for storing Parse Objects. | ||
| className === '_Role' || | ||
| className === '_GlobalConfig' || |
There was a problem hiding this comment.
This shouldn't really go here, as this is the place for the names of classes that the client is allowed to create. _SCHEMA is only here for legacy reasons, it should be removed.
There was a problem hiding this comment.
Hmm, but as I see it it's used by ExportAdapter (see https://github.com/theill/parse-server/blob/master/ExportAdapter.js#L63) to filter what collections you're able to query. Is it because I'm going through wrong path?
There was a problem hiding this comment.
ExportAdapter is the legacy user of this class that needs to be fixed before we can remove _SCHEMA from the list of valid class names. Take a look at schemas.js for how do it without using the classNameIsValid function.
There was a problem hiding this comment.
Thanks, I'll take a look. It seems to be schemas.js uses req.config.database.collection to access a collection which eventually ends up with classNameIsValid too but I'll dig a bit deeper tonight.
There was a problem hiding this comment.
Looks like you are right. Maybe we need a database.rawCollection() function or something like that, to bypass the classNameIsValid check.
There was a problem hiding this comment.
That will work but then we need one for update too because the current update also uses database.collection
There was a problem hiding this comment.
Or I can just do rawCollection().findAndModify() on it if that's ok. I'll update my PR with that and wait for your comments.
|
@theill updated the pull request. |
| @@ -0,0 +1,49 @@ | |||
| // run test when changing related file using | |||
| // $ TESTING=1 node_modules/jasmine/bin/jasmine.js spec/ParseGlobalConfig.spec.js | |||
There was a problem hiding this comment.
I think one of our team members is in the middle of making some changes to our testing framework, so this comment is probably going to become out of date soon. Can you remove it? We'll keep instructions for how to run tests in CONTRIBUTING.md.
|
@theill updated the pull request. |
Updated tests accordingly to changed access
|
@theill updated the pull request. |
|
@theill updated the pull request. |
| "expiresAt": {type:'Date'}, | ||
| "createdWith": {type:'Object'}, | ||
| }, | ||
| _GlobalConfig: { |
There was a problem hiding this comment.
This defaultColumns object only tracks default columns for collections that contain Parse Objects (thats what _SCHEMA isn't in here. So I think config probably shouldn't be here either.
|
Looking awesome! As soon as this is hidden behind the experimental flag, I can land this. We just don't want to get into a situation where we are shipping a new version on npm that includes in-progress features, like we accidentally did for schemas API :) Thanks for the great work! |
|
@theill updated the pull request. |
|
@theill updated the pull request. |
|
@theill updated the pull request. |
|
@theill updated the pull request. |
|
@theill updated the pull request. |
Implementing GET /config and POST /config support
|
Hello So /1/config is now available ? If yes I think you should update https://parse.com/docs/server/guide#migrating Thanks |
|
Config is still experimental. We are doing further testing and will update the docs once we are confident in the implementation and its compatibility with Parse.com. |
|
Anyone know if this Parse Config addition is included in the 2.0.8 parse-server npm? If not, any ideas when it might get packaged up? I just pushed 2.0.8 to the Heroku server and still got "Cannot GET /1/config" Thanks |
|
@sghamaty Did you change PARSE_MOUNT=/1 ? If not, the proper path is /parse/config by default. |
|
Yes, my PARSE_MOUNT=/1 . Still not working. On Tue, Feb 16, 2016 at 3:41 PM, Fosco Marotto notifications@github.com
|
|
You also need to set PARSE_EXPERIMENTAL_CONFIG_ENABLED=1 environment variable. |
|
Yes, that did it. Thanks
|
|
Is it possible to do something like |
|
@douineauromain It's not, but a PR that added this in |
Adds support for retrieving global configuration by handling GET requests for
/config. This will return a JSON payload with anparamsattribute with config.Furthermore support for doing a POST to /config for updating this value.