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

fix(smoke-test): test access to create/revoke personal access tokens #10848

Merged
merged 4 commits into from
Jul 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions smoke-test/tests/privileges/test_privileges.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,8 @@ def test_privilege_to_create_and_manage_ingestion_source():
)


@pytest.mark.skip(reason="Functionality and test needs to be validated for correctness")
@pytest.mark.dependency(depends=["test_healthchecks"])
def test_privilege_to_create_and_manage_access_tokens():
def test_privilege_to_create_and_revoke_personal_access_tokens():
(admin_user, admin_pass) = get_admin_credentials()
admin_session = login_as(admin_user, admin_pass)
user_session = login_as("user", "user")
Expand All @@ -345,13 +344,15 @@ def test_privilege_to_create_and_manage_access_tokens():

# Assign privileges to the new user to create and manage access tokens
policy_urn = create_user_policy(
"urn:li:corpuser:user", ["MANAGE_ACCESS_TOKENS"], admin_session
"urn:li:corpuser:user", ["GENERATE_PERSONAL_ACCESS_TOKENS"], admin_session
)

# Verify new user can create and manage access token(create, revoke)
# Create a access token
_ensure_can_create_access_token(user_session, create_access_token)

wait_for_writes_to_sync()

# List access tokens first to get token id
list_access_tokens = {
"query": """query listAccessTokens($input: ListAccessTokenInput!) {\n
Expand Down
Loading