uipath 2.1.81__py3-none-any.whl → 2.1.82__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.

Potentially problematic release.


This version of uipath might be problematic. Click here for more details.

@@ -7,8 +7,6 @@ import threading
7
7
  import time
8
8
  from typing import Optional
9
9
 
10
- from ._oidc_utils import OidcUtils
11
-
12
10
  # Server port
13
11
  PORT = 6234
14
12
 
@@ -22,7 +20,9 @@ class TokenReceivedSignal(Exception):
22
20
  super().__init__("Token received successfully")
23
21
 
24
22
 
25
- def make_request_handler_class(state, code_verifier, token_callback, domain):
23
+ def make_request_handler_class(
24
+ state, code_verifier, token_callback, domain, redirect_uri, client_id
25
+ ):
26
26
  class SimpleHTTPSRequestHandler(http.server.SimpleHTTPRequestHandler):
27
27
  """Simple HTTPS request handler that serves static files."""
28
28
 
@@ -73,16 +73,10 @@ def make_request_handler_class(state, code_verifier, token_callback, domain):
73
73
  with open(index_path, "r") as f:
74
74
  content = f.read()
75
75
 
76
- # Get the redirect URI from auth config
77
- auth_config = OidcUtils.get_auth_config()
78
- redirect_uri = auth_config["redirect_uri"]
79
-
80
76
  content = content.replace("__PY_REPLACE_EXPECTED_STATE__", state)
81
77
  content = content.replace("__PY_REPLACE_CODE_VERIFIER__", code_verifier)
82
78
  content = content.replace("__PY_REPLACE_REDIRECT_URI__", redirect_uri)
83
- content = content.replace(
84
- "__PY_REPLACE_CLIENT_ID__", auth_config["client_id"]
85
- )
79
+ content = content.replace("__PY_REPLACE_CLIENT_ID__", client_id)
86
80
  content = content.replace("__PY_REPLACE_DOMAIN__", domain)
87
81
 
88
82
  self.send_response(200)
@@ -107,14 +101,18 @@ def make_request_handler_class(state, code_verifier, token_callback, domain):
107
101
 
108
102
 
109
103
  class HTTPServer:
110
- def __init__(self, port=6234):
104
+ def __init__(self, port=6234, redirect_uri=None, client_id=None):
111
105
  """Initialize HTTP server with configurable parameters.
112
106
 
113
107
  Args:
114
108
  port (int, optional): Port number to run the server on. Defaults to 6234.
109
+ redirect_uri (str, optional): OAuth redirect URI. Defaults to None.
110
+ client_id (str, optional): OAuth client ID. Defaults to None.
115
111
  """
116
112
  self.current_path = os.path.dirname(os.path.abspath(__file__))
117
113
  self.port = port
114
+ self.redirect_uri = redirect_uri
115
+ self.client_id = client_id
118
116
  self.httpd: Optional[socketserver.TCPServer] = None
119
117
  self.token_data = None
120
118
  self.should_shutdown = False
@@ -145,7 +143,12 @@ class HTTPServer:
145
143
  # Create server with address reuse
146
144
  socketserver.TCPServer.allow_reuse_address = True
147
145
  handler = make_request_handler_class(
148
- state, code_verifier, self.token_received_callback, domain
146
+ state,
147
+ code_verifier,
148
+ self.token_received_callback,
149
+ domain,
150
+ self.redirect_uri,
151
+ self.client_id,
149
152
  )
150
153
  self.httpd = socketserver.TCPServer(("", self.port), handler)
151
154
  return self.httpd
@@ -121,11 +121,17 @@ class AuthService:
121
121
  return False
122
122
 
123
123
  def _perform_oauth_flow(self) -> TokenData:
124
- auth_url, code_verifier, state = OidcUtils.get_auth_url(self._domain)
124
+ auth_config = OidcUtils.get_auth_config()
125
+ auth_url, code_verifier, state = OidcUtils.get_auth_url(
126
+ self._domain, auth_config
127
+ )
125
128
  self._open_browser(auth_url)
126
129
 
127
- auth_config = OidcUtils.get_auth_config()
128
- server = HTTPServer(port=auth_config["port"])
130
+ server = HTTPServer(
131
+ port=auth_config["port"],
132
+ redirect_uri=auth_config["redirect_uri"],
133
+ client_id=auth_config["client_id"],
134
+ )
129
135
  token_data = asyncio.run(server.start(state, code_verifier, self._domain))
130
136
 
131
137
  if not token_data:
@@ -49,12 +49,8 @@ class OidcUtils:
49
49
  ) as f:
50
50
  auth_config = json.load(f)
51
51
 
52
- candidates = [
53
- int(auth_config.get("port", 8104)),
54
- int(auth_config.get("portOptionOne", 8104)),
55
- int(auth_config.get("portOptionTwo", 8055)),
56
- int(auth_config.get("portOptionThree", 42042)),
57
- ]
52
+ custom_port = os.getenv("UIPATH_AUTH_PORT")
53
+ candidates = [int(custom_port)] if custom_port else [8104, 8055, 42042]
58
54
 
59
55
  port = cls._find_free_port(candidates)
60
56
  if port is None:
@@ -75,11 +71,12 @@ class OidcUtils:
75
71
  )
