-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
feat: Add ParseUser::logInAs
method
#486
feat: Add ParseUser::logInAs
method
#486
Conversation
Thanks for opening this pull request!
|
I will reformat the title to use the proper commit message syntax. |
@dplewis Is this something you'd want to review? |
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.
Looks good
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.
I didn't know this was a feature. Probably should add it to the JS SDK
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.
Thank you for your contribution!
loginAs
method
@dplewis Before we merge this, do you have any idea how the test results are reported here? So we know that they pass before merging. This hasn't migrated to GitHub Actions yet and is still using Travis CI. |
MIght have to reenable travis and pay the bill. I'm currenly working on migrating this to Github Action |
@mtrezza , @dplewis I forked this repo and tested it against these Parse Server Versions: 3.10.0 - [CircleCI run] [GitHub Changes] - 5.4.3 - [CircleCI run] [GitHub Changes] - 6.0.0 - [CircleCI run] [GitHub Changes] -
Note that there were only 4 errors when run against Parse 3, and 5 errors in the other two. Let me know if there's anything about the server in particular I need to configure for these other ones to pass - otherwise I can try and help fix these once I understand a bit more of the context around a few of these functions. In the meantime, Parse 6 running with my tests doesn't introduce any new test failures, so the 3 tests I added pass - we can see here that the pipeline run with my changes has the same number of errors as before, the 5 above. I chose Parse 6 as the server to run the tests against since Parse 6 is the version that introduced the new endpoint that I needed the client to talk to. I'm not in a rush to merge this PR so I'm game to help get the other tests passing and everything running clean against every version before we merge my feature in. I can target the changes against a new major version of Parse PHP SDK as well - that might make sense since this method wouldn't work for any folks who upgrade their PHP client after this change is released but are using Parse Server versions < 6. |
We've released the new SDK version 2.0.0. I've rebased this PR, let's see how tests are doing. To your point, I think we should add a compatibility table to the README for Parse Server, to indicate which Parse Server versions this SDK is compatible with. For now, this is running against the alpha branch of Parse Server: Line 24 in 14be532
With all tests passing, we could assume that it's compatible with all relevant previous Parse Server versions - given that we don't support Parse Server 4 anymore, with Parse Server 5 currently being in LTS. If you have any additions for Changelog entry and version bump are not needed as part of this PR, auto-release will do that. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #486 +/- ##
=========================================
Coverage 98.47% 98.48%
- Complexity 1058 1060 +2
=========================================
Files 38 38
Lines 3213 3225 +12
=========================================
+ Hits 3164 3176 +12
Misses 49 49
☔ View full report in Codecov by Sentry. |
I suppose we can merge this, it seems that #491 contains the same tests as this PR? |
@mtrezza I think this is good to merge. You want to try auto release with this one? |
Yes, let's give it a try! I'll just copy your fixes from #498 before that, so we should also see the docs auto-generated. |
# [2.1.0](2.0.0...2.1.0) (2023-04-29) ### Features * Add `ParseUser::logInAs` method ([#486](#486)) ([5b4e102](5b4e102))
🎉 This change has been released in version 2.1.0 |
New Pull Request Checklist
Closes: #485
Issue Description
Later versions of Parse Server allow for the
loginAs
method. Given auserId
and the master key, one can become logged in as the user associated to theuserId
provided. This PR adds the PHP Parse SDK method to call the Parse Server endpoint.Approach
To implement this method, I've added a function similar to
login
but modified to only require theuserId
, as the master key is already assumed when using this method. Tests similar to thelogin
tests have been added and modified to cover the cases of a success or a failure with nouserId
provided.