From 75d64f17f002c0fa8eef3b74aaf81fc259110900 Mon Sep 17 00:00:00 2001 From: dorsha Date: Fri, 19 Dec 2025 22:01:48 +0200 Subject: [PATCH 1/2] Allow pass expired status --- .vscode/settings.json | 6 +++++- descope/management/authz.py | 2 +- descope/management/user.py | 18 ++++++++++++------ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 4e5b872c6..3b3f68c4a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,9 @@ "mypy-type-checker.importStrategy": "fromEnvironment", "isort.importStrategy": "fromEnvironment", "black-formatter.importStrategy": "fromEnvironment", - "workbench.colorCustomizations": { /* do not change please... */} + "workbench.colorCustomizations": { + "activityBar.background": "#121D85", + "titleBar.activeBackground": "#1A28BA", + "titleBar.activeForeground": "#F9FAFE" + } } \ No newline at end of file diff --git a/descope/management/authz.py b/descope/management/authz.py index 6f45d267a..e314a18a1 100644 --- a/descope/management/authz.py +++ b/descope/management/authz.py @@ -181,7 +181,7 @@ def create_relations( "tenants": ["t1", "t2"], "roles": ["r1", "r2"], "text": "full-text-search", - "statuses": ["enabled|disabled|invited"], + "statuses": ["enabled|disabled|invited|expired"], "ssoOnly": True|False, "withTestUser": True|False, "customAttributes": { diff --git a/descope/management/user.py b/descope/management/user.py index a49179a5b..a47e86c2e 100644 --- a/descope/management/user.py +++ b/descope/management/user.py @@ -438,7 +438,7 @@ def patch( picture (str): Optional url for user picture custom_attributes (dict): Optional, set the different custom attributes values of the keys that were previously configured in Descope console app sso_app_ids (List[str]): Optional, list of SSO applications IDs to be associated with the user. - status (str): Optional status field. Can be one of: "enabled", "disabled", "invited". + status (str): Optional status field. Can be one of: "enabled", "disabled", "invited", "expired". test (bool, optional): Set to True to update a test user. Defaults to False. Return value (dict): @@ -449,11 +449,16 @@ def patch( Raise: AuthException: raised if patch operation fails """ - if status is not None and status not in ["enabled", "disabled", "invited"]: + if status is not None and status not in [ + "enabled", + "disabled", + "invited", + "expired", + ]: raise AuthException( 400, ERROR_TYPE_INVALID_ARGUMENT, - f"Invalid status value: {status}. Must be one of: enabled, disabled, invited", + f"Invalid status value: {status}. Must be one of: enabled, disabled, invited, expired", ) response = self._http.patch( MgmtV1.user_patch_path, @@ -506,11 +511,12 @@ def patch_batch( "enabled", "disabled", "invited", + "expired", ]: raise AuthException( 400, ERROR_TYPE_INVALID_ARGUMENT, - f"Invalid status value: {user.status} for user {user.login_id}. Must be one of: enabled, disabled, invited", + f"Invalid status value: {user.status} for user {user.login_id}. Must be one of: enabled, disabled, invited, expired", ) response = self._http.patch( @@ -728,7 +734,7 @@ def search_all( test_users_only (bool): Optional filter only test users. with_test_user (bool): Optional include test users in search. custom_attributes (dict): Optional search for a attribute with a given value - statuses (List[str]): Optional list of statuses to search for ("enabled", "disabled", "invited") + statuses (List[str]): Optional list of statuses to search for ("enabled", "disabled", "invited", "expired") emails (List[str]): Optional list of emails to search for phones (List[str]): Optional list of phones to search for sso_app_ids (List[str]): Optional list of SSO application IDs to filter by @@ -850,7 +856,7 @@ def search_all_test_users( limit (int): Optional limit of the number of users returned. Leave empty for default. page (int): Optional pagination control. Pages start at 0 and must be non-negative. custom_attributes (dict): Optional search for a attribute with a given value - statuses (List[str]): Optional list of statuses to search for ("enabled", "disabled", "invited") + statuses (List[str]): Optional list of statuses to search for ("enabled", "disabled", "invited", "expired") emails (List[str]): Optional list of emails to search for phones (List[str]): Optional list of phones to search for sso_app_ids (List[str]): Optional list of SSO application IDs to filter by From 4c9b8a757b500da7e0dd3273d70dc02e9f20a9af Mon Sep 17 00:00:00 2001 From: dorsha Date: Fri, 19 Dec 2025 22:05:46 +0200 Subject: [PATCH 2/2] Allow pass expired status --- .vscode/settings.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 3b3f68c4a..4e5b872c6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,9 +7,5 @@ "mypy-type-checker.importStrategy": "fromEnvironment", "isort.importStrategy": "fromEnvironment", "black-formatter.importStrategy": "fromEnvironment", - "workbench.colorCustomizations": { - "activityBar.background": "#121D85", - "titleBar.activeBackground": "#1A28BA", - "titleBar.activeForeground": "#F9FAFE" - } + "workbench.colorCustomizations": { /* do not change please... */} } \ No newline at end of file