@@ -121,32 +121,66 @@ def test_is_cloud_domain(self, domain, expected):
121121 assert _is_cloud_domain (domain ) == expected
122122
123123 @pytest .mark .parametrize (
124- "domain,mock_version ,expected_config" ,
124+ "domain,mock_info ,expected_config" ,
125125 [
126- # Cloud domains should always use auth_config_cloud.json
126+ # Cloud domains always use auth_config_cloud.json (no API call needed)
127127 ("https://alpha.uipath.com" , None , "auth_config_cloud.json" ),
128128 ("https://staging.uipath.com" , None , "auth_config_cloud.json" ),
129129 ("https://cloud.uipath.com" , None , "auth_config_cloud.json" ),
130- # Version 25.10.* should use auth_config_25_10 .json
130+ # Non-ServiceFabric deployments (cloud releases) use auth_config_cloud .json
131131 (
132132 "https://custom.domain.com" ,
133- "25.10.0-beta.415" ,
134- "auth_config_25_10.json" ,
133+ {"version" : "26.3.0-s188.574" , "deployment" : None },
134+ "auth_config_cloud.json" ,
135+ ),
136+ (
137+ "https://custom.domain.com" ,
138+ {"version" : "25.10.0-s99" , "deployment" : "Kubernetes" },
139+ "auth_config_cloud.json" ,
135140 ),
136- ("https://custom.domain.com" , "25.10.1" , "auth_config_25_10.json" ),
137- # Other versions should fallback to cloud config
138- ("https://custom.domain.com" , "24.10.0" , "auth_config_cloud.json" ),
139- ("https://custom.domain.com" , "26.1.0" , "auth_config_cloud.json" ),
140- # Unable to determine version should fallback to cloud config
141+ # API unreachable uses auth_config_cloud.json
141142 ("https://custom.domain.com" , None , "auth_config_cloud.json" ),
143+ # ServiceFabric + 25.10.* (AS release 25.10) uses auth_config_25_10.json
144+ (
145+ "https://custom.domain.com" ,
146+ {"version" : "25.10.0-beta.415" , "deployment" : "ServiceFabric" },
147+ "auth_config_25_10.json" ,
148+ ),
149+ (
150+ "https://custom.domain.com" ,
151+ {"version" : "25.10.1" , "deployment" : "ServiceFabric" },
152+ "auth_config_25_10.json" ,
153+ ),
154+ # ServiceFabric + 26.3.* (AS release 25.10.2) uses auth_config_25_10_2.json
155+ (
156+ "https://custom.domain.com" ,
157+ {"version" : "26.3.0-beta.188" , "deployment" : "ServiceFabric" },
158+ "auth_config_25_10_2.json" ,
159+ ),
160+ (
161+ "https://custom.domain.com" ,
162+ {"version" : "26.3.1" , "deployment" : "ServiceFabric" },
163+ "auth_config_25_10_2.json" ,
164+ ),
165+ # ServiceFabric + unknown version falls back to latest AS config
166+ (
167+ "https://custom.domain.com" ,
168+ {"version" : "24.10.0" , "deployment" : "ServiceFabric" },
169+ "auth_config_25_10_2.json" ,
170+ ),
171+ (
172+ "https://custom.domain.com" ,
173+ {"version" : "26.1.0" , "deployment" : "ServiceFabric" },
174+ "auth_config_25_10_2.json" ,
175+ ),
142176 ],
143177 )
144- async def test_select_config_file (self , domain , mock_version , expected_config ):
145- """Test _select_config_file selects the correct config based on domain and version ."""
178+ async def test_select_config_file (self , domain , mock_info , expected_config ):
179+ """Test _select_config_file selects the correct config based on domain and server info ."""
146180 with patch (
147- "uipath._cli._auth._oidc_utils.get_server_version_async " ,
181+ "uipath._cli._auth._oidc_utils.get_server_info_async " ,
148182 new_callable = AsyncMock ,
149- return_value = mock_version ,
183+ return_value = mock_info ,
150184 ):
151185 config_file = await _select_config_file (domain )
152186 assert config_file == expected_config
@@ -170,12 +204,15 @@ async def test_get_auth_config_with_cloud_domain(self):
170204 assert config ["port" ] == 8104
171205
172206 async def test_get_auth_config_with_25_10_version (self ):
173- """Test get_auth_config with version 25.10 uses auth_config_25_10.json."""
207+ """Test get_auth_config with AS 25.10 ServiceFabric deployment uses auth_config_25_10.json."""
174208 with (
175209 patch (
176- "uipath._cli._auth._oidc_utils.get_server_version_async " ,
210+ "uipath._cli._auth._oidc_utils.get_server_info_async " ,
177211 new_callable = AsyncMock ,
178- return_value = "25.10.0-beta.415" ,
212+ return_value = {
213+ "version" : "25.10.0-beta.415" ,
214+ "deployment" : "ServiceFabric" ,
215+ },
179216 ),
180217 patch (
181218 "uipath._cli._auth._oidc_utils.OidcUtils._find_free_port" ,
0 commit comments