iwa 0.0.23__py3-none-any.whl → 0.0.25__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.
- iwa/plugins/olas/importer.py +2 -6
- iwa/plugins/olas/plugin.py +5 -5
- iwa/plugins/olas/tests/test_plugin_full.py +7 -5
- {iwa-0.0.23.dist-info → iwa-0.0.25.dist-info}/METADATA +1 -1
- {iwa-0.0.23.dist-info → iwa-0.0.25.dist-info}/RECORD +9 -9
- {iwa-0.0.23.dist-info → iwa-0.0.25.dist-info}/WHEEL +0 -0
- {iwa-0.0.23.dist-info → iwa-0.0.25.dist-info}/entry_points.txt +0 -0
- {iwa-0.0.23.dist-info → iwa-0.0.25.dist-info}/licenses/LICENSE +0 -0
- {iwa-0.0.23.dist-info → iwa-0.0.25.dist-info}/top_level.txt +0 -0
iwa/plugins/olas/importer.py
CHANGED
|
@@ -7,6 +7,7 @@ Supports two formats:
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
import json
|
|
10
|
+
import re
|
|
10
11
|
from dataclasses import dataclass, field
|
|
11
12
|
from pathlib import Path
|
|
12
13
|
from typing import List, Optional, Tuple
|
|
@@ -273,7 +274,6 @@ class OlasServiceImporter:
|
|
|
273
274
|
key = self._parse_keystore_file(operator_file, role="owner")
|
|
274
275
|
if key:
|
|
275
276
|
keys.append(key)
|
|
276
|
-
self._verify_key_signature(key)
|
|
277
277
|
|
|
278
278
|
# Also check keys.json (array of keystores)
|
|
279
279
|
keys_file = folder / "keys.json"
|
|
@@ -793,8 +793,6 @@ class OlasServiceImporter:
|
|
|
793
793
|
Tags follow the pattern: {service_name}_{role}
|
|
794
794
|
Example: trader_alpha_agent, trader_alpha_operator
|
|
795
795
|
"""
|
|
796
|
-
import re
|
|
797
|
-
|
|
798
796
|
# Use service name as prefix, or 'imported' as fallback
|
|
799
797
|
prefix = service_name or "imported"
|
|
800
798
|
|
|
@@ -835,7 +833,6 @@ class OlasServiceImporter:
|
|
|
835
833
|
signers.append(key.address)
|
|
836
834
|
|
|
837
835
|
# Generate tag
|
|
838
|
-
import re
|
|
839
836
|
|
|
840
837
|
prefix = service.service_name or "imported"
|
|
841
838
|
prefix = re.sub(r"[^a-z0-9]+", "_", prefix.lower()).strip("_")
|
|
@@ -898,7 +895,7 @@ class OlasServiceImporter:
|
|
|
898
895
|
olas_service.agent_address = agent_key.address
|
|
899
896
|
|
|
900
897
|
olas_config.add_service(olas_service)
|
|
901
|
-
self.config.
|
|
898
|
+
self.config.save_config()
|
|
902
899
|
logger.info(f"Imported service {key}")
|
|
903
900
|
return True, "ok"
|
|
904
901
|
|
|
@@ -924,7 +921,6 @@ class OlasServiceImporter:
|
|
|
924
921
|
except ValueError as e:
|
|
925
922
|
# Password incorrect
|
|
926
923
|
logger.warning(f"Decryption failed (ValueError) for {key.address}: {e}")
|
|
927
|
-
pass
|
|
928
924
|
except Exception as e:
|
|
929
925
|
logger.warning(f"Error decrypting key {key.address}: {type(e).__name__} - {e}")
|
|
930
926
|
|
iwa/plugins/olas/plugin.py
CHANGED
|
@@ -269,9 +269,9 @@ class OlasPlugin(Plugin):
|
|
|
269
269
|
# Scan directory
|
|
270
270
|
console.print(f"\n[bold]Scanning[/bold] {path}...")
|
|
271
271
|
|
|
272
|
-
# Ask for password
|
|
273
|
-
if
|
|
274
|
-
password = self.
|
|
272
|
+
# Ask for password before scan to allow signature verification of encrypted keys
|
|
273
|
+
if not password:
|
|
274
|
+
password = self._prompt_password_for_verification()
|
|
275
275
|
|
|
276
276
|
importer = OlasServiceImporter(password=password)
|
|
277
277
|
discovered = importer.scan_directory(Path(path))
|
|
@@ -306,8 +306,8 @@ class OlasPlugin(Plugin):
|
|
|
306
306
|
results = self._import_and_print_results(console, importer, discovered, password)
|
|
307
307
|
self._print_import_summary(console, *results)
|
|
308
308
|
|
|
309
|
-
def
|
|
310
|
-
"""Prompt for password during
|
|
309
|
+
def _prompt_password_for_verification(self) -> Optional[str]:
|
|
310
|
+
"""Prompt for password to verify encrypted keys during scan."""
|
|
311
311
|
pwd = typer.prompt(
|
|
312
312
|
"Enter wallet password to verify encrypted keys (optional, press Enter to skip)",
|
|
313
313
|
hide_input=True,
|
|
@@ -146,8 +146,8 @@ def test_import_services_cli_abort(plugin, runner):
|
|
|
146
146
|
DiscoveredService(service_id=1, service_name="Test", chain_name="gnosis")
|
|
147
147
|
]
|
|
148
148
|
|
|
149
|
-
#
|
|
150
|
-
result = runner.invoke(app, ["/tmp/test"], input="
|
|
149
|
+
# input: first Enter to skip password prompt, then 'n' to abort confirmation
|
|
150
|
+
result = runner.invoke(app, ["/tmp/test"], input="\nn\n")
|
|
151
151
|
assert result.exit_code == 0
|
|
152
152
|
assert "Aborted" in result.output
|
|
153
153
|
mock_importer.import_service.assert_not_called()
|
|
@@ -162,7 +162,8 @@ def test_import_services_cli_no_services(plugin, runner):
|
|
|
162
162
|
mock_importer = mock_importer_cls.return_value
|
|
163
163
|
mock_importer.scan_directory.return_value = []
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
# input: Enter to skip password prompt
|
|
166
|
+
result = runner.invoke(app, ["/tmp/test"], input="\n")
|
|
166
167
|
assert result.exit_code == 0
|
|
167
168
|
assert "No Olas services found" in result.output
|
|
168
169
|
|
|
@@ -208,8 +209,9 @@ def test_import_services_cli_password_prompt(plugin, runner):
|
|
|
208
209
|
mock_importer.scan_directory.return_value = [service]
|
|
209
210
|
mock_importer.import_service.return_value = ImportResult(success=True, message="OK")
|
|
210
211
|
|
|
211
|
-
# input
|
|
212
|
-
|
|
212
|
+
# input: 'secret' for password before scan, 'y' for confirm import
|
|
213
|
+
# Note: password is now prompted BEFORE scan for signature verification
|
|
214
|
+
result = runner.invoke(app, ["/tmp/test"], input="secret\ny\n")
|
|
213
215
|
assert result.exit_code == 0
|
|
214
216
|
assert "password" in result.output.lower()
|
|
215
217
|
mock_importer.import_service.assert_called_with(service, "secret")
|
|
@@ -61,10 +61,10 @@ iwa/plugins/gnosis/tests/test_safe.py,sha256=hQHVHBWQhGnuvzvx4U9fOWEwASJWwql42q6
|
|
|
61
61
|
iwa/plugins/olas/__init__.py,sha256=_NhBczzM61fhGYwGhnWfEeL8Jywyy_730GASe2BxzeQ,106
|
|
62
62
|
iwa/plugins/olas/constants.py,sha256=iTFoO2QW3KbhL5k5sKsJxxyDytl9wVIb_9hAih55KrE,7728
|
|
63
63
|
iwa/plugins/olas/events.py,sha256=SWD3wYdQ-l6dLUJSkfh_WsLmedH4Vsw_EvYXg7QC3yc,5970
|
|
64
|
-
iwa/plugins/olas/importer.py,sha256
|
|
64
|
+
iwa/plugins/olas/importer.py,sha256=-zI0Fqmf6E7w3OpqEuTR8vuQOaAGNykGWzHZgadrHmE,37362
|
|
65
65
|
iwa/plugins/olas/mech_reference.py,sha256=CaSCpQnQL4F7wOG6Ox6Zdoy-uNEQ78YBwVLILQZKL8Q,5782
|
|
66
66
|
iwa/plugins/olas/models.py,sha256=xC5hYakX53pBT6zZteM9cyiC7t6XRLLpobjQmDYueOo,3520
|
|
67
|
-
iwa/plugins/olas/plugin.py,sha256=
|
|
67
|
+
iwa/plugins/olas/plugin.py,sha256=7vTnr7OUZhzXKxyQjjp5oiRkMsB5c-1arDW4YYoV9RM,13156
|
|
68
68
|
iwa/plugins/olas/contracts/activity_checker.py,sha256=WXxuzbpXGVqIfEiMPiiqN3Z_UxIY-Lvx0raa1ErBfPA,5323
|
|
69
69
|
iwa/plugins/olas/contracts/base.py,sha256=y73aQbDq6l4zUpz_eQAg4MsLkTAEqjjupXlcvxjfgCI,240
|
|
70
70
|
iwa/plugins/olas/contracts/mech.py,sha256=dXYtyORc-oiu9ga5PtTquOFkoakb6BLGKvlUsteygIg,2767
|
|
@@ -101,7 +101,7 @@ iwa/plugins/olas/tests/test_olas_view.py,sha256=kh3crsriyoRiZC6l8vzGllocvQnYmqzi
|
|
|
101
101
|
iwa/plugins/olas/tests/test_olas_view_actions.py,sha256=jAxr9bjFNAaxGf1btIrxdMaHgJ0PWX9aDwVU-oPGMpk,5109
|
|
102
102
|
iwa/plugins/olas/tests/test_olas_view_modals.py,sha256=8j0PNFjKqFC5V1kBdVFWNLMvqGt49H6fLSYGxn02c8o,5562
|
|
103
103
|
iwa/plugins/olas/tests/test_plugin.py,sha256=RVgU-Cq6t_3mOh90xFAGwlJOV7ZIgp0VNaK5ZAxisAQ,2565
|
|
104
|
-
iwa/plugins/olas/tests/test_plugin_full.py,sha256=
|
|
104
|
+
iwa/plugins/olas/tests/test_plugin_full.py,sha256=55EBa07JhJLVG3IMi6QKlR_ivWLYCdLQTySP66qbEXo,8584
|
|
105
105
|
iwa/plugins/olas/tests/test_service_lifecycle.py,sha256=sOCtpz8T9s55AZe9AoqP1h3XrXw5NDSjDqwLgYThvU4,5559
|
|
106
106
|
iwa/plugins/olas/tests/test_service_manager.py,sha256=rS2m0A26apc-o4HsfP5oXmVcmZSR5e874bjhQKZRaSg,40650
|
|
107
107
|
iwa/plugins/olas/tests/test_service_manager_errors.py,sha256=udlAsQj_t1F5TwVQuWhroF6jDJ4RmGEXaxPh87tMsuA,8538
|
|
@@ -157,7 +157,7 @@ iwa/web/tests/test_web_endpoints.py,sha256=C264MH-CTyDW4GLUrTXBgLJKUk4-89pFAScBd
|
|
|
157
157
|
iwa/web/tests/test_web_olas.py,sha256=0CVSsrncOeJ3x0ECV7mVLQV_CXZRrOqGiVjgLIi6hZ8,16308
|
|
158
158
|
iwa/web/tests/test_web_swap.py,sha256=7A4gBJFL01kIXPtW1E1J17SCsVc_0DmUn-R8kKrnnVA,2974
|
|
159
159
|
iwa/web/tests/test_web_swap_coverage.py,sha256=zGNrzlhZ_vWDCvWmLcoUwFgqxnrp_ACbo49AtWBS_Kw,5584
|
|
160
|
-
iwa-0.0.
|
|
160
|
+
iwa-0.0.25.dist-info/licenses/LICENSE,sha256=eIubm_IlBHPYRQlLNZKbBNKhJUUP3JH0A2miZUhAVfI,1078
|
|
161
161
|
tests/legacy_cow.py,sha256=oOkZvIxL70ReEoD9oHQbOD5GpjIr6AGNHcOCgfPlerU,8389
|
|
162
162
|
tests/legacy_safe.py,sha256=AssM2g13E74dNGODu_H0Q0y412lgqsrYnEzI97nm_Ts,2972
|
|
163
163
|
tests/legacy_transaction_retry_logic.py,sha256=D9RqZ7DBu61Xr2djBAodU2p9UE939LL-DnQXswX5iQk,1497
|
|
@@ -210,8 +210,8 @@ tests/test_utils.py,sha256=vkP49rYNI8BRzLpWR3WnKdDr8upeZjZcs7Rx0pjbQMo,1292
|
|
|
210
210
|
tests/test_workers.py,sha256=MInwdkFY5LdmFB3o1odIaSD7AQZb3263hNafO1De5PE,2793
|
|
211
211
|
tools/create_and_stake_service.py,sha256=1xwy_bJQI1j9yIQ968Oc9Db_F6mk1659LuuZntTASDE,3742
|
|
212
212
|
tools/verify_drain.py,sha256=PkMjblyOOAuQge88FwfEzRtCYeEtJxXhPBmtQYCoQ-8,6743
|
|
213
|
-
iwa-0.0.
|
|
214
|
-
iwa-0.0.
|
|
215
|
-
iwa-0.0.
|
|
216
|
-
iwa-0.0.
|
|
217
|
-
iwa-0.0.
|
|
213
|
+
iwa-0.0.25.dist-info/METADATA,sha256=3Rf1eo6u4JUj4l2dR319jSE4Q5GeUMScF8LBV23G8Pc,7295
|
|
214
|
+
iwa-0.0.25.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
215
|
+
iwa-0.0.25.dist-info/entry_points.txt,sha256=nwB6kscrfA7M00pYmL2j-sBH6eF6h2ga9IK1BZxdiyQ,241
|
|
216
|
+
iwa-0.0.25.dist-info/top_level.txt,sha256=kedS9cRUbm4JE2wYeabIXilhHjN8KCw0IGbqqqsw0Bs,16
|
|
217
|
+
iwa-0.0.25.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|