Skip to content

Commit

Permalink
Merge users branch Into main (#213)
Browse files Browse the repository at this point in the history
* Add `Users` client and `Users.create_user()` method (#191)

* Add Users client and Users.create_user() method

* Fix comment and format.

* Get user. (#192)

* Add `Users.list_users()` (#193)

* Add `Users.list_users()`

* Do not use f-string

* Fix comment

* Fix format

* Remove User type, and other fields

* Add add_user_to_organization and remove_user_to_organization methods (#195)

* Add `Users.authenticate_with_magic_auth()` (#196)

* Add authenticate_with_magic_auth

* Update comment

* Add `Users.authenticate_with_password()` (#197)

* Add `Users.authenticate_with_password()`

* Fix method

* Update comment

* Update test

* Add `Users.authenticate_with_code()` (#198)

* Add `Users.authenticate_with_token()` method

* Rename method

* Fix test

* Add `Users.create_password_challenge()` method (#199)

* Add `Users.complete_password_reset()` method (#200)

* Add `Users.send_verification_email()` method (#201)

* Add `Users.send_verification_email()` method

* Fix Magic Auth challenge

* Fix test

* Add `Users.verify_email()` method (#202)

* Add `Users.send_magic_auth_code()` method (#203)

* Add `Users.send_magic_auth_code()` method

* Fix test

* Fix test 2

* Return `User` instead of `MagicAuthChallenge` response (#204)

* Magic Auth and Email Verification response returns User Response instead of MagicAuthChallenge Response

* Replace other magic_auth_challenge_id references

* Add users.delete_user() method (#205)

* Fix authenticate methods (#206)

* Add `users.update_user_password()` method (#207)

* Add `users.update_user()` method (#208)

* Fix Verify Email Code method (#209)

---------

Co-authored-by: Jônatas Santos <jonatascastro12@gmail.com>
  • Loading branch information
blairworkos and jonatascastro12 authored Nov 14, 2023
1 parent 2667837 commit aa1c222
Show file tree
Hide file tree
Showing 10 changed files with 1,115 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def setup(self):
client._passwordless = None
client._portal = None
client._sso = None
client._users = None

def test_initialize_sso(self, set_api_key_and_client_id):
assert bool(client.sso)
Expand All @@ -36,6 +37,9 @@ def test_initialize_passwordless(self, set_api_key):
def test_initialize_portal(self, set_api_key):
assert bool(client.portal)

def test_initialize_users(self, set_api_key, set_client_id):
assert bool(client.users)

def test_initialize_sso_missing_api_key(self, set_client_id):
with pytest.raises(ConfigurationException) as ex:
client.sso
Expand Down Expand Up @@ -107,3 +111,28 @@ def test_initialize_portal_missing_api_key(self):
message = str(ex)

assert "api_key" in message

def test_initialize_users_missing_client_id(self, set_api_key):
with pytest.raises(ConfigurationException) as ex:
client.users

message = str(ex)

assert "client_id" in message

def test_initialize_users_missing_api_key(self, set_client_id):
with pytest.raises(ConfigurationException) as ex:
client.users

message = str(ex)

assert "api_key" in message

def test_initialize_users_missing_api_key_and_client_id(self):
with pytest.raises(ConfigurationException) as ex:
client.users

message = str(ex)

assert "api_key" in message
assert "client_id" in message
Loading

0 comments on commit aa1c222

Please sign in to comment.