Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src/keycloak/admin/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'first_name',
'last_name',
'email_verified',
'required_actions',
'attributes',
'realm_roles',
'client_roles',
Expand Down Expand Up @@ -42,6 +43,7 @@ def create(self, username, **kwargs):
:param str last_name: (optional)
:param str email: (optional)
:param boolean enabled: (optional)
:param list[str] required_actions: (optional)
"""
payload = OrderedDict(username=username)

Expand Down Expand Up @@ -133,6 +135,7 @@ def update(self, **kwargs):
:param str last_name: last_name for user
:param str email: Email for user
:param bool email_verified: User email verified
:param list[str] required_actions: Sets required actions
:param Map attributes: Atributes in user
:param string array realm_roles: Realm Roles
:param Map client_roles: Client Roles
Expand Down
10 changes: 7 additions & 3 deletions tests/keycloak/admin/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def test_create(self):
first_name='my-first-name',
last_name='my-last-name',
email='my-email',
enabled=True
enabled=True,
required_actions=['action']
)
self.realm.client.get_full_url.assert_called_once_with(
'/auth/admin/realms/realm-name/users'
Expand All @@ -37,6 +38,7 @@ def test_create(self):
'"enabled": true, '
'"firstName": "my-first-name", '
'"lastName": "my-last-name", '
'"requiredActions": ["action"], '
'"username": "my-username"'
'}',
headers={
Expand Down Expand Up @@ -92,7 +94,8 @@ def test_update(self):
first_name='my-first-name',
last_name='my-last-name',
email='my-email',
enabled=True
enabled=True,
required_actions=['action']
)
self.realm.client.get_full_url.assert_called_with(
'/auth/admin/realms/realm-name/users/user-id'
Expand All @@ -109,7 +112,8 @@ def test_update(self):
'"enabled": true, '
'"firstName": "my-first-name", '
'"id": "user-id", '
'"lastName": "my-last-name"'
'"lastName": "my-last-name", '
'"requiredActions": ["action"]'
'}',
headers={
'Authorization': 'Bearer some-token',
Expand Down