summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/bonafide
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2016-09-29 11:45:24 -0500
committerKali Kaneko (leap communications) <kali@leap.se>2016-10-04 01:37:03 -0400
commit8589bd13c7aa9054dc27d8b3be5ede9ebffb6abe (patch)
tree8a0b6c1e8c7cbb4bce09c71bfb4ea4589742ba85 /src/leap/bitmask/bonafide
parent082b08a0c856950fc0013da49c8a9d1ffc358f6c (diff)
[feat] list active users
- Resolves: 8488
Diffstat (limited to 'src/leap/bitmask/bonafide')
-rw-r--r--src/leap/bitmask/bonafide/_protocol.py7
-rw-r--r--src/leap/bitmask/bonafide/service.py3
2 files changed, 10 insertions, 0 deletions
diff --git a/src/leap/bitmask/bonafide/_protocol.py b/src/leap/bitmask/bonafide/_protocol.py
index 7917f383..01919c7d 100644
--- a/src/leap/bitmask/bonafide/_protocol.py
+++ b/src/leap/bitmask/bonafide/_protocol.py
@@ -147,6 +147,13 @@ class BonafideProtocol(object):
d.addCallback(lambda _: '%s logged out' % full_id)
return d
+ def do_list_users(self):
+ users = []
+ for user, session in self._sessions.items():
+ users.append({'userid': user,
+ 'authenticated': session.is_authenticated})
+ return users
+
def do_change_password(self, full_id, current_password, new_password):
log.msg('Change password for %s' % full_id)
if (full_id not in self._sessions or
diff --git a/src/leap/bitmask/bonafide/service.py b/src/leap/bitmask/bonafide/service.py
index 1f0d6362..fbe6846e 100644
--- a/src/leap/bitmask/bonafide/service.py
+++ b/src/leap/bitmask/bonafide/service.py
@@ -106,6 +106,9 @@ class BonafideService(HookableService):
d.addCallback(lambda response: {'logout': 'ok'})
return d
+ def do_list_users(self):
+ return self._bonafide.do_list_users()
+
def do_change_password(self, username, current_password, new_password):
def notify_passphrase_change(_):
data = dict(username=username, password=new_password)