76
72
 
77
73
  @classmethod
78
- def get_auth_url(cls, domain: str) -> tuple[str, str, str]:
74
+ def get_auth_url(cls, domain: str, auth_config: AuthConfig) -> tuple[str, str, str]:
79
75
  """Get the authorization URL for OAuth2 PKCE flow.
80
76
 
81
77
  Args:
82
78
  domain (str): The UiPath domain to authenticate against (e.g. 'alpha', 'cloud')
79
+ auth_config (AuthConfig): The authentication configuration to use
83
80
 
84
81
  Returns:
85
82
  tuple[str, str]: A tuple containing:
@@ -87,7 +84,6 @@ class OidcUtils:
87
84
  - The code verifier for PKCE flow
88
85
  """
89
86
  code_verifier, code_challenge = generate_code_verifier_and_challenge()
90
- auth_config = cls.get_auth_config()
91
87
  state = get_state_param()
92
88
  query_params = {
93
89
  "client_id": auth_config["client_id"],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath
3
- Version: 2.1.81
3
+ Version: 2.1.82
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
@@ -20,10 +20,10 @@ uipath/_cli/cli_push.py,sha256=-j-gDIbT8GyU2SybLQqFl5L8KI9nu3CDijVtltDgX20,3132
20
20
  uipath/_cli/cli_run.py,sha256=1FKv20EjxrrP1I5rNSnL_HzbWtOAIMjB3M--4RPA_Yo,3709
21
21
  uipath/_cli/middlewares.py,sha256=0D9a-wphyetnH9T97F08o7-1OKWF1lMweFHHAR0xiOw,4979
22
22
  uipath/_cli/spinner.py,sha256=bS-U_HA5yne11ejUERu7CQoXmWdabUD2bm62EfEdV8M,1107
23
- uipath/_cli/_auth/_auth_server.py,sha256=22km0F1NFNXgyLbvtAx3ssiQlVGHroLdtDCWEqiCiMg,7106
24
- uipath/_cli/_auth/_auth_service.py,sha256=7UykDSZWhe8B152rnoS1wF0XkAkhAipfDwEtT2cW7rk,5245
23
+ uipath/_cli/_auth/_auth_server.py,sha256=v_b8KNwn0tAv8jxpeKdllOVzl31q9AcdwpE_koAK_w4,7235
24
+ uipath/_cli/_auth/_auth_service.py,sha256=gyOtaHnDmjYccW0R1HVmFgV69a7w53Dx1Mq-PM0uVag,5405
25
25
  uipath/_cli/_auth/_models.py,sha256=kWhqd5FqBo_oi3DW2x1IaJHsEloXq0I24f-pX5zb_O4,753
26
- uipath/_cli/_auth/_oidc_utils.py,sha256=SLiOOAEdVwmPKRxIhFkARnNbrf01tvJxBAxa6MF9HHY,3458
26
+ uipath/_cli/_auth/_oidc_utils.py,sha256=qGpognkz-Ks-8pt-QabSNTix5HE06lQpY3WZxptoJUE,3394
27
27
  uipath/_cli/_auth/_portal_service.py,sha256=sq3Ls7v8Q1gQWbYlE37_p82gLYPhC_cXJRTuIxMsCPU,7997
28
28
  uipath/_cli/_auth/_url_utils.py,sha256=MuMYesMQDgetLBzkwd19dPxw3fctys7EVpByDUQMyLE,2844
29
29
  uipath/_cli/_auth/_utils.py,sha256=To4Ara_UF4g7nzUfKqFA11lTjhQWIZWNm4xwa5nNKmU,896
@@ -171,8 +171,8 @@ uipath/tracing/_traced.py,sha256=yBIY05PCCrYyx50EIHZnwJaKNdHPNx-YTR1sHQl0a98,199
171
171
  uipath/tracing/_utils.py,sha256=qd7N56tg6VXQ9pREh61esBgUWLNA0ssKsE0QlwrRWFM,11974
172
172
  uipath/utils/__init__.py,sha256=VD-KXFpF_oWexFg6zyiWMkxl2HM4hYJMIUDZ1UEtGx0,105
173
173
  uipath/utils/_endpoints_manager.py,sha256=iRTl5Q0XAm_YgcnMcJOXtj-8052sr6jpWuPNz6CgT0Q,8408
174
- uipath-2.1.81.dist-info/METADATA,sha256=8-3eAQ0tiFCXMWOhGm8QTSvM9fATrjo6j-UnceXoMOE,6593
175
- uipath-2.1.81.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
176
- uipath-2.1.81.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
177
- uipath-2.1.81.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
178
- uipath-2.1.81.dist-info/RECORD,,
174
+ uipath-2.1.82.dist-info/METADATA,sha256=4J6rxjh8jzOkT_XofHHFqQ1k9uPLVk7nyQTkbxwD6K8,6593
175
+ uipath-2.1.82.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
176
+ uipath-2.1.82.dist-info/entry_points.txt,sha256=9C2_29U6Oq1ExFu7usihR-dnfIVNSKc-0EFbh0rskB4,43
177
+ uipath-2.1.82.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
178
+ uipath-2.1.82.dist-info/RECORD,,