ark-sdk-python 2.0.2__py3-none-any.whl → 2.0.4__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.
ark_sdk_python/ark.py CHANGED
@@ -17,7 +17,7 @@ from ark_sdk_python.actions import ArkAction, ArkCacheAction, ArkConfigureAction
17
17
 
18
18
  urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
19
19
 
20
- __version__ = '2.0.2'
20
+ __version__ = '2.0.4'
21
21
 
22
22
 
23
23
  def main():
@@ -16,6 +16,7 @@ import inquirer
16
16
  from cachetools import LRUCache, cached
17
17
  from pydantic import ValidationError
18
18
  from requests import Session
19
+ from requests.cookies import RequestsCookieJar
19
20
 
20
21
  from ark_sdk_python.args import ArkArgsFormatter, ArkInquirerRender
21
22
  from ark_sdk_python.auth.identity.ark_identity_fqdn_resolver import ArkIdentityFQDNResolver
@@ -73,7 +74,7 @@ def input_process(pipe_write: Connection, pipe_read: Connection, mechanism: Mech
73
74
 
74
75
 
75
76
  class ArkIdentity:
76
- __LAST_START_AUTH_RESP: Dict[str, Tuple[StartAuthResponse, datetime]] = {}
77
+ __LAST_START_AUTH_RESP: Dict[str, Tuple[StartAuthResponse, datetime, RequestsCookieJar]] = {}
77
78
  __LAST_START_AUTH_RESP_DELTA_SECONDS: Final[int] = 30
78
79
 
79
80
  def __init__(
@@ -478,7 +479,11 @@ class ArkIdentity:
478
479
  identity_tenant_subdomain=identity_tenant_subdomain,
479
480
  )
480
481
  resp = identity.__start_authentication()
481
- ArkIdentity.__LAST_START_AUTH_RESP[f'{identity.identity_url}_{username}'] = (resp, datetime.now())
482
+ ArkIdentity.__LAST_START_AUTH_RESP[f'{identity.identity_url}_{username}'] = (
483
+ resp,
484
+ datetime.now(),
485
+ identity.session.cookies,
486
+ )
482
487
  return (
483
488
  resp.result.idp_redirect_url == None
484
489
  and resp.result.challenges
@@ -533,6 +538,7 @@ class ArkIdentity:
533
538
  start_auth_response_time = ArkIdentity.__LAST_START_AUTH_RESP[f'{self.__identity_url}_{self.__username}']
534
539
  if (datetime.now() - start_auth_response_time[1]).total_seconds() < ArkIdentity.__LAST_START_AUTH_RESP_DELTA_SECONDS:
535
540
  start_auth_response = start_auth_response_time[0]
541
+ self.__session.cookies.update(start_auth_response_time[2])
536
542
  del ArkIdentity.__LAST_START_AUTH_RESP[f'{self.__identity_url}_{self.__username}']
537
543
  if not start_auth_response:
538
544
  start_auth_response = self.__start_authentication()
@@ -5,7 +5,6 @@ from pathlib import Path
5
5
  from typing import Any, Optional
6
6
 
7
7
  from overrides import overrides
8
- from pexpect import pxssh
9
8
 
10
9
  from ark_sdk_python.common.connections.ark_connection import ArkConnection
11
10
  from ark_sdk_python.common.connections.ssh.ark_ssh_connection import SSH_PORT
@@ -20,7 +19,7 @@ class ArkPTYSSHConnection(ArkConnection):
20
19
  super().__init__()
21
20
  self.__is_connected: bool = False
22
21
  self.__is_suspended: bool = False
23
- self.__ssh_client: Optional[pxssh.pxssh] = None
22
+ self.__ssh_client: Optional[Any] = None
24
23
 
25
24
  @overrides
26
25
  def connect(self, connection_details: ArkConnectionDetails) -> None:
@@ -34,6 +33,8 @@ class ArkPTYSSHConnection(ArkConnection):
34
33
  Raises:
35
34
  ArkException: _description_
36
35
  """
36
+ from pexpect import pxssh
37
+
37
38
  if self.__is_connected:
38
39
  return
39
40
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ark-sdk-python
3
- Version: 2.0.2
3
+ Version: 2.0.4
4
4
  Summary: Official Ark SDK / CLI for CyberArk Identity Security Platform
5
5
  License: Apache-2.0
6
6
  Author: CyberArk
@@ -10,13 +10,13 @@ ark_sdk_python/actions/ark_service_exec_action.py,sha256=IHIm9oISRThOD8WNJe4oJX-
10
10
  ark_sdk_python/args/__init__.py,sha256=mCb4UrIRL4u58QyUbqqH2xAU0VN91pxjK5sa_UwCM_k,279
11
11
  ark_sdk_python/args/ark_args_formatter.py,sha256=-Rs_rGMIr1bprD1SfYlMsLoSOFgr_RFrRdREvbmPU6k,9204
12
12
  ark_sdk_python/args/ark_pydantic_argparse.py,sha256=uupNLnUmO5LrTrRZsBv7qRKgDsx4GaJMwOUh1TCc1-w,40083
13
- ark_sdk_python/ark.py,sha256=eI5sMAgh2sbPrOyb1aqvj3R0GmTdiKD3PQvSokyNVVI,1280
13
+ ark_sdk_python/ark.py,sha256=iMgWG48a8PALAEzUFSp1VojhqJTJL8s_xKPQ417EahU,1280
14
14
  ark_sdk_python/ark_api.py,sha256=qEB2j-xf8kiSdAvTXrvEdqGDQ-l1aoEvktxnq7BYNRI,12486
15
15
  ark_sdk_python/auth/__init__.py,sha256=1l29Rf3VhwmV8z3YROiQVcgrZYSeeCqVN4zna77tnlk,620
16
16
  ark_sdk_python/auth/ark_auth.py,sha256=2fPlABM3AwWmb1h0lQPQAz93u1ZluYKv7axlfg4lq5Q,12988
17
17
  ark_sdk_python/auth/ark_isp_auth.py,sha256=Xuf8J7-VgN6a6oJOem5Rf8LzOI5NCNqUeT5Snb4VNK4,9572
18
18
  ark_sdk_python/auth/identity/__init__.py,sha256=2Yyc_Rrx-D4PsSdg-ESl5pFFTpqu6LUPSc4ZW59oOP8,328
19
- ark_sdk_python/auth/identity/ark_identity.py,sha256=3YHJJec8uQlTY00dMEKTrfzho-Q3SrdWcITRVrGMnHQ,31909
19
+ ark_sdk_python/auth/identity/ark_identity.py,sha256=zjxjQA91H7ImJqng6OAeG-jIQ54__2Ab84Z_c51g8Ho,32123
20
20
  ark_sdk_python/auth/identity/ark_identity_fqdn_resolver.py,sha256=utO8mWF7rqfYhcPUthBp7t4M9t-_u3v84CRJeCogoHc,4797
21
21
  ark_sdk_python/auth/identity/ark_identity_service_user.py,sha256=QlqUHGUh4iqmfqmV_YlXs6xNM_U-xz6VqW5hHZoxwSQ,7495
22
22
  ark_sdk_python/cli_services/__init__.py,sha256=e9vdwqNiYqhZmK05Wgpz-Hf9SycK_3X-RS3CK9n2lIs,87
@@ -43,7 +43,7 @@ ark_sdk_python/common/ark_system_config.py,sha256=cl44cYSgXZEnoRYu048aBeJwWRPdCT
43
43
  ark_sdk_python/common/connections/__init__.py,sha256=RyARha6jTeaUw1cIGBSR7nOYxCV3fC24juKb-17yXLw,104
44
44
  ark_sdk_python/common/connections/ark_connection.py,sha256=wjYpn_9EJ-B679006VqQREFeTOhINmw-heiRqlpuCnY,1613
45
45
  ark_sdk_python/common/connections/ssh/__init__.py,sha256=Ycv3BDI2iw-N7BdRkpAv2Qi90O4bp8sPyNsJnuQLfWo,256
46
- ark_sdk_python/common/connections/ssh/ark_pty_ssh_connection.py,sha256=PRrS3pcVdW6Ike6AWnh5JuOLhcYJC7nJHQOf6VZa_kI,4973
46
+ ark_sdk_python/common/connections/ssh/ark_pty_ssh_connection.py,sha256=GaCdiORXWfMB4Pu5bu1nkNPmjUAU5N3l7qUA6FaQ4WI,4974
47
47
  ark_sdk_python/common/connections/ssh/ark_ssh_connection.py,sha256=yVtrM_clLScg1uNY-Fextiup59h2AIbKxQQadLfiqpw,5195
48
48
  ark_sdk_python/common/connections/winrm/__init__.py,sha256=TX8jEK5BPwvlzgo8lH4sGDcY9oL593rdEutQL4MMra4,164
49
49
  ark_sdk_python/common/connections/winrm/ark_winrm_connection.py,sha256=O8ifpvmuzFpvqvjb3wFmg576v5jFZwFHi20wlV2UtwE,6854
@@ -479,9 +479,9 @@ ark_sdk_python/services/sia/workspaces/targetsets/__init__.py,sha256=UjHr81LMcMl
479
479
  ark_sdk_python/services/sia/workspaces/targetsets/ark_sia_target_sets_workspace_service.py,sha256=o9_DzskTV94kkfc4m0Qk8lj5FV8rexRa5RzRwfe9Tbo,11254
480
480
  ark_sdk_python/services/sm/__init__.py,sha256=jzKxEkZYOCW9y_byLfd_odae9m2sh1UfjaaKBVySWY0,95
481
481
  ark_sdk_python/services/sm/ark_sm_service.py,sha256=Rh2dFjNz7VMJUnl43hxL07HEZ8_33KrU_lqfUrqUDn4,11517
482
- ark_sdk_python-2.0.2.dist-info/LICENSE.txt,sha256=d4EzYx2apA3-GqrFY23wLtc6UmQNXG05gyLfZ3oWVRs,11358
483
- ark_sdk_python-2.0.2.dist-info/METADATA,sha256=N2GVS4nUgCu0WWdDFBihVWTYqqBz8ocGXhB0OM8vsLU,20102
484
- ark_sdk_python-2.0.2.dist-info/NOTICES.md,sha256=cuG6J8u9QVu5ZjYki-McJmoEmi39foN30IxA_2fNnKY,125667
485
- ark_sdk_python-2.0.2.dist-info/WHEEL,sha256=QymApwX2NnTrOAORdnrvo1YegSC1EN2pJY0mOd9rfdE,110
486
- ark_sdk_python-2.0.2.dist-info/entry_points.txt,sha256=v5bcuRn8w42ZKQspfvX3AliKmLVO6f7Zb_bma77p3vQ,47
487
- ark_sdk_python-2.0.2.dist-info/RECORD,,
482
+ ark_sdk_python-2.0.4.dist-info/LICENSE.txt,sha256=d4EzYx2apA3-GqrFY23wLtc6UmQNXG05gyLfZ3oWVRs,11358
483
+ ark_sdk_python-2.0.4.dist-info/METADATA,sha256=VfDRV7q1M3kgtA8eBN79iMwkzLIilCoyfjUyu4xqwAw,20102
484
+ ark_sdk_python-2.0.4.dist-info/NOTICES.md,sha256=cuG6J8u9QVu5ZjYki-McJmoEmi39foN30IxA_2fNnKY,125667
485
+ ark_sdk_python-2.0.4.dist-info/WHEEL,sha256=QymApwX2NnTrOAORdnrvo1YegSC1EN2pJY0mOd9rfdE,110
486
+ ark_sdk_python-2.0.4.dist-info/entry_points.txt,sha256=v5bcuRn8w42ZKQspfvX3AliKmLVO6f7Zb_bma77p3vQ,47
487
+ ark_sdk_python-2.0.4.dist-info/RECORD,,