Skip to content

Commit

Permalink
IS-15460 Add support for putting secrets to multi-system connectors (#…
Browse files Browse the repository at this point in the history
…131)

* add support for putting secrets to multi-system connectors

* linting fix

* bump version to 2.6.7
  • Loading branch information
parhambarazesh authored Aug 4, 2023
1 parent 827a8dc commit 5193636
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions connector_cli/api_key_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ def login_via_api_key(sesam_node, args):
system_id = args.system_placeholder
api_key = args.api_key
base_url = args.base_url
systems = sesam_node.api_connection.get_systems()
if base_url and system_id and api_key:
is_failed = False
try:
system = sesam_node.get_system(system_id)
system.put_secrets({"api_key": api_key})
for system in systems:
system.put_secrets({"api_key": api_key})
except Exception as e:
is_failed = True
sesam_node.logger.error("Failed to put secrets: %s" % e)
Expand Down
5 changes: 3 additions & 2 deletions connector_cli/oauth2login.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ def login_callback():
sesam_node.logger.error("Failed to get secrets: %s" % e)
# put secrets
try:
system = sesam_node.api_connection.get_system(system_id)
system.put_secrets(secrets)
systems = sesam_node.api_connection.get_systems()
for system in systems:
system.put_secrets(secrets)
except Exception as e:
is_failed = True
sesam_node.logger.error("Failed to put secrets: %s" % e)
Expand Down
2 changes: 1 addition & 1 deletion install-latest.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -x
TAG=${SESAM_TAG:-2.6.6}
TAG=${SESAM_TAG:-2.6.7}

wget -O sesam.tar.gz https://github.com/sesam-community/sesam-py/releases/download/$TAG/sesam-linux-$TAG.tar.gz
tar -xf sesam.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions readme.install.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $ virtualenv --python=python3 venv
$ . venv/bin/activate
$ pip install -r requirements.txt
$ python sesam.py -version
sesam version 2.6.6
sesam version 2.6.7
```


Expand All @@ -25,7 +25,7 @@ $ pip install -r requirements.txt
$ pip install pyinstaller
$ pyinstaller --onefile --add-data "connector_cli:connector_cli" sesam.py
$ dist/sesam -version
sesam version 2.6.6
sesam version 2.6.7
```

### [Back to main page](./README.md)
2 changes: 1 addition & 1 deletion sesam.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from connector_cli import api_key_login, connectorpy, oauth2login, tripletexlogin
from jsonformat import FormatStyle, format_object

sesam_version = "2.6.6"
sesam_version = "2.6.7"

logger = logging.getLogger("sesam")
LOGLEVEL_TRACE = 2
Expand Down

0 comments on commit 5193636

Please sign in to comment.