Skip to content

Conversation

@ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented Oct 12, 2020

Because currently you have to query the internal user manager to do so.

Ref https://help.nextcloud.com/t/user-backend-api-overhaul/94896

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
];
}

public function registerUserBackEnd(string $appId, string $class): void {
Copy link

@alexeyabel alexeyabel Oct 12, 2020

Choose a reason for hiding this comment

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

How come classes are passed as strings and not as interfaces? Shouldn't interfaces be enforced by type checks?

I understand this is already the case in the whole class, but I am not familiar with this concept.

Copy link
Member Author

Choose a reason for hiding this comment

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

The registration code is run for every single request. User back-ends are built most likely for those requests but other things are just loaded conditionally on demand (lazily) so less resources are wasted. Php allows us to specify the class name to load and we use the dependency injection container to create an instance when needed.

See #20573 for most of the original ideas and design decisions.

@faily-bot
Copy link

faily-bot bot commented Oct 12, 2020

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 33974: failure

sqlite

Show full log
There were 2 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

--

There was 1 failure:

1) TrashbinTest::testExpireOldFilesShared
Failed asserting that 3 is identical to 2.

/drone/src/apps/files_trashbin/tests/TrashbinTest.php:304
/drone/src/apps/files_trashbin/tests/TrashbinTest.php:287

mariadb10.1-php7.3

mariadb10.4-php7.4

mysql8.0-php7.4

  • cancelled - typically means that the tests took longer than the drone CI allows them to run

mysql5.6-php7.3

postgres9-php7.3

Show full log
There were 2 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

--

There was 1 failure:

1) TrashbinTest::testExpireOldFilesShared
Failed asserting that 3 is identical to 2.

/drone/src/apps/files_trashbin/tests/TrashbinTest.php:304
/drone/src/apps/files_trashbin/tests/TrashbinTest.php:287

postgres11-php7.4

acceptance-app-files-sharing

  • tests/acceptance/features/app-files-sharing.feature:338
Show full log
  Scenario: sharee can revoke create permission from reshare after the sharer disabled it # /drone/src/tests/acceptance/features/app-files-sharing.feature:338
    Given I act as John                                                                   # ActorContext::iActAs()
    And I am logged in as the admin                                                       # LoginPageContext::iAmLoggedInAsTheAdmin()
    And I act as Jane                                                                     # ActorContext::iActAs()
    And I am logged in                                                                    # LoginPageContext::iAmLoggedIn()
    And I act as Jim                                                                      # ActorContext::iActAs()
    And I am logged in as "user1"                                                         # LoginPageContext::iAmLoggedInAs()
    And I act as John                                                                     # ActorContext::iActAs()
    And I create a new folder named "Shared folder"                                       # FileListContext::iCreateANewFolderNamed()
    And I see that the file list contains a file named "Shared folder"                    # FileListContext::iSeeThatTheFileListContainsAFileNamed()
    And I share "Shared folder" with "user0"                                              # FilesAppSharingContext::iShareWith()
    And I see that the file is shared with "user0"                                        # FilesAppSharingContext::iSeeThatTheFileIsSharedWith()
    And I act as Jane                                                                     # ActorContext::iActAs()
    And I open the Files app                                                              # FilesAppContext::iOpenTheFilesApp()
    And I share "Shared folder" with "user1"                                              # FilesAppSharingContext::iShareWith()
    And I see that the file is shared with "user1"                                        # FilesAppSharingContext::iSeeThatTheFileIsSharedWith()
    And I act as John                                                                     # ActorContext::iActAs()
    And I set the share with "user0" as not creatable                                     # FilesAppSharingContext::iSetTheShareWithAsNotCreatable()
    And I see that "user0" can not create in the share                                    # FilesAppSharingContext::iSeeThatCanNotCreateInTheShare()
    And I act as Jim                                                                      # ActorContext::iActAs()
    And I open the Files app                                                              # FilesAppContext::iOpenTheFilesApp()
    And I enter in the folder named "Shared folder"                                       # FileListContext::iEnterInTheFolderNamed()
    And I create a new folder named "Subfolder"                                           # FileListContext::iCreateANewFolderNamed()
    And I see that the file list contains a file named "Subfolder"                        # FileListContext::iSeeThatTheFileListContainsAFileNamed()
    When I act as Jane                                                                    # ActorContext::iActAs()
    And I open the Files app                                                              # FilesAppContext::iOpenTheFilesApp()
    And I open the details view for "Shared folder"                                       # FileListContext::iOpenTheDetailsViewFor()
    And I see that the details view is open                                               # FilesAppContext::iSeeThatTheDetailsViewIsOpen()
    And I open the "Sharing" tab in the details view                                      # FilesAppContext::iOpenTheTabInTheDetailsView()
    And I see that the "Sharing" tab in the details view is eventually loaded             # FilesAppContext::iSeeThatTheTabInTheDetailsViewIsEventuallyLoaded()
    And I set the share with "user1" as not creatable                                     # FilesAppSharingContext::iSetTheShareWithAsNotCreatable()
    Then I see that "user1" can not create in the share                                   # FilesAppSharingContext::iSeeThatCanNotCreateInTheShare()
    And I see that "user1" can not be allowed to create in the share                      # FilesAppSharingContext::iSeeThatCanNotBeAllowedToCreateInTheShare()
    And I act as Jim                                                                      # ActorContext::iActAs()
    And I open the Files app                                                              # FilesAppContext::iOpenTheFilesApp()
    And I enter in the folder named "Shared folder"                                       # FileListContext::iEnterInTheFolderNamed()
    And I see that it is not possible to create new files                                 # FileListContext::iSeeThatItIsNotPossibleToCreateNewFiles()
      Failed asserting that true is false.

@rullzer rullzer mentioned this pull request Dec 14, 2020
59 tasks
@ChristophWurst ChristophWurst deleted the enhancement/bootstrap-user-backend-registration branch February 9, 2021 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants