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

Clear backupcode reminder when no 2fa #14553

Merged
merged 2 commits into from
Mar 6, 2019

Conversation

rullzer
Copy link
Member

@rullzer rullzer commented Mar 5, 2019

Fixes #14125

rullzer added 2 commits March 5, 2019 20:14
Fixes #14125

Listen to 2FA disable event. If a provider is disabled for a user. We
check if there are no more providers. If there are no more providers we
Remove the backupcode reminder notification (if still present).

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
If the job is still present we should also not fire it off if there is
not a single active 2FA provider.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@faily-bot
Copy link

faily-bot bot commented Mar 5, 2019

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 16797: failure

TESTS=acceptance, TESTS-ACCEPTANCE=app-files-tags

  • tests/acceptance/features/app-files-tags.feature:11
Show full log
  Scenario: show the input field for tags in the details view after closing and opening the details view again # /drone/src/github.com/nextcloud/server/tests/acceptance/features/app-files-tags.feature:11
    Given I am logged in                                                                                       # LoginPageContext::iAmLoggedIn()
    And I open the details view for "welcome.txt"                                                              # FileListContext::iOpenTheDetailsViewFor()
    And I see that the details view is open                                                                    # FilesAppContext::iSeeThatTheDetailsViewIsOpen()
    And I close the details view                                                                               # FilesAppContext::iCloseTheDetailsView()
    And I see that the details view is closed                                                                  # FilesAppContext::iSeeThatTheDetailsViewIsClosed()
    And I open the details view for "welcome.txt"                                                              # FileListContext::iOpenTheDetailsViewFor()
    And I see that the details view is open                                                                    # FilesAppContext::iSeeThatTheDetailsViewIsOpen()
    When I open the input field for tags in the details view                                                   # FilesAppContext::iOpenTheInputFieldForTagsInTheDetailsView()
      File details with text "Tags" in details view in Files app could not be found after 100 seconds (NoSuchElementException)
    Then I see that the input field for tags in the details view is shown                                      # FilesAppContext::iSeeThatTheInputFieldForTagsInTheDetailsViewIsShown()

TESTS=acceptance, TESTS-ACCEPTANCE=login

  • tests/acceptance/features/login.feature:38
Show full log
  Scenario: log in with invalid user once fixed by admin              # /drone/src/github.com/nextcloud/server/tests/acceptance/features/login.feature:38
    Given I act as John                                               # ActorContext::iActAs()
    And I can not log in with user unknownUser and password 123456acb # LoginPageContext::iCanNotLogInWithUserAndPassword()
    When I act as Jane                                                # ActorContext::iActAs()
    And I am logged in as the admin                                   # LoginPageContext::iAmLoggedInAsTheAdmin()
    And I open the User settings                                      # SettingsMenuContext::iOpenTheUserSettings()
    And I click the New user button                                   # UsersSettingsContext::iClickTheNewUserButton()
    And I see that the new user form is shown                         # UsersSettingsContext::iSeeThatTheNewUserFormIsShown()
    And I create user unknownUser with password 123456acb             # UsersSettingsContext::iCreateUserWithPassword()
    And I see that the list of users contains the user unknownUser    # UsersSettingsContext::iSeeThatTheListOfUsersContainsTheUser()
    And I act as John                                                 # ActorContext::iActAs()
    And I log in with user unknownUser and password 123456acb         # LoginPageContext::iLogInWithUserAndPassword()
    Then I see that the current page is the Files app                 # FilesAppContext::iSeeThatTheCurrentPageIsTheFilesApp()
      Failed asserting that 'http://acceptance-login/index.php/login?user=unknownUser' starts with "http://acceptance-login/index.php/apps/files/".

TESTS=acceptance, TESTS-ACCEPTANCE=users

  • tests/acceptance/features/users.feature:13
  • tests/acceptance/features/users.feature:25
  • tests/acceptance/features/users.feature:35
  • tests/acceptance/features/users.feature:47
