summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/cli
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-07-18 15:43:35 +0200
committerKali Kaneko <kali@leap.se>2017-08-24 17:13:39 -0400
commit8cebf955ad71975a20275a780a67b31099759e3a (patch)
tree998562d9398e0aee9b7adb7cfbb28170b816c00a /src/leap/bitmask/cli
parent3b4508dff9dc1a681f3c96edcef4e43aa3da29a8 (diff)
[feat] add a mock mixnet_status call to the API
For now we say it will be mixed on every request if the mixnet is enabled. We might want a better mock in the future. - Resolves: #8972
Diffstat (limited to 'src/leap/bitmask/cli')
-rw-r--r--src/leap/bitmask/cli/mail.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/leap/bitmask/cli/mail.py b/src/leap/bitmask/cli/mail.py
index 1624606a..21b93c24 100644
--- a/src/leap/bitmask/cli/mail.py
+++ b/src/leap/bitmask/cli/mail.py
@@ -20,8 +20,6 @@ Bitmask Command Line interface: mail
import argparse
import sys
-from colorama import Fore
-
from leap.bitmask.cli import command
@@ -58,3 +56,22 @@ SUBCOMMANDS:
self.data += ['status', uid]
return self._send(command.print_status)
+
+ def mixnet_status(self, raw_args):
+ parser = argparse.ArgumentParser(
+ description='Bitmask mixnet status',
+ prog='%s %s %s' % tuple(sys.argv[:3]))
+ parser.add_argument('-u', '--userid', default='',
+ help='uid to check the status of')
+ parser.add_argument('address', nargs=1,
+ help='the recipient address')
+ subargs = parser.parse_args(raw_args)
+
+ userid = None
+ if subargs.userid:
+ userid = subargs.userid
+ else:
+ userid = self.cfg.get('bonafide', 'active', default=None)
+ self.data += ['mixnet_status', userid, subargs.address[0]]
+
+ return self._send(command.default_dict_printer)