Skip to content

Commit

Permalink
Fix user_info test
Browse files Browse the repository at this point in the history
  • Loading branch information
pehala committed Oct 26, 2022
1 parent 11f3af7 commit be8568b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions testsuite/tests/kuadrant/authorino/metadata/test_user_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def authorization(authorization, rhsso):
Adds auth metadata OIDC UserInfo which fetches OIDC UserInfo in request-time.
Adds a simple rule that accepts only when fetched UserInfo contains the email address of the default RHSSO user.
"""
user = rhsso.client.admin.get_user(rhsso.user)
authorization.add_user_info_metadata("user-info", "rhsso")
authorization.add_auth_rule("rule", Rule("auth.metadata.user-info.email", "eq", user["email"]))
authorization.add_auth_rule("rule",
Rule("auth.metadata.user-info.email", "eq", rhsso.user.properties["email"]))
return authorization


Expand All @@ -27,6 +27,6 @@ def test_correct_auth(client, auth):

def test_incorrect_auth(client, auth, rhsso):
"""Updates RHSSO user email address and tests incorrect auth"""
rhsso.client.admin.update_user(rhsso.user, {"email": "[email protected]"})
rhsso.user.update_user(email="[email protected]")
response = client.get("get", auth=auth)
assert response.status_code == 403

0 comments on commit be8568b

Please sign in to comment.