@@ -90,7 +90,7 @@ def test_load_settings(self):
90
90
network_resp = mock .Mock ()
91
91
network_resp .ok = True
92
92
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": ""}}"""
94
94
)
95
95
mock_get .return_value = network_resp
96
96
resp = client .mgmt .sso .load_settings ("T2AAAA" )
@@ -101,6 +101,10 @@ def test_load_settings(self):
101
101
self .assertEqual (
102
102
saml_settings .get ("idpMetadataUrl" , "" ), "https://dummy.com/metadata"
103
103
)
104
+ self .assertEqual (
105
+ saml_settings .get ("defaultSSORoles" , "" ),
106
+ ["aa" , "bb" ],
107
+ )
104
108
mock_get .assert_called_with (
105
109
f"{ common .DEFAULT_BASE_URL } { MgmtV1 .sso_load_settings_path } " ,
106
110
headers = {
@@ -233,6 +237,7 @@ def test_configure_saml_settings(self):
233
237
idp_cert = "cert" ,
234
238
sp_acs_url = "http://spacsurl.com" ,
235
239
sp_entity_id = "spentityid" ,
240
+ default_sso_roles = ["aa" , "bb" ],
236
241
),
237
242
"https://redirect.com" ,
238
243
["domain.com" ],
@@ -261,6 +266,7 @@ def test_configure_saml_settings(self):
261
266
role_mappings = [RoleMapping (groups = ["grp1" ], role_name = "rl1" )],
262
267
sp_acs_url = "http://spacsurl.com" ,
263
268
sp_entity_id = "spentityid" ,
269
+ default_sso_roles = ["aa" , "bb" ],
264
270
),
265
271
"https://redirect.com" ,
266
272
["domain.com" ],
@@ -293,6 +299,7 @@ def test_configure_saml_settings(self):
293
299
"roleMappings" : [{"groups" : ["grp1" ], "roleName" : "rl1" }],
294
300
"spACSUrl" : "http://spacsurl.com" ,
295
301
"spEntityId" : "spentityid" ,
302
+ "defaultSSORoles" : ["aa" , "bb" ],
296
303
},
297
304
"redirectUrl" : "https://redirect.com" ,
298
305
"domains" : ["domain.com" ],
@@ -343,6 +350,7 @@ def test_configure_saml_settings_by_metadata(self):
343
350
role_mappings = [RoleMapping (groups = ["grp1" ], role_name = "rl1" )],
344
351
sp_acs_url = "http://spacsurl.com" ,
345
352
sp_entity_id = "spentityid" ,
353
+ default_sso_roles = ["aa" , "bb" ],
346
354
),
347
355
"https://redirect.com" ,
348
356
["domain.com" ],
@@ -373,6 +381,7 @@ def test_configure_saml_settings_by_metadata(self):
373
381
"roleMappings" : [{"groups" : ["grp1" ], "roleName" : "rl1" }],
374
382
"spACSUrl" : "http://spacsurl.com" ,
375
383
"spEntityId" : "spentityid" ,
384
+ "defaultSSORoles" : ["aa" , "bb" ],
376
385
},
377
386
"redirectUrl" : "https://redirect.com" ,
378
387
"domains" : ["domain.com" ],
0 commit comments