@@ -90,7 +90,7 @@ def test_load_settings(self):
9090 network_resp = mock .Mock ()
9191 network_resp .ok = True
9292 network_resp .json .return_value = json .loads (
93- """{"tenant": {"id": "T2AAAA", "name": "myTenantName", "selfProvisioningDomains": [], "customAttributes": {}, "authType": "saml", "domains": ["lulu", "kuku"]}, "saml": {"idpEntityId": "", "idpSSOUrl": "", "idpCertificate": "", "idpMetadataUrl": "https://dummy.com/metadata", "spEntityId": "", "spACSUrl": "", "spCertificate": "", "attributeMapping": {"name": "name", "email": "email", "username": "", "phoneNumber": "phone", "group": "", "givenName": "", "middleName": "", "familyName": "", "picture": "", "customAttributes": {}}, "groupsMapping": [], "redirectUrl": ""}, "oidc": {"name": "", "clientId": "", "clientSecret": "", "redirectUrl": "", "authUrl": "", "tokenUrl": "", "userDataUrl": "", "scope": [], "JWKsUrl": "", "userAttrMapping": {"loginId": "sub", "username": "", "name": "name", "email": "email", "phoneNumber": "phone_number", "verifiedEmail": "email_verified", "verifiedPhone": "phone_number_verified", "picture": "picture", "givenName": "given_name", "middleName": "middle_name", "familyName": "family_name"}, "manageProviderTokens": false, "callbackDomain": "", "prompt": [], "grantType": "authorization_code", "issuer": ""}}"""
93+ """{"tenant": {"id": "T2AAAA", "name": "myTenantName", "selfProvisioningDomains": [], "customAttributes": {}, "authType": "saml", "domains": ["lulu", "kuku"]}, "saml": {"idpEntityId": "", "idpSSOUrl": "", "idpCertificate": "", "defaultSSORoles": ["aa", "bb"], "idpMetadataUrl": "https://dummy.com/metadata", "spEntityId": "", "spACSUrl": "", "spCertificate": "", "attributeMapping": {"name": "name", "email": "email", "username": "", "phoneNumber": "phone", "group": "", "givenName": "", "middleName": "", "familyName": "", "picture": "", "customAttributes": {}}, "groupsMapping": [], "redirectUrl": ""}, "oidc": {"name": "", "clientId": "", "clientSecret": "", "redirectUrl": "", "authUrl": "", "tokenUrl": "", "userDataUrl": "", "scope": [], "JWKsUrl": "", "userAttrMapping": {"loginId": "sub", "username": "", "name": "name", "email": "email", "phoneNumber": "phone_number", "verifiedEmail": "email_verified", "verifiedPhone": "phone_number_verified", "picture": "picture", "givenName": "given_name", "middleName": "middle_name", "familyName": "family_name"}, "manageProviderTokens": false, "callbackDomain": "", "prompt": [], "grantType": "authorization_code", "issuer": ""}}"""
9494 )
9595 mock_get .return_value = network_resp
9696 resp = client .mgmt .sso .load_settings ("T2AAAA" )
@@ -101,6 +101,10 @@ def test_load_settings(self):
101101 self .assertEqual (
102102 saml_settings .get ("idpMetadataUrl" , "" ), "https://dummy.com/metadata"
103103 )
104+ self .assertEqual (
105+ saml_settings .get ("defaultSSORoles" , "" ),
106+ ["aa" , "bb" ],
107+ )
104108 mock_get .assert_called_with (
105109 f"{ common .DEFAULT_BASE_URL } { MgmtV1 .sso_load_settings_path } " ,
106110 headers = {
@@ -233,6 +237,7 @@ def test_configure_saml_settings(self):
233237 idp_cert = "cert" ,
234238 sp_acs_url = "http://spacsurl.com" ,
235239 sp_entity_id = "spentityid" ,
240+ default_sso_roles = ["aa" , "bb" ],
236241 ),
237242 "https://redirect.com" ,
238243 ["domain.com" ],
@@ -261,6 +266,7 @@ def test_configure_saml_settings(self):
261266 role_mappings = [RoleMapping (groups = ["grp1" ], role_name = "rl1" )],
262267 sp_acs_url = "http://spacsurl.com" ,
263268 sp_entity_id = "spentityid" ,
269+ default_sso_roles = ["aa" , "bb" ],
264270 ),
265271 "https://redirect.com" ,
266272 ["domain.com" ],
@@ -293,6 +299,7 @@ def test_configure_saml_settings(self):
293299 "roleMappings" : [{"groups" : ["grp1" ], "roleName" : "rl1" }],
294300 "spACSUrl" : "http://spacsurl.com" ,
295301 "spEntityId" : "spentityid" ,
302+ "defaultSSORoles" : ["aa" , "bb" ],
296303 },
297304 "redirectUrl" : "https://redirect.com" ,
298305 "domains" : ["domain.com" ],
@@ -343,6 +350,7 @@ def test_configure_saml_settings_by_metadata(self):
343350 role_mappings = [RoleMapping (groups = ["grp1" ], role_name = "rl1" )],
344351 sp_acs_url = "http://spacsurl.com" ,
345352 sp_entity_id = "spentityid" ,
353+ default_sso_roles = ["aa" , "bb" ],
346354 ),
347355 "https://redirect.com" ,
348356 ["domain.com" ],
@@ -373,6 +381,7 @@ def test_configure_saml_settings_by_metadata(self):
373381 "roleMappings" : [{"groups" : ["grp1" ], "roleName" : "rl1" }],
374382 "spACSUrl" : "http://spacsurl.com" ,
375383 "spEntityId" : "spentityid" ,
384+ "defaultSSORoles" : ["aa" , "bb" ],
376385 },
377386 "redirectUrl" : "https://redirect.com" ,
378387 "domains" : ["domain.com" ],
0 commit comments