@@ -11,6 +11,8 @@ def create(
1111 id : Optional [str ] = None ,
1212 self_provisioning_domains : Optional [List [str ]] = None ,
1313 custom_attributes : Optional [dict ] = None ,
14+ enforce_sso : Optional [bool ] = False ,
15+ disabled : Optional [bool ] = False ,
1416 ) -> dict :
1517 """
1618 Create a new tenant with the given name. Tenant IDs are provisioned automatically, but can be provided
@@ -22,6 +24,8 @@ def create(
2224 self_provisioning_domains (List[str]): An optional list of domain that are associated with this tenant.
2325 Users authenticating from these domains will be associated with this tenant.
2426 custom_attributes (dict): Optional, set the different custom attributes values of the keys that were previously configured in Descope console app
27+ enforce_sso (bool): Optional, login to the tenant is possible only using the configured sso
28+ disabled (bool): Optional, login to the tenant will be disabled
2529
2630 Return value (dict):
2731 Return dict in the format
@@ -38,7 +42,7 @@ def create(
3842 response = self ._auth .do_post (
3943 uri ,
4044 Tenant ._compose_create_update_body (
41- name , id , self_provisioning_domains , custom_attributes
45+ name , id , self_provisioning_domains , custom_attributes , enforce_sso , disabled
4246 ),
4347 pswd = self ._auth .management_key ,
4448 )
@@ -50,6 +54,8 @@ def update(
5054 name : str ,
5155 self_provisioning_domains : Optional [List [str ]] = None ,
5256 custom_attributes : Optional [dict ] = None ,
57+ enforce_sso : Optional [bool ] = False ,
58+ disabled : Optional [bool ] = False ,
5359 ):
5460 """
5561 Update an existing tenant with the given name and domains. IMPORTANT: All parameters are used as overrides
@@ -61,6 +67,8 @@ def update(
6167 self_provisioning_domains (List[str]): An optional list of domain that are associated with this tenant.
6268 Users authenticating from these domains will be associated with this tenant.
6369 custom_attributes (dict): Optional, set the different custom attributes values of the keys that were previously configured in Descope console app
70+ enforce_sso (bool): Optional, login to the tenant is possible only using the configured sso
71+ disabled (bool): Optional, login to the tenant will be disabled
6472
6573 Raise:
6674 AuthException: raised if creation operation fails
@@ -73,7 +81,7 @@ def update(
7381 self ._auth .do_post (
7482 uri ,
7583 Tenant ._compose_create_update_body (
76- name , id , self_provisioning_domains , custom_attributes
84+ name , id , self_provisioning_domains , custom_attributes , enforce_sso , disabled
7785 ),
7886 pswd = self ._auth .management_key ,
7987 )
@@ -184,11 +192,15 @@ def _compose_create_update_body(
184192 id : Optional [str ],
185193 self_provisioning_domains : List [str ],
186194 custom_attributes : Optional [dict ] = None ,
195+ enforce_sso : Optional [bool ] = False ,
196+ disabled : Optional [bool ] = False ,
187197 ) -> dict :
188198 body : dict [str , Any ] = {
189199 "name" : name ,
190200 "id" : id ,
191201 "selfProvisioningDomains" : self_provisioning_domains ,
202+ "enforceSSO" : enforce_sso ,
203+ "disabled" : disabled
192204 }
193205 if custom_attributes is not None :
194206 body ["customAttributes" ] = custom_attributes
0 commit comments