Skip to content

Commit

Permalink
add keep_cookies to serialized aim fields
Browse files Browse the repository at this point in the history
  • Loading branch information
gleveille-lbp committed Mar 14, 2024
1 parent 46b6463 commit 57a6ace
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.6] - 2024-03-14
### Bugfixes
- add keep_cookies to serialized aim fields

## [0.1.5] - 2024-03-08
### Bugfixes
- Tests were not all functional
Expand Down
11 changes: 6 additions & 5 deletions aiobastion/aim.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class EPV_AIM:
Class managing communication with the Central Credential Provider (AIM) GetPassword Web Service
"""
_serialized_fields = ["host", "appid", "cert", "key", "verify", "timeout", "max_concurrent_tasks",
"keep_cookies"]
"keep_cookies"]
_getPassword_request_parm = ["safe", "folder", "object", "username", "address", "database",
"policyid", "reason", "connectiontimeout", "query", "queryformat",
"failrequestonpasswordchange"]
Expand All @@ -42,7 +42,7 @@ def __init__(self, host: str = None, appid: str = None, cert: str = None, key: s
self.verify = verify
self.timeout = timeout
self.max_concurrent_tasks = max_concurrent_tasks
self.keep_cookies = keep_cookies # Whether to keep cookies between AIM calls
self.keep_cookies = keep_cookies # Whether to keep cookies between AIM calls

# Session management
self.__sema = None
Expand All @@ -65,8 +65,8 @@ def __init__(self, host: str = None, appid: str = None, cert: str = None, key: s
self.max_concurrent_tasks = Config.CYBERARK_DEFAULT_MAX_CONCURRENT_TASKS

if self.verify is not False and not (isinstance(self.verify, str) and not isinstance(self.verify, bool)):
raise AiobastionException(f"Invalid type for parameter 'verify' in AIM: {type(self.verify)} value: {self.verify!r}")

raise AiobastionException(
f"Invalid type for parameter 'verify' in AIM: {type(self.verify)} value: {self.verify!r}")

def validate_and_setup_aim_ssl(self):
if self.session:
Expand All @@ -91,7 +91,8 @@ def validate_and_setup_aim_ssl(self):
self.verify = Config.CYBERARK_DEFAULT_VERIFY

if not (isinstance(self.verify, str) or isinstance(self.verify, bool)):
raise AiobastionException(f"Invalid type for parameter 'verify' (or 'CA') in AIM: {type(self.verify)} value: {self.verify!r}")
raise AiobastionException(
f"Invalid type for parameter 'verify' (or 'CA') in AIM: {type(self.verify)} value: {self.verify!r}")

if (isinstance(self.verify, str) and not os.path.exists(self.verify)):
raise AiobastionException(f"Parameter 'verify' in AIM: file not found {self.verify!r}")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "aiobastion"
version = "0.1.4"
version = "0.1.6"
description = "Manage your Cyberark implementation"
readme = "README.md"
requires-python = ">=3.7"
Expand Down

0 comments on commit 57a6ace

Please sign in to comment.