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

Support server-url to specify api server #35

Merged
merged 6 commits into from Jul 3, 2016

Conversation

sdf611097
Copy link
Contributor

lots of bugs in new API-SERVER, so test failed

object __type check is missing
role name check is missing. Role names must be specified. code 135
file/push implementation is changed
users get will get additional ACL info
user test failed by recovable session is required

newServerTest.sh need start local ParseServer.

You can start it from
https://github.com/sdf611097/parse-server-example.git
sh kaiseki.sh

include is not a function in 'should', using endWith instead
lots of bugs in new API-SERVER, so test failed

object __type check is missing
role name check is missing. Role names must be specified. code 135
file/push implementation is changed
user get will get addtional info ACL
user test failed by recovable session is required
@shiki
Copy link
Owner

shiki commented Feb 29, 2016

Thanks for this. I will look into this properly before merging.

@arikw
Copy link

arikw commented Apr 13, 2016

+1

@virmelcruz
Copy link

I also need this, 👍 +1

modify test to fit the origin/new parse server
support revocable session which is enable by default
@sdf611097
Copy link
Contributor Author

I modify test to fit original/new parse server as best as I can.
But there still have 1 fail(same as previous) in origin ParseServer.
3 fail in new ParseServer(2 file 1 push)

https://github.com/sdf611097/parse-server-example.git
I've change db to local for test.
Original one is corrupt so that user.test.js is failed.

U can run cmd below in parse-server-example to start local env for parse server.
sh kaiseki.sh

After that, execute below cmd in kaiseki to run the test with this env
sh newServerTest.sh

but there are still 3 failure

  1. file can upload simple text as a file:
  Uncaught AssertionError: expected 'text/plain; charset=utf-8' to equal 'text/plain'
  + expected - actual

  -text/plain; charset=utf-8
  +text/plain

This is little different from original, doesn't matter.

  1. file can delete a file (using API masterkey):
  Uncaught AssertionError: expected 404 to equal 403
  + expected - actual

  -404
  +403

This test is also failed in the origin test, but response is different.
ParseFile implementation is changed.
I haven't deal with it.

  1. push can broadcast a notification:

this one should fail with 'To push to ios devices, you must first configure a valid certificate.'

but I'm not familiar with push, maybe is due to my local env is empty, the target is empty so that pass.

@sdf611097
Copy link
Contributor Author

@shiki will this pr be accepted, merged and npm publish a new kaiseki version?

};

Kaiseki.prototype = {
API_BASE_URL: 'https://api.parse.com',
var DEFAULT_MOUNT_PATH = '/1';
Copy link
Owner

Choose a reason for hiding this comment

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

Why didn't you just put the /1 as part of the serverUrl?

Copy link
Contributor Author

@sdf611097 sdf611097 May 30, 2016

Choose a reason for hiding this comment

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

Open-source ParseServer can specified mount path. Parse.com use /1, and the example use /parse. So the serverUrl is combination of host-server(:port) and its mount path. "api.parse.com/1" and "localhost:1337/parse"

Copy link
Owner

@shiki shiki May 30, 2016

Choose a reason for hiding this comment

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

But isn't that just the same as giving a server url with the "/1" or the "/parse" though?

new Kaiseki(.... "api.parse.com/1")

or

new Kaiseki(... "localhost:1337/parse")

@shiki
Copy link
Owner

shiki commented May 30, 2016

I am. I'm having trouble to actually get this to work with the default parse server. I think we should have something that does not require a customized parse-server repository.

I'll push this in a different branch for now and work on that branch.

Do you think we should just have revocable sessions turned on by default and not let that get configured? That's probably gonna make things less complicated.

@sdf611097
Copy link
Contributor Author

Revocable sessions turn on by default is ok. I think it should be configurable, or it will not compatible with legacy-sessions. Someone are trying to let parse-server support legacy token.

Maybe I separate the commits? Configurable first, then support switch parse-server url?

I think we should have something that does not require a customized parse-server repository.

I do not catch this sentence.
You are trying https://github.com/ParsePlatform/parse-server ? or https://github.com/ParsePlatform/parse-server-example ?

Sorry for my poor English.

@shiki shiki self-assigned this May 31, 2016
@shiki
Copy link
Owner

shiki commented May 31, 2016

Maybe I separate the commits? Configurable first, then support switch parse-server url?

Don't worry about it. I pushed this to the parse-server branch for now.

I am trying to get this working using the default config from https://github.com/ParsePlatform/parse-server-example.

I'll merge the parse-server branch after making the tests working. I'm also gonna remove the remaining unnecessary code for supporting the old Parse API.

@sdf611097
Copy link
Contributor Author

If you have any problem, plz let me know.

@shiki shiki merged commit 9773bc5 into shiki:master Jul 3, 2016
@shiki
Copy link
Owner

shiki commented Jul 3, 2016

This has been merged to master and pushed to NPM. I dropped the support for the old Parse to make things easier.

@sdf611097
Copy link
Contributor Author

Thanks for your merge and publish. ^^

@sdf611097 sdf611097 deleted the parseServer branch July 6, 2016 12:58
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.

None yet

4 participants