uipath 2.1.62__py3-none-any.whl → 2.1.63__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,11 @@ from urllib.parse import urlparse
9
9
  from uipath._cli._auth._auth_server import HTTPServer
10
10
  from uipath._cli._auth._client_credentials import ClientCredentialsService
11
11
  from uipath._cli._auth._oidc_utils import OidcUtils
12
- from uipath._cli._auth._portal_service import PortalService, select_tenant
12
+ from uipath._cli._auth._portal_service import (
13
+ PortalService,
14
+ get_tenant_id,
15
+ select_tenant,
16
+ )
13
17
  from uipath._cli._auth._url_utils import set_force_flag
14
18
  from uipath._cli._auth._utils import update_auth_file, update_env_file
15
19
  from uipath._cli._utils._console import ConsoleLogger
@@ -24,6 +28,7 @@ class AuthService:
24
28
  client_id: Optional[str],
25
29
  client_secret: Optional[str],
26
30
  base_url: Optional[str],
31
+ tenant: Optional[str],
27
32
  scope: Optional[str],
28
33
  ):
29
34
  self._force = force
@@ -32,6 +37,7 @@ class AuthService:
32
37
  self._client_id = client_id
33
38
  self._client_secret = client_secret
34
39
  self._base_url = base_url
40
+ self._tenant = tenant
35
41
  self._scope = scope
36
42
  set_force_flag(self._force)
37
43
 
@@ -108,7 +114,14 @@ class AuthService:
108
114
  update_env_file({"UIPATH_ACCESS_TOKEN": access_token})
109
115
 
110
116
  tenants_and_organizations = portal_service.get_tenants_and_organizations()
111
- base_url = select_tenant(self._domain, tenants_and_organizations)
117
+
118
+ if self._tenant:
119
+ base_url = get_tenant_id(
120
+ self._domain, self._tenant, tenants_and_organizations
121
+ )
122
+ else:
123
+ base_url = select_tenant(self._domain, tenants_and_organizations)
124
+
112
125
  try:
113
126
  portal_service.post_auth(base_url)
114
127
  except Exception:
@@ -231,3 +231,32 @@ def select_tenant(
231
231
  )
232
232
 
233
233
  return uipath_url
234
+
235
+
236
+ def get_tenant_id(
237
+ domain: str,
238
+ tenant_name: str,
239
+ tenants_and_organizations: TenantsAndOrganizationInfoResponse,
240
+ ) -> str:
241
+ tenants = tenants_and_organizations["tenants"]
242
+
243
+ matched_tenant = next((t for t in tenants if t["name"] == tenant_name), None)
244
+ if not matched_tenant:
245
+ console.error(f"Tenant '{tenant_name}' not found.")
246
+ raise ValueError(f"Tenant '{tenant_name}' not found.")
247
+
248
+ domain = get_base_url(domain)
249
+ account_name = tenants_and_organizations["organization"]["name"]
250
+
251
+ base_url = get_base_url(domain)
252
+ uipath_url = f"{base_url}/{account_name}/{tenant_name}"
253
+
254
+ update_env_file(
255
+ {
256
+ "UIPATH_URL": uipath_url,
257
+ "UIPATH_TENANT_ID": matched_tenant["id"],
258
+ "UIPATH_ORGANIZATION_ID": tenants_and_organizations["organization"]["id"],
259
+ }
260
+ )
261
+
262
+ return uipath_url
uipath/_cli/cli_auth.py CHANGED
@@ -35,6 +35,11 @@ console = ConsoleLogger()
35
35
  required=False,
36
36
  help="Base URL for the UiPath tenant instance (required for client credentials)",
37
37
  )
38
+ @click.option(
39
+ "--tenant",
40
+ required=False,
41
+ help="Tenant name within UiPath Automation Cloud",
42
+ )
38
43
  @click.option(
39
44
  "--scope",
40
45
  required=False,
@@ -48,6 +53,7 @@ def auth(
48
53
  client_id: Optional[str] = None,
49
54
  client_secret: Optional[str] = None,
50
55
  base_url: Optional[str] = None,
56
+ tenant: Optional[str] = None,
51
57
  scope: Optional[str] = None,
52
58
  ):
53
59
  """Authenticate with UiPath Cloud Platform.
@@ -69,6 +75,7 @@ def auth(
69
75
  client_id=client_id,
70
76
  client_secret=client_secret,
71
77
  base_url=base_url,
78
+ tenant=tenant,
72
79
  scope=scope,
73
80
  )
74
81
  with console.spinner("Authenticating with UiPath ..."):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.1.62
3
+ Version: 2.1.63
4
4
  Summary: Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools.
5
5
  Project-URL: Homepage, https://uipath.com
6
6
  Project-URL: Repository, https://github.com/UiPath/uipath-python
@@ -6,7 +6,7 @@ uipath/_uipath.py,sha256=p2ccvWpzBXAGFSSF_YaaSWdEqzMmRt786d0pFWrCEwU,4463
6
6
  uipath/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  uipath/_cli/README.md,sha256=GLtCfbeIKZKNnGTCsfSVqRQ27V1btT1i2bSAyW_xZl4,474
8
8
  uipath/_cli/__init__.py,sha256=tscKceSouYcEOxUbGjoyHi4qGi74giBFeXG1I-ut1hs,2308
9
- uipath/_cli/cli_auth.py,sha256=i3ykLlCg68xgPXHHaa0agHwGFIiLiTLzOiF6Su8XaEo,2436
9
+ uipath/_cli/cli_auth.py,sha256=ZEA0Fwoo77Ez9ctpRAIq7sbAwj8F4OouAbMp1g1OvjM,2601
10
10
  uipath/_cli/cli_deploy.py,sha256=KPCmQ0c_NYD5JofSDao5r6QYxHshVCRxlWDVnQvlp5w,645
11
11
  uipath/_cli/cli_dev.py,sha256=nEfpjw1PZ72O6jmufYWVrueVwihFxDPOeJakdvNHdOA,2146
12
12
  uipath/_cli/cli_eval.py,sha256=MERBnZE4R6OxIXllx9lcl4qqtuAhw7l-XY5u-jdXkN4,4796
@@ -21,11 +21,11 @@ uipath/_cli/cli_run.py,sha256=1FKv20EjxrrP1I5rNSnL_HzbWtOAIMjB3M--4RPA_Yo,3709
21
21
  uipath/_cli/middlewares.py,sha256=GvMhDnx1BmA7rIe12s6Uqv1JdqNZhvraU0a91oqGag4,4976
22
22
  uipath/_cli/spinner.py,sha256=bS-U_HA5yne11ejUERu7CQoXmWdabUD2bm62EfEdV8M,1107
23
23
  uipath/_cli/_auth/_auth_server.py,sha256=22km0F1NFNXgyLbvtAx3ssiQlVGHroLdtDCWEqiCiMg,7106
24
- uipath/_cli/_auth/_auth_service.py,sha256=tX8YuHlgUn2qUDQ_hrbabs7kMTD3K1u3EgqGYj92KRM,6106
24
+ uipath/_cli/_auth/_auth_service.py,sha256=Thtp2wXZQAHqossPPXuP6sAEe4Px9xThhZutMECRrdU,6386
25
25
  uipath/_cli/_auth/_client_credentials.py,sha256=VIyzgnGHSZxJXG8kSFIcCH0n2K2zep2SYcb5q1nBFcs,5408
26
26
  uipath/_cli/_auth/_models.py,sha256=sYMCfvmprIqnZxStlD_Dxx2bcxgn0Ri4D7uwemwkcNg,948
27
27
  uipath/_cli/_auth/_oidc_utils.py,sha256=j9VCXai_dM9PF1WtoWEsXETvrWUjuTgU-dCJ3oRudyg,2394
28
- uipath/_cli/_auth/_portal_service.py,sha256=MwsqEs505kMCiPCfjcelgflzvg1V3MqRNNVaOismaDc,8272
28
+ uipath/_cli/_auth/_portal_service.py,sha256=vP82BhjA2D6E6y2wDcXqO1cM4thhPl6DeGsnNXCBdhA,9144
29
29
  uipath/_cli/_auth/_url_utils.py,sha256=Vr-eYbwW_ltmwkULNEAbn6LNsMHnT4uT1n_1zlqD4Ss,1503
30
30
  uipath/_cli/_auth/_utils.py,sha256=9nb76xe5XmDZ0TAncp-_1SKqL6FdwRi9eS3C2noN1lY,1591
31
31
  uipath/_cli/_auth/auth_config.json,sha256=UnAhdum8phjuZaZKE5KLp0IcPCbIltDEU1M_G8gVbos,443
@@ -155,8 +155,8 @@ uipath/tracing/_traced.py,sha256=yBIY05PCCrYyx50EIHZnwJaKNdHPNx-YTR1sHQl0a98,199
155
155
  uipath/tracing/_utils.py,sha256=qd7N56tg6VXQ9pREh61esBgUWLNA0ssKsE0QlwrRWFM,11974
156
156
  uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
157
157
  uipath/utils/_endpoints_manager.py,sha256=iRTl5Q0XAm_YgcnMcJOXtj-8052sr6jpWuPNz6CgT0Q,8408
158
- uipath-2.1.62.dist-info/METADATA,sha256=s24g06f9pTc7KB-n0ewrZFNeRIHQiX6-7Po5W9Mffo0,6482
159
- uipath-2.1.62.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
160
- uipath-2.1.62.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
161
- uipath-2.1.62.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
162
- uipath-2.1.62.dist-info/RECORD,,
158
+ uipath-2.1.63.dist-info/METADATA,sha256=9F4PWbD9lyyCjr-jGQWMBJ5fxWlwDTSpYfdXXpO22s4,6482
159
+ uipath-2.1.63.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
160
+ uipath-2.1.63.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
161
+ uipath-2.1.63.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
162
+ uipath-2.1.63.dist-info/RECORD,,