Skip to content

Commit

Permalink
Add support for JWT invalidate for users
Browse files Browse the repository at this point in the history
  • Loading branch information
shweta83 committed Jan 30, 2025
1 parent e17a99c commit 5353a4f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions airgun/entities/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ def delete(self, entity_name):
view.flash.assert_no_error()
view.flash.dismiss()

def invalidate_jwt(self, entity_name):
"""Invalidate JSON Web Token of an user entity"""
view = self.navigate_to(self, 'All')
view.search(entity_name)
if view.dropdown.is_displayed:
view.dropdown.click()
view.invalidate_jwt.click()
view.dialog.confirm_dialog.click()
view.flash.assert_no_error()
view.flash.dismiss()


@navigator.register(UserEntity, 'All')
class ShowAllUsers(NavigateStep):
Expand Down
3 changes: 3 additions & 0 deletions airgun/views/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
class UsersView(BaseLoggedInView, SearchableViewMixinPF4):
title = Text("//h1[normalize-space(.)='Users']")
new = Text("//a[contains(@href, '/users/new')]")
dropdown = Text("//a[@href='#' and contains(@class, 'dropdown-toggle')]")
invalidate_jwt = Text('.//a[@data-method="patch"]')
impersonate_user = Text('.//a[@data-method="post"]')
table = Table(
'.//table',
column_widgets={
Expand Down

0 comments on commit 5353a4f

Please sign in to comment.