diff --git a/settings.ini.example b/settings.ini.example index e435964..33f4dad 100644 --- a/settings.ini.example +++ b/settings.ini.example @@ -1,8 +1,13 @@ [settings] url = http://localhost:8000/api/snapshot/ -token = '1234' +#url = https://demo.ereuse.org/api/v1/snapshot/ +# sample token that works with default deployment such as the previous two urls +token = 5018dd65-9abd-4a62-8896-80f34ac66150 + +# Idhub # wb_sign_token = "27de6ad7-cee2-4fe8-84d4-c7eea9c969c8" # url_wallet = "http://localhost" + # path = /path/to/save # device = your_device_name # # erase = basic diff --git a/workbench-script.py b/workbench-script.py index bb89e6b..93515af 100644 --- a/workbench-script.py +++ b/workbench-script.py @@ -12,6 +12,8 @@ import gettext import locale import logging +from pathlib import Path +from string import Template from datetime import datetime @@ -528,17 +530,12 @@ def main(): convert_to_legacy_snapshot(snapshot) snapshot = json.dumps(snapshot) else: + snapshot = convert_to_credential(snapshot) url_wallet = config.get("url_wallet") wb_sign_token = config.get("wb_sign_token") - - if wb_sign_token: - tk = wb_sign_token.encode("utf8") - snapshot["operator_id"] = hashlib.sha3_256(tk).hexdigest() - if url_wallet and wb_sign_token: snapshot = send_to_sign_credential(snapshot, wb_sign_token, url_wallet) - else: - snapshot = json.dumps(snapshot) + save_snapshot_in_disk(snapshot, config['path'], snap_uuid)