finally! abolishing private key property

operator-time
quadrismegistus 4 years ago
parent 748493e1fa
commit ff5c4acffc

@ -51,7 +51,7 @@ class Crypt(Logger):
if not k: return b''
# self.log('prefix???',type(prefix),prefix)
k_b = self.force_binary(k)
self.log(type(k_b),k_b)
# self.log(type(k_b),k_b)
# k_s = k_b.decode()
# self.log(type(k_s),k_s)
# k_s2 = prefix + k_s

@ -9,10 +9,8 @@ def tor_request(url):
# return tor_request_in_proxy(url)
async def tor_request_async(url):
try:
return await tor_request_in_python_async(url)
except TypeError:
return None
return await tor_request_in_python_async(url)
def tor_request_in_proxy(url):
with get_tor_proxy_session() as s:
@ -29,13 +27,8 @@ async def tor_request_in_python_async(url):
s.headers.update({'User-Agent': 'Mozilla/5.0'})
s.mount('http://', adapter)
s.mount('https://', adapter)
try:
r = await s.get(url, timeout=60)
except TypeError:
r = None
# raise Exception(type(r))
# await r
return r
return await s.get(url, timeout=60)
def tor_request_in_python(url):
tor = TorClient()

@ -24,7 +24,8 @@ class TheTelephone(Operator):
# if not OPERATOR: OPERATOR=TheOperator()
# return OPERATOR
async def dial_operator(self,msg):
# async def dial_operator(self,msg):
def dial_operator(self,msg):
msg=msg.replace('/','_')
URL = OPERATOR_API_URL + msg + '/'
self.log("DIALING THE OPERATOR:",URL)
@ -32,13 +33,17 @@ class TheTelephone(Operator):
# self.log(cmd)
# os.system(cmd)
# exit()
r=await tor_request_async(URL)
# r=await tor_request_async(URL)
r=tor_request(URL)
self.log('result!?!?!',r)
return r
async def req(self,json_coming_from_phone={},json_coming_from_caller={},caller=None):
# async def req(self,json_coming_from_phone={},json_coming_from_caller={},caller=None):
def req(self,json_coming_from_phone={},json_coming_from_caller={},caller=None):
if not caller: caller=self.caller
self.log(f"""
RING RING!
@ -97,7 +102,8 @@ class TheTelephone(Operator):
req_data_encr_b64_str = req_data_encr_b64.decode('utf-8')
#try:
res = await self.dial_operator(req_data_encr_b64_str)
res = self.dial_operator(req_data_encr_b64_str)
# res = await self.dial_operator(req_data_encr_b64_str)
#except TypeError:
# res = None
self.log('result from operator?',res)
@ -117,7 +123,8 @@ def test_call():
# req_json_s = jsonify(req_json)
# res = phone.req({'forge_new_keys':{'name':'marx', 'pubkey_is_public':True}})
# print(res)
asyncio.run(caller.get_new_keys())
# asyncio.run(caller.get_new_keys())
caller.get_new_keys()
print('YEAH COOL')

Loading…
Cancel
Save