Started on trust identity CLI menu option
This commit is contained in:
parent
8e730cef98
commit
8e35a79864
@ -11,10 +11,12 @@ import requests_unixsocket
|
|||||||
from logger import log as logging
|
from logger import log as logging
|
||||||
import onionrplugins.pluginapis
|
import onionrplugins.pluginapis
|
||||||
|
|
||||||
|
from .trustidentity import trust_identity
|
||||||
|
|
||||||
def do_quit(): raise KeyboardInterrupt
|
def do_quit(): raise KeyboardInterrupt
|
||||||
|
|
||||||
|
|
||||||
rpc_payload = {
|
rpc_payload_template = {
|
||||||
"method": "echo",
|
"method": "echo",
|
||||||
"params": ["example"],
|
"params": ["example"],
|
||||||
"jsonrpc": "2.0",
|
"jsonrpc": "2.0",
|
||||||
@ -24,14 +26,14 @@ rpc_payload = {
|
|||||||
|
|
||||||
def list_idens():
|
def list_idens():
|
||||||
print('Listing identities')
|
print('Listing identities')
|
||||||
payload = dict(rpc_payload)
|
payload = dict(rpc_payload_template)
|
||||||
payload['method'] = 'wot.serialize_identity_set'
|
payload['method'] = 'wot.serialize_identity_set'
|
||||||
del payload['params']
|
del payload['params']
|
||||||
print(onionrplugins.pluginapis.plugin_apis['rpc.rpc_client'](json=payload).text)
|
print(onionrplugins.pluginapis.plugin_apis['rpc.rpc_client'](json=payload).text)
|
||||||
|
|
||||||
|
|
||||||
def ping_api() -> result.Result:
|
def ping_api() -> result.Result:
|
||||||
payload = dict(rpc_payload)
|
payload = dict(rpc_payload_template)
|
||||||
payload['method'] = 'ping'
|
payload['method'] = 'ping'
|
||||||
del payload['params']
|
del payload['params']
|
||||||
try:
|
try:
|
||||||
@ -51,6 +53,7 @@ def ping_api() -> result.Result:
|
|||||||
|
|
||||||
main_menu = {
|
main_menu = {
|
||||||
'l': (list_idens, 'list trusted identities'),
|
'l': (list_idens, 'list trusted identities'),
|
||||||
|
't': (trust_identity, 'trust identity'),
|
||||||
'q': (do_quit, 'quit CLI')
|
'q': (do_quit, 'quit CLI')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1 +1,3 @@
|
|||||||
def trust_identity():
|
def trust_identity():
|
||||||
|
print('Which identity would you like to trust?')
|
||||||
|
identity = input('Identity: ')
|
||||||
|
Loading…
Reference in New Issue
Block a user