Skip to content

Commit

Permalink
Add user management APIs (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
shilgapira authored Jan 16, 2023
1 parent bc502d7 commit 89a6c4e
Show file tree
Hide file tree
Showing 4 changed files with 766 additions and 64 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,18 @@ descope_client.mgmt.user.update(
],
)

# Update explicit data for a user rather than overriding all fields
descope_client.mgmt.user.update_phone(
login_id="[email protected]",
phone="+18005551234",
verified=True,
)
descope_client.mgmt.user.remove_tenant_roles(
login_id="[email protected]",
tenant_id="my-tenant-id",
role_names=["role-name1"],
)

# User deletion cannot be undone. Use carefully.
descope_client.mgmt.user.delete("[email protected]")

Expand Down
8 changes: 8 additions & 0 deletions descope/management/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ class MgmtV1:
userDeletePath = "/v1/mgmt/user/delete"
userLoadPath = "/v1/mgmt/user"
usersSearchPath = "/v1/mgmt/user/search"
userUpdateStatusPath = "/v1/mgmt/user/update/status"
userUpdateEmailPath = "/v1/mgmt/user/update/email"
userUpdatePhonePath = "/v1/mgmt/user/update/phone"
userUpdateNamePath = "/v1/mgmt/user/update/name"
userAddRolePath = "/v1/mgmt/user/update/role/add"
userRemoveRolePath = "/v1/mgmt/user/update/role/remove"
userAddTenantPath = "/v1/mgmt/user/update/tenant/add"
userRemoveTenantPath = "/v1/mgmt/user/update/tenant/remove"

# access key
accessKeyCreatePath = "/v1/mgmt/accesskey/create"
Expand Down
Loading

0 comments on commit 89a6c4e

Please sign in to comment.