diff --git a/src/sync_bosch_api.py b/src/sync_bosch_api.py index 9b1bb8acb6899ba1828ff0fae5d72fecbfc358a8..6bbca8414fb512f5758ba70935ad6ec8cc3160df 100755 --- a/src/sync_bosch_api.py +++ b/src/sync_bosch_api.py @@ -9,7 +9,7 @@ import requests from datetime import datetime, timedelta, timezone from urllib.request import Request, urlopen -from timeio.crypto import decrypt +from timeio.crypto import decrypt, get_crypt_key import timeio.mqtt as mqtt from timeio.journaling import Journal @@ -96,7 +96,7 @@ def main(thing_uuid, parameters, target_uri): logger.info(f"Start fetching Bosch data for thing {thing_uuid}") params = json.loads(parameters.replace("'", '"')) - pw_dec = decrypt(params["password"]) + pw_dec = decrypt(params["password"], get_crypt_key()) timestamp_from, timestamp_to = get_utc_timestamps(params["period"]) url = f"""{params["endpoint"]}/{params["sensor_id"]}/{timestamp_from}/{timestamp_to}""" response = make_request(url, params["username"], pw_dec) diff --git a/src/sync_tsystems_api.py b/src/sync_tsystems_api.py index b6590ca6f549ec6ff65291f03202c57db6b9aedd..8bb67767d07841a3522f543f0a8578ee3537e56f 100755 --- a/src/sync_tsystems_api.py +++ b/src/sync_tsystems_api.py @@ -5,10 +5,9 @@ import click import logging import json import os -import sys from datetime import datetime, timedelta, timezone -from timeio.crypto import decrypt +from timeio.crypto import decrypt, get_crypt_key import timeio.mqtt as mqtt from timeio.journaling import Journal @@ -100,7 +99,7 @@ def main(thing_uuid, parameters, target_uri): logger.info(f"Start fetching TSystems data for thing {thing_uuid}") params = json.loads(parameters.replace("'", '"')) - pw_dec = decrypt(params["password"]) + pw_dec = decrypt(params["password"], get_crypt_key()) response = request_tsystems_api( params["group"], params["station_id"], params["username"], pw_dec ) diff --git a/src/sync_ttn_api.py b/src/sync_ttn_api.py index c0a87a3c820ccef3d5b1bb0ddd6f49d58b6de646..9dc995953789e2ebb6863f775162e0cb6be85b03 100755 --- a/src/sync_ttn_api.py +++ b/src/sync_ttn_api.py @@ -7,7 +7,7 @@ import logging import requests import click -from timeio.crypto import decrypt +from timeio.crypto import decrypt, get_crypt_key import timeio.mqtt as mqtt from timeio.journaling import Journal @@ -34,7 +34,7 @@ def main(thing_uuid: str, parameters: str, target_uri: str): logger.info(f"Start fetching TTN data for thing {thing_uuid}") params = json.loads(parameters.replace("'", '"')) - api_key_dec = decrypt(params["api_key"]) + api_key_dec = decrypt(params["api_key"], get_crypt_key()) res = requests.get( params["endpoint_uri"],