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

Fix settings routing #20591

Merged
merged 1 commit into from
Apr 22, 2020
Merged

Fix settings routing #20591

merged 1 commit into from
Apr 22, 2020

Conversation

rullzer
Copy link
Member

@rullzer rullzer commented Apr 21, 2020

Fixup on #20114

@rullzer rullzer added the 3. to review Waiting for reviews label Apr 21, 2020
@rullzer rullzer added this to the Nextcloud 19 milestone Apr 21, 2020
@nickvergessen
Copy link
Member

let me check the failing remote_api integration test tomorrow

Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

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

Just in case, blocking merge until PHP CS and failing remote_api integration tests are fixed :-)

@nickvergessen
Copy link
Member

Feature: remote

  Scenario: Get status of remote server                     # /home/nickv/Nextcloud/19/server/build/integration/remoteapi_features/remote.feature:3
[Wed Apr 22 07:52:07 2020] 127.0.0.1:50346 Invalid request (Unsupported SSL request)
[Wed Apr 22 07:52:07 2020] 127.0.0.1:50348 [200]: /status.php
    Given using remote server "REMOTE"                      # RemoteContext::selectRemoteInstance()
    Then the remote version should be "__current_version__" # RemoteContext::theRemoteVersionShouldBe()
    And the remote protocol should be "http"                # RemoteContext::theRemoteProtocolShouldBe()

  Scenario: Get status of a non existing server                       # /home/nickv/Nextcloud/19/server/build/integration/remoteapi_features/remote.feature:8
    Given using remote server "NON_EXISTING"                          # RemoteContext::selectRemoteInstance()
    Then the request should throw a "OC\Remote\Api\NotFoundException" # RemoteContext::lastError()

  Scenario: Get user info for a remote user         # /home/nickv/Nextcloud/19/server/build/integration/remoteapi_features/remote.feature:12
[Wed Apr 22 07:52:17 2020] 127.0.0.1:50374 Invalid request (Unsupported SSL request)
[Wed Apr 22 07:52:17 2020] 127.0.0.1:50376 [200]: /status.php
    Given using remote server "REMOTE"              # RemoteContext::selectRemoteInstance()
[Wed Apr 22 07:52:18 2020] 127.0.0.1:50388 [404]: /ocs/v2.php/cloud/users/user0
[Wed Apr 22 07:52:19 2020] Successful addUser call with userid: user0
[Wed Apr 22 07:52:19 2020] 127.0.0.1:50406 [200]: /ocs/v1.php/cloud/users
[Wed Apr 22 07:52:20 2020] copying skeleton for user0 from /home/nickv/Nextcloud/19/skeleton to /user0/files/
[Wed Apr 22 07:52:23 2020] 127.0.0.1:50426 [200]: /ocs/v1.php/cloud/users/user0
[Wed Apr 22 07:52:24 2020] 127.0.0.1:50450 [200]: /ocs/v2.php/cloud/users/user0
    And user "user0" exists                         # FeatureContext::assureUserExists()
    And using credentials "user0", "123456"         # RemoteContext::usingCredentials()
[Wed Apr 22 07:52:25 2020] 127.0.0.1:50472 [200]: /ocs/v2.php/cloud/users/user0
    When getting the remote user info for "user0"   # RemoteContext::remoteUserInfo()
    Then the remote user should have userid "user0" # RemoteContext::remoteUserId()
[Wed Apr 22 07:52:26 2020] 127.0.0.1:50494 [200]: /ocs/v1.php/cloud/users/user0
[Wed Apr 22 07:52:27 2020] 127.0.0.1:50516 [404]: /ocs/v2.php/cloud/users/user0

  Scenario: Get user info for a non existing remote user              # /home/nickv/Nextcloud/19/server/build/integration/remoteapi_features/remote.feature:19
[Wed Apr 22 07:52:27 2020] 127.0.0.1:50534 Invalid request (Unsupported SSL request)
[Wed Apr 22 07:52:27 2020] 127.0.0.1:50536 [200]: /status.php
    Given using remote server "REMOTE"                                # RemoteContext::selectRemoteInstance()
[Wed Apr 22 07:52:27 2020] 127.0.0.1:50548 [404]: /ocs/v2.php/cloud/users/user0
[Wed Apr 22 07:52:29 2020] Successful addUser call with userid: user0
[Wed Apr 22 07:52:29 2020] 127.0.0.1:50566 [200]: /ocs/v1.php/cloud/users
[Wed Apr 22 07:52:30 2020] copying skeleton for user0 from /home/nickv/Nextcloud/19/skeleton to /user0/files/
[Wed Apr 22 07:52:33 2020] 127.0.0.1:50588 [200]: /ocs/v1.php/cloud/users/user0
[Wed Apr 22 07:52:33 2020] 127.0.0.1:50612 [200]: /ocs/v2.php/cloud/users/user0
    And user "user0" exists                                           # FeatureContext::assureUserExists()
    And using credentials "user0", "123456"                           # RemoteContext::usingCredentials()
[Wed Apr 22 07:52:34 2020] 127.0.0.1:50634 [404]: /ocs/v2.php/cloud/users/user_non_existing
    When getting the remote user info for "user_non_existing"         # RemoteContext::remoteUserInfo()
    Then the request should throw a "OC\Remote\Api\NotFoundException" # RemoteContext::lastError()