Show full log
  Scenario: create a new user with a custom display name                       # /drone/src/github.com/nextcloud/server/tests/acceptance/features/users.feature:13
    Given I am logged in as the admin                                          # LoginPageContext::iAmLoggedInAsTheAdmin()
    And I open the User settings                                               # SettingsMenuContext::iOpenTheUserSettings()
    When I click the New user button                                           # UsersSettingsContext::iClickTheNewUserButton()
    And I see that the new user form is shown                                  # UsersSettingsContext::iSeeThatTheNewUserFormIsShown()
    And I set the user name for the new user to "test"                         # UsersSettingsContext::iSetTheUserNameForTheNewUserTo()
    And I set the display name for the new user to "Test display name"         # UsersSettingsContext::iSetTheDisplayNameForTheNewUserTo()
    And I set the password for the new user to "123456acb"                     # UsersSettingsContext::iSetThePasswordForTheNewUserTo()
    And I create the new user                                                  # UsersSettingsContext::iCreateTheNewUser()
    Then I see that the list of users contains the user "test"                 # UsersSettingsContext::iSeeThatTheListOfUsersContainsTheUser()
    And I see that the display name for the user "test" is "Test display name" # UsersSettingsContext::iSeeThatTheDisplayNameForTheUserIs()
      Row for user test in Users Settings could not be found after 100 seconds
      displayName cell for user test in Users Settings could not be found after 100 seconds
      displayName input for user test in Users Settings could not be found after 100 seconds (NoSuchElementException)

  Scenario: delete a user                                                      # /drone/src/github.com/nextcloud/server/tests/acceptance/features/users.feature:25
    Given I act as Jane                                                        # ActorContext::iActAs()
    And I am logged in as the admin                                            # LoginPageContext::iAmLoggedInAsTheAdmin()
    And I open the User settings                                               # SettingsMenuContext::iOpenTheUserSettings()
    And I see that the list of users contains the user user0                   # UsersSettingsContext::iSeeThatTheListOfUsersContainsTheUser()
    And I open the actions menu for the user user0                             # UsersSettingsContext::iOpenTheActionsMenuOf()
    And I see that the "Delete user" action in the user0 actions menu is shown # UsersSettingsContext::iSeeTheAction()
      Failed asserting that false is true.
    When I click the "Delete user" action in the user0 actions menu            # UsersSettingsContext::iClickTheAction()
    Then I see that the list of users does not contains the user user0         # UsersSettingsContext::iSeeThatTheListOfUsersDoesNotContainsTheUser()

  Scenario: disable a user                                                      # /drone/src/github.com/nextcloud/server/tests/acceptance/features/users.feature:35
    Given I act as Jane                                                         # ActorContext::iActAs()
    And I am logged in as the admin                                             # LoginPageContext::iAmLoggedInAsTheAdmin()
    And I open the User settings                                                # SettingsMenuContext::iOpenTheUserSettings()
    And I see that the list of users contains the user user0                    # UsersSettingsContext::iSeeThatTheListOfUsersContainsTheUser()
    And I open the actions menu for the user user0                              # UsersSettingsContext::iOpenTheActionsMenuOf()
    And I see that the "Disable user" action in the user0 actions menu is shown # UsersSettingsContext::iSeeTheAction()
      Failed asserting that false is true.
    When I click the "Disable user" action in the user0 actions menu            # UsersSettingsContext::iClickTheAction()
    Then I see that the list of users does not contains the user user0          # UsersSettingsContext::iSeeThatTheListOfUsersDoesNotContainsTheUser()
    When I open the "Disabled users" section                                    # AppNavigationContext::iOpenTheSection()
    Then I see that the list of users contains the user user0                   # UsersSettingsContext::iSeeThatTheListOfUsersContainsTheUser()

  Scenario: users navigation without disabled users                                   # /drone/src/github.com/nextcloud/server/tests/acceptance/features/users.feature:47
    Given I act as Jane                                                               # ActorContext::iActAs()
    And I am logged in as the admin                                                   # LoginPageContext::iAmLoggedInAsTheAdmin()
    And I open the User settings                                                      # SettingsMenuContext::iOpenTheUserSettings()
    And I open the "Disabled users" section                                           # AppNavigationContext::iOpenTheSection()
    And I see that the list of users contains the user disabledUser                   # UsersSettingsContext::iSeeThatTheListOfUsersContainsTheUser()
    And I open the actions menu for the user disabledUser                             # UsersSettingsContext::iOpenTheActionsMenuOf()
    And I see that the "Enable user" action in the disabledUser actions menu is shown # UsersSettingsContext::iSeeTheAction()
      Failed asserting that false is true.
    When I click the "Enable user" action in the disabledUser actions menu            # UsersSettingsContext::iClickTheAction()
    Then I see that the section "Disabled users" is not shown                         # AppNavigationContext::iSeeThatTheSectionIsNotShown()
    When I open the User settings                                                     # SettingsMenuContext::iOpenTheUserSettings()
    Then I see that the section "Disabled users" is not shown                         # AppNavigationContext::iSeeThatTheSectionIsNotShown()

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

Code looks good 👍

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.

Looks good!

@ChristophWurst ChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Mar 6, 2019
@ChristophWurst
Copy link
Member

We should backport this to 15

@MorrisJobke
Copy link
Member

/backport to stable15

@MorrisJobke MorrisJobke merged commit 58f6a77 into master Mar 6, 2019
@MorrisJobke MorrisJobke deleted the fix/14125/clear_backupcode_reminder_when_no_2fa branch March 6, 2019 09:17
@backportbot-nextcloud
Copy link

backport to stable15 in #14559

@MorrisJobke MorrisJobke mentioned this pull request Mar 6, 2019
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants