summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/bonafide/service.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2017-02-01 14:49:45 +0100
committerKali Kaneko (leap communications) <kali@leap.se>2017-02-23 00:40:31 +0100
commit1d4a3d68869dd9c416b104399097a6bb0c1bace3 (patch)
tree9afc38280e17a84e55184f064cf34f1a490ac539 /src/leap/bitmask/bonafide/service.py
parent6d1d18faec5caa60c26b8245f0ab17c63d0b80d8 (diff)
[feature] new commands: get_cert
Diffstat (limited to 'src/leap/bitmask/bonafide/service.py')
-rw-r--r--src/leap/bitmask/bonafide/service.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/leap/bitmask/bonafide/service.py b/src/leap/bitmask/bonafide/service.py
index 37d1e21..69aac2d 100644
--- a/src/leap/bitmask/bonafide/service.py
+++ b/src/leap/bitmask/bonafide/service.py
@@ -120,7 +120,21 @@ class BonafideService(HookableService):
def do_provider_list(self, seeded=False):
return self._bonafide.do_provider_list(seeded)
- def do_get_smtp_cert(self, username):
+ # TODO make username mandatory
+ # and move active_user to the cli machinery
+ def do_get_vpn_cert(self, username=None):
+ if not username:
+ username = self._active_user
+ if not username:
+ return defer.fail(
+ RuntimeError('No active user, cannot get VPN cert.'))
+ d = self._bonafide.do_get_vpn_cert(username)
+ d.addCallback(lambda response: (username, response))
+ return d
+
+ def do_get_smtp_cert(self, username=None):
+ if not username:
+ username = self._active_user
if not username:
return defer.fail(
RuntimeError('No username, cannot get SMTP cert.'))