[Wed Apr 22 07:52:35 2020] 127.0.0.1:50652 [200]: /ocs/v1.php/cloud/users/user0
[Wed Apr 22 07:52:36 2020] 127.0.0.1:50674 [404]: /ocs/v2.php/cloud/users/user0

  Scenario: Get user info with invalid credentials          # /home/nickv/Nextcloud/19/server/build/integration/remoteapi_features/remote.feature:26
[Wed Apr 22 07:52:36 2020] 127.0.0.1:50692 Invalid request (Unsupported SSL request)
[Wed Apr 22 07:52:36 2020] 127.0.0.1:50694 [200]: /status.php
    Given using remote server "REMOTE"                      # RemoteContext::selectRemoteInstance()
[Wed Apr 22 07:52:37 2020] 127.0.0.1:50706 [404]: /ocs/v2.php/cloud/users/user0
[Wed Apr 22 07:52:38 2020] Successful addUser call with userid: user0
[Wed Apr 22 07:52:38 2020] 127.0.0.1:50724 [200]: /ocs/v1.php/cloud/users
[Wed Apr 22 07:52:39 2020] copying skeleton for user0 from /home/nickv/Nextcloud/19/skeleton to /user0/files/
[Wed Apr 22 07:52:42 2020] 127.0.0.1:50744 [200]: /ocs/v1.php/cloud/users/user0
[Wed Apr 22 07:52:43 2020] 127.0.0.1:50770 [200]: /ocs/v2.php/cloud/users/user0
    And user "user0" exists                                 # FeatureContext::assureUserExists()
    And using credentials "user0", "invalid"                # RemoteContext::usingCredentials()
[Wed Apr 22 07:52:43 2020] Login failed: 'user0' (Remote IP: '127.0.0.1')
[Wed Apr 22 07:52:43 2020] 127.0.0.1:50794 [401]: /ocs/v2.php/cloud/users/user0
    When getting the remote user info for "user0"           # RemoteContext::remoteUserInfo()
    Then the request should throw a "OC\ForbiddenException" # RemoteContext::lastError()
[Wed Apr 22 07:52:45 2020] 127.0.0.1:50808 [200]: /ocs/v1.php/cloud/users/user0
[Wed Apr 22 07:52:45 2020] 127.0.0.1:50832 [404]: /ocs/v2.php/cloud/users/user0

  Scenario: Get capability of remote server           # /home/nickv/Nextcloud/19/server/build/integration/remoteapi_features/remote.feature:33
[Wed Apr 22 07:52:45 2020] 127.0.0.1:50850 Invalid request (Unsupported SSL request)
[Wed Apr 22 07:52:45 2020] 127.0.0.1:50852 [200]: /status.php
    Given using remote server "REMOTE"                # RemoteContext::selectRemoteInstance()
[Wed Apr 22 07:52:46 2020] 127.0.0.1:50864 [404]: /ocs/v2.php/cloud/users/user0
[Wed Apr 22 07:52:47 2020] Successful addUser call with userid: user0
[Wed Apr 22 07:52:47 2020] 127.0.0.1:50882 [200]: /ocs/v1.php/cloud/users
[Wed Apr 22 07:52:48 2020] copying skeleton for user0 from /home/nickv/Nextcloud/19/skeleton to /user0/files/
[Wed Apr 22 07:52:51 2020] 127.0.0.1:50904 [200]: /ocs/v1.php/cloud/users/user0
[Wed Apr 22 07:52:52 2020] 127.0.0.1:50928 [200]: /ocs/v2.php/cloud/users/user0
    And user "user0" exists                           # FeatureContext::assureUserExists()
    And using credentials "user0", "invalid"          # RemoteContext::usingCredentials()
[Wed Apr 22 07:52:53 2020] Login failed: 'user0' (Remote IP: '127.0.0.1')
[Wed Apr 22 07:52:53 2020] 127.0.0.1:50950 [200]: /ocs/v2.php/cloud/capabilities
    Then the capability "theming.name" is "Nextcloud" # RemoteContext::hasCapability()
[Wed Apr 22 07:52:54 2020] 127.0.0.1:50966 [200]: /ocs/v1.php/cloud/users/user0
[Wed Apr 22 07:52:55 2020] 127.0.0.1:50986 [404]: /ocs/v2.php/cloud/users/user0

6 Szenarien (6 bestanden)
24 Schritte (24 bestanden)

Tests pass locally, so let's see if a repush helps.

and fixed the routes.php

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Tested and works 🚀

@nickvergessen
Copy link
Member

remoteapi_features/remote.feature is a regression from #20554 reverted and therefor fixed in #20594

So this is ready to 🚢

@rullzer
Copy link
Member Author

rullzer commented Apr 22, 2020

Let me squash it all into 1 nice commit

Also prefix resources
Unify the prefix handling
Handle urls with and without slash

Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer rullzer merged commit acdc68e into master Apr 22, 2020
@rullzer rullzer deleted the fix/settings branch April 22, 2020 12:45
@rullzer rullzer mentioned this pull request Apr 22, 2020
55 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants