diff --git a/static-data/official-plugins/wot/main.py b/static-data/official-plugins/wot/main.py index c5e0faed..26011361 100644 --- a/static-data/official-plugins/wot/main.py +++ b/static-data/official-plugins/wot/main.py @@ -99,6 +99,8 @@ def on_init(api, data=None): return logging.info('Loaded active identity: ' + iden.name) + identities.add(iden) + def on_wot_cmd(api, data=None): def _create_new_iden(): diff --git a/static-data/official-plugins/wot/wot/identity/identityset.py b/static-data/official-plugins/wot/wot/identity/identityset.py index b2a1cf45..7bd3c8d5 100644 --- a/static-data/official-plugins/wot/wot/identity/identityset.py +++ b/static-data/official-plugins/wot/wot/identity/identityset.py @@ -1,3 +1,5 @@ +import base64 + class IdentitySet(set): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -32,7 +34,7 @@ identities = IdentitySet() def serialize_identity_set(): serialized_idens = [] for identity in list(identities): - serialized_idens.append(identity.serialize()) + serialized_idens.append(base64.b85encode(identity.serialize()).decode('utf-8')) return serialized_idens serialize_identity_set.json_compatible = True \ No newline at end of file diff --git a/static-data/official-plugins/wot/wot/wotkeyring/__init__.py b/static-data/official-plugins/wot/wot/wotkeyring/__init__.py index 7177d7eb..a4483839 100644 --- a/static-data/official-plugins/wot/wot/wotkeyring/__init__.py +++ b/static-data/official-plugins/wot/wot/wotkeyring/__init__.py @@ -1,15 +1,18 @@ import base64 + import keyring +import nacl.signing import wot.identity def get_identity_by_name(name: str) -> 'Identity': iden_key = keyring.get_credential('onionr.wot', name) - iden_key = base64.b85decode(iden_key) - if not iden_key: raise KeyError('Identity not found') + iden_key = base64.b85decode(iden_key.password) + iden_key = nacl.signing.SigningKey(iden_key) + return wot.identity.Identity(iden_key, name)