Skip to content

Commit

Permalink
fix: return correct location URL for /Users SCIM API endpoint (#1115)
Browse files Browse the repository at this point in the history
[e2e_tests changes only]
  • Loading branch information
amandavialva01 authored and rb-determined-ai committed Nov 2, 2023
1 parent 02660f1 commit 8a9a681
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions e2e_tests/tests/test_scim.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ def test_create_scim_user() -> None:

user_resp = r.json()

user_id = user_resp["id"]
user_loc = make_scim_url(f"/Users/{user_id}")

assert user_resp.get("userName") == username
assert user_resp.get("active")

user_id = user_resp["id"]
assert user_resp["meta"]["location"] == user_loc

patch_req = {
"schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
Expand Down Expand Up @@ -69,6 +71,16 @@ def test_create_scim_user() -> None:
assert search_resp["startIndex"] == 1
assert len(search_resp["Resources"]) == 1
assert search_resp["Resources"][0]["userName"] == username
assert search_resp["Resources"][0]["meta"]["location"] == user_loc

indiv_user = requests.get(
make_scim_url(f"/Users/{user_id}"), auth=(conf.SCIM_USERNAME, conf.SCIM_PASSWORD)
)
indiv_user.raise_for_status()
indiv_user_resp = indiv_user.json()

assert indiv_user_resp.get("id") == user_id
assert indiv_user_resp["meta"]["location"] == user_loc


@pytest.mark.e2e_cpu
Expand Down Expand Up @@ -174,13 +186,15 @@ def test_okta_create_user() -> None:
resp = r.json()

user_id = resp["id"]
user_loc = make_scim_url(f"/Users/{user_id}")

assert resp["active"] is True
assert len(user_id) > 0
assert resp["name"]["familyName"] == family_name
assert resp["name"]["givenName"] == given_name
assert resp["userName"] == username
assert "urn:ietf:params:scim:schemas:core:2.0:User" in resp["schemas"]
assert resp["meta"]["location"] == user_loc

r = requests.get(
make_scim_url(f"/Users/{user_id}"),
Expand All @@ -194,6 +208,7 @@ def test_okta_create_user() -> None:
assert resp["name"]["familyName"] == family_name
assert resp["name"]["givenName"] == given_name
assert resp["userName"] == username
assert resp["meta"]["location"] == user_loc

patch_req = {
"schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
Expand Down

0 comments on commit 8a9a681

Please sign in to comment.