keychain-uses-objects
quadrismegistus 4 years ago
parent 479c4e012e
commit 031f6367a9

@ -26,6 +26,7 @@ class TheSwitchboard(FlaskView, Logger):
def get(self,data_b64_str_esc): def get(self,data_b64_str_esc):
clear_screen()
self.log('Incoming call!:',data_b64_str_esc) self.log('Incoming call!:',data_b64_str_esc)
if not data_b64_str_esc: if not data_b64_str_esc:
self.log('empty request!') self.log('empty request!')
@ -53,7 +54,7 @@ def run_forever(port='8080'):
# OP_PASS = getpass('@op pass? ') # OP_PASS = getpass('@op pass? ')
TELEPHONE = TheTelephone() TELEPHONE = TheTelephone()
OPERATOR = TheOperator() OPERATOR = TheOperator()
print(OPERATOR,'!?',OPERATOR.keychain()) # print(OPERATOR,'!?',OPERATOR.keychain())
app = Flask(__name__) app = Flask(__name__)
TheSwitchboard.register(app, route_base='/op/', route_prefix=None) TheSwitchboard.register(app, route_base='/op/', route_prefix=None)
app.run(debug=False, port=port, host='0.0.0.0') app.run(debug=False, port=port, host='0.0.0.0')

@ -61,7 +61,8 @@ class TheOperator(Operator):
# ends the ring_ring() chain # ends the ring_ring() chain
def answer_phone(self,data_b): def answer_phone(self,data_b):
# route incoming call from the switchboard # route incoming call from the switchboard
self.log('Hello, this is the Operator. I heard you say:\n\n',b64encode(data_b)) from komrade.cli.artcode import ART_OLDPHONE4
self.log(f'{ART_OLDPHONE4}\nHello, this is the Operator. I heard you say:\n\n',b64encode(data_b))
# unseal # unseal
msg_obj = self.unseal_msg( msg_obj = self.unseal_msg(
@ -69,14 +70,14 @@ class TheOperator(Operator):
from_whom=self.phone, from_whom=self.phone,
to_whom = self to_whom = self
) )
self.log(f'Operator understood message: {msg_obj} {msg_obj.route}') self.log(f'Operator understood message: {msg_obj}')
# decrypt? # decrypt?
msg_obj.decrypt() msg_obj.decrypt()
# carry out message instructions # carry out message instructions
resp_msg_obj = self.pronto_pronto(msg_obj) #,route=msg_obj.route) resp_msg_obj = self.pronto_pronto(msg_obj) #,route=msg_obj.route)
self.log('route_result <-',resp_msg_obj) # self.log('route_result <-',resp_msg_obj)
# send back down encrypted # send back down encrypted

Loading…
Cancel
Save