uipath 2.1.61__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.
- uipath/_cli/_auth/_auth_service.py +15 -2
- uipath/_cli/_auth/_portal_service.py +29 -0
- uipath/_cli/_utils/_studio_project.py +4 -2
- uipath/_cli/cli_auth.py +7 -0
- {uipath-2.1.61.dist-info → uipath-2.1.63.dist-info}/METADATA +1 -1
- {uipath-2.1.61.dist-info → uipath-2.1.63.dist-info}/RECORD +9 -9
- {uipath-2.1.61.dist-info → uipath-2.1.63.dist-info}/WHEEL +0 -0
- {uipath-2.1.61.dist-info → uipath-2.1.63.dist-info}/entry_points.txt +0 -0
- {uipath-2.1.61.dist-info → uipath-2.1.63.dist-info}/licenses/LICENSE +0 -0
@@ -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
|
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
|
-
|
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
|
@@ -126,8 +126,8 @@ class LockInfo(BaseModel):
|
|
126
126
|
arbitrary_types_allowed=True,
|
127
127
|
extra="allow",
|
128
128
|
)
|
129
|
-
project_lock_key: str = Field(alias="projectLockKey")
|
130
|
-
solution_lock_key: str = Field(alias="solutionLockKey")
|
129
|
+
project_lock_key: Optional[str] = Field(alias="projectLockKey")
|
130
|
+
solution_lock_key: Optional[str] = Field(alias="solutionLockKey")
|
131
131
|
|
132
132
|
|
133
133
|
def get_folder_by_name(
|
@@ -203,6 +203,8 @@ def with_lock_retry(func: Callable[..., Any]) -> Callable[..., Any]:
|
|
203
203
|
async def wrapper(self, *args, **kwargs):
|
204
204
|
try:
|
205
205
|
lock_info = await self._retrieve_lock()
|
206
|
+
if not lock_info.project_lock_key:
|
207
|
+
raise RuntimeError("Failed to retrieve project lock key.")
|
206
208
|
|
207
209
|
headers = kwargs.get("headers", {}) or {}
|
208
210
|
headers[HEADER_SW_LOCK_KEY] = lock_info.project_lock_key
|
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.
|
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=
|
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=
|
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=
|
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
|
@@ -73,7 +73,7 @@ uipath/_cli/_utils/_input_args.py,sha256=3LGNqVpJItvof75VGm-ZNTUMUH9-c7-YgleM5b2
|
|
73
73
|
uipath/_cli/_utils/_parse_ast.py,sha256=8Iohz58s6bYQ7rgWtOTjrEInLJ-ETikmOMZzZdIY2Co,20072
|
74
74
|
uipath/_cli/_utils/_processes.py,sha256=q7DfEKHISDWf3pngci5za_z0Pbnf_shWiYEcTOTCiyk,1855
|
75
75
|
uipath/_cli/_utils/_project_files.py,sha256=sulh3xZhDDw_rBOrn_XSUfVSD6sUu47ZK4n_lF5BKkQ,13197
|
76
|
-
uipath/_cli/_utils/_studio_project.py,sha256=
|
76
|
+
uipath/_cli/_utils/_studio_project.py,sha256=hmWn9i7COkms3wAy5Di04ENF9KZAwbn_lyyTGDyq9uU,15571
|
77
77
|
uipath/_cli/_utils/_tracing.py,sha256=2igb03j3EHjF_A406UhtCKkPfudVfFPjUq5tXUEG4oo,1541
|
78
78
|
uipath/_cli/_utils/_uv_helpers.py,sha256=6SvoLnZPoKIxW0sjMvD1-ENV_HOXDYzH34GjBqwT138,3450
|
79
79
|
uipath/_events/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -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.
|
159
|
-
uipath-2.1.
|
160
|
-
uipath-2.1.
|
161
|
-
uipath-2.1.
|
162
|
-
uipath-2.1.
|
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,,
|
File without changes
|
File without changes
|
File without changes
|