-
Notifications
You must be signed in to change notification settings - Fork 115
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
Add Hammer support for invalidating users JWTs #17468
base: master
Are you sure you want to change the base?
Conversation
b166c15
to
770cb4a
Compare
3de9987
to
3938ea8
Compare
09bb698
to
7c0d2de
Compare
trigger: test-robottelo |
|
||
:Verifies: SAT-30385 | ||
""" | ||
admin_login = gen_string('alpha') |
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.
@shweta83 do you think it's possible to parameterize the test for admin and non-admin user? I see some code repetition in the test.
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.
Yes, that would be better, it's somewhat messy as it is. It would be nice to clearly separate the test cases
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.
Yes, I was going to do it. Updated
tests/foreman/cli/test_user.py
Outdated
assert f'Successfully invalidated registration tokens for {admin_login}' in result | ||
|
||
# Re-register the host with invalidated token | ||
result = rhel_contenthost.execute(cmd.strip('\n')) |
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.
Don't we need to properly unregister/clean the host first so we can try re-registration?
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.
Yes. I added that.
tests/foreman/cli/test_user.py
Outdated
|
||
# Invalidate JWTs for multiple users | ||
result = module_target_sat.cli.User.with_user(admin_login, password).invalidate_multiple( | ||
options={'search': f"id ^ ({admin_user['id']}, {non_admin_user['id']})"} |
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.
we already invalidate token foradmin_login
so is this alright? I suppose it won't hurt but is this what you wanted to do?
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.
Yes, this is intentional.
PRT Result
|
7c0d2de
to
70008b4
Compare
trigger: test-robottelo |
PRT Result
|
Problem Statement
Hammer support for invalidating JWTs : SAT-30385
Solution
Added support for JWT invalidate in CLI
Related Issues