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

Add support for Registration Tokens #17555

Merged

Conversation

shweta83
Copy link
Contributor

@shweta83 shweta83 commented Feb 9, 2025

Problem Statement

Add support for JWT invalidate via API: SAT-30383

Solution

Added API support

Related Issues

SatelliteQE/nailgun#1260

@shweta83 shweta83 added No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master labels Feb 9, 2025
@shweta83 shweta83 requested a review from a team as a code owner February 9, 2025 18:44
@shweta83
Copy link
Contributor Author

shweta83 commented Feb 9, 2025

trigger: test-robottelo
pytest: tests/foreman/api/test_user.py -k test_positive_invalidate_users_tokens
nailgun: 1260

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10133
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_user.py -k test_positive_invalidate_users_tokens --external-logging
Test Result : ========= 2 passed, 148 deselected, 256 warnings in 1050.83s (0:17:30) =========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 9, 2025
@shweta83 shweta83 requested a review from a team February 10, 2025 05:09
@shweta83 shweta83 requested a review from girijaasoni February 10, 2025 05:23
@shweta83 shweta83 force-pushed the jwt_invalidate_api_support branch from 444794d to d0dd9b9 Compare February 10, 2025 14:34
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 10, 2025
@shweta83
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_user.py -k test_positive_invalidate_users_tokens
nailgun: 1260

@shweta83 shweta83 force-pushed the jwt_invalidate_api_support branch from d0dd9b9 to b10038a Compare February 10, 2025 14:36
@shweta83
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_user.py -k test_positive_invalidate_users_tokens
nailgun: 1260

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10139
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_user.py -k test_positive_invalidate_users_tokens --external-logging
Test Result : ========= 2 passed, 148 deselected, 257 warnings in 996.42s (0:16:36) ==========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 10, 2025
@shweta83 shweta83 force-pushed the jwt_invalidate_api_support branch from b10038a to 6309f7c Compare February 10, 2025 18:16
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 10, 2025
@shweta83 shweta83 force-pushed the jwt_invalidate_api_support branch from 6309f7c to b142abd Compare February 10, 2025 18:23
@shweta83
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_user.py -k test_positive_invalidate_users_tokens
nailgun: 1260

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10140
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_user.py -k test_positive_invalidate_users_tokens --external-logging
Test Result : ==== 2 passed, 148 deselected, 261 warnings, 1 error in 1072.12s (0:17:52) =====

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Feb 10, 2025
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10142
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_user.py -k test_positive_invalidate_users_tokens --external-logging
Test Result : ===== 2 passed, 148 deselected, 257 warnings, 1 error in 997.23s (0:16:37) =====

Copy link
Member

@chris1984 chris1984 left a comment

Choose a reason for hiding this comment

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

Looks straight forward

@shweta83 shweta83 force-pushed the jwt_invalidate_api_support branch from b142abd to 67c4ca1 Compare February 11, 2025 06:59
@Gauravtalreja1 Gauravtalreja1 added the API Issues and PRs involving the API label Feb 11, 2025
@shweta83 shweta83 force-pushed the jwt_invalidate_api_support branch 2 times, most recently from 9dcf9ee to dac6697 Compare February 11, 2025 17:30
@shweta83
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_user.py -k test_positive_invalidate_users_tokens
nailgun: 1260

@shweta83
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_registration.py -k test_positive_invalidate_users_tokens
nailgun: 1260

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10151
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_registration.py -k test_positive_invalidate_users_tokens --external-logging
Test Result : ===== 1 passed, 23 deselected, 36 warnings, 1 error in 1023.36s (0:17:03) ======

user = admin_user

# Non-Admin user with "edit_users" permission and "Register hosts" role
roles = [target_sat.api.Role().create()]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Optional: It would be better to define it as a custom_role and assign permissions then append it to list or you simply add to the list when creating a user along with host_register_role

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would like to keep this.

@shweta83 shweta83 force-pushed the jwt_invalidate_api_support branch 2 times, most recently from d5ea2a4 to 4863186 Compare February 13, 2025 05:02
@shweta83
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_registration.py -k test_positive_invalidate_users_tokens
nailgun: 1260

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10156
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_registration.py -k test_positive_invalidate_users_tokens --external-logging
Test Result : ===== 1 passed, 23 deselected, 36 warnings, 1 error in 1696.73s (0:28:16) ======

@shweta83 shweta83 force-pushed the jwt_invalidate_api_support branch from 4863186 to f5e163a Compare February 13, 2025 05:50
@shweta83
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_registration.py -k test_positive_invalidate_users_tokens
nailgun: 1260

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 10157
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/api/test_registration.py -k test_positive_invalidate_users_tokens --external-logging
Test Result : ========== 1 passed, 23 deselected, 36 warnings in 1328.80s (0:22:08) ==========

@Satellite-QE Satellite-QE added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels Feb 13, 2025
Copy link
Collaborator

@Gauravtalreja1 Gauravtalreja1 left a comment

Choose a reason for hiding this comment

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

ACK, @shweta83 Good job and thanks for addressing the comments

@Gauravtalreja1 Gauravtalreja1 merged commit 03a11c7 into SatelliteQE:master Feb 13, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Issues and PRs involving the API No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR Stream Introduced in or relating directly to Satellite Stream/Master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants