-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
data/saas/config/auth0_config.yml
Outdated
|
||
test_request: | ||
method: GET | ||
path: /api/v2/[email protected] |
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.
Although this would work, we should define the query parameters using the query_params
property.
path: /api/v2/users-by-email
query_params:
- name: email
value: [email protected]
yield user | ||
|
||
# Deleting user after verifying update request | ||
headers = { |
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.
No need to redefine the headers since we've already defined them on line 125.
} | ||
headers = {"Authorization": f"Bearer {auth0_secrets['access_token']}"} | ||
users_response = requests.post( | ||
url=f"{base_url}/dbconnections/signup", json=body, headers=headers |
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.
Why are we using this /dbconnections
endpoint instead of something like /api/v2/users?
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.
Both endpoints can be used to create user but I have updated code to use /api/v2/users
} | ||
|
||
user_delete_response = requests.delete( | ||
url=f"{base_url}/api/v2/users/auth0|{auth0_erasure_identity_email}", |
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.
Is this delete URL correct? It looks like there might be a typo because of the |
character.
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.
This worked fine as we needed to add /api/v2/users/<auth|id> but I have updated code not to contain '|' character in url.
url=f"{base_url}/dbconnections/signup", json=body, headers=headers | ||
) | ||
user = users_response.json() | ||
assert 200 == users_response.status_code |
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 should use assert users_response.ok
or the HTTP_200_OK
constant from starlette.status
.
error_message = ( | ||
f"User with email {auth0_erasure_identity_email} could not be added to auth0" | ||
) | ||
poll_for_existence( |
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.
Does the user actually take some time to show up on the Auth0?
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.
It usually doesn't take more than 1 seconds, I still added poll_for_existence just to make sure user is created and available.
"""Full erasure request based on the auth0 SaaS config""" | ||
|
||
privacy_request = PrivacyRequest( | ||
id=f"test_saas_erasure_request_task_{random.randint(0, 1000)}" |
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.
Let's change the id to test_auth0_erasure_request_task
so we can uniquely identify it.
) -> None: | ||
"""Full access request based on the Auth0 SaaS config""" | ||
privacy_request = PrivacyRequest( | ||
id=f"test_saas_access_request_task_{random.randint(0, 1000)}" |
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.
Let's change the id to test_auth0_access_request_task
so we can uniquely identify it.
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.
Good first round, I just have some questions around a few things before I can approve. It also looks like the
user_logs
endpoint isn't returning any data at the moment.
user_logs
are deleted after some days which is why it returns empty. We can verify it by changing password of identity user, then we will get user logs.
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.
Good first round, I just have some questions around a few things before I can approve. It also looks like the user_logs
endpoint isn't returning any data at the moment.
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.
Thanks for making the requested changes, this looks good to go!
Purpose
Changes
Note
https://manage.auth0.com/dashboard/us/fidesops-test/apis/management/explorer
Then this token needs to be set for api using this link to get required grants:
https://auth0.com/docs/api/management/v2
Checklist
CHANGELOG.md
fileCHANGELOG.md
file is being appended toUnreleased
section in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.Run Unsafe PR Checks
label has been applied, and checks have passed, if this PR touches any external servicesTicket
Fixes #796