summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-11-19 00:03:33 -0400
committerKali Kaneko <kali@leap.se>2015-11-19 00:26:13 -0400
commit51de36f941be0a8310fe30343cf559d5f97ba18e (patch)
treeee3875e9874d6bc901eafb484e6bf3f0a9d757d3
parent09a312e9b269f45ef46680a64b32560279798590 (diff)
documentation cleanup
-rw-r--r--README.rst3
-rw-r--r--src/leap/bonafide/_protocol.py2
-rw-r--r--src/leap/bonafide/_srp.py2
-rw-r--r--src/leap/bonafide/ssh_service.py2
-rw-r--r--src/leap/bonafide/ws_service.py1
-rw-r--r--src/leap/bonafide/zmq_service.py14
6 files changed, 18 insertions, 6 deletions
diff --git a/README.rst b/README.rst
index 1a4e44e..2e10764 100644
--- a/README.rst
+++ b/README.rst
@@ -3,7 +3,8 @@ Bonafide
Bonafide is the protocol for secure user registration, authentication, and provider discovery for the LEAP
applications. See the `Bonafide`_ design docs.
-This is a client implementation, written in python.
+This is a client implementation, written in python. It consists of a python library, a
+twisted service and a command-line interface to interact locally with it.
.. _`Bonafide`: https://leap.se/en/docs/design/bonafide
diff --git a/src/leap/bonafide/_protocol.py b/src/leap/bonafide/_protocol.py
index b093b9c..6a1c3d2 100644
--- a/src/leap/bonafide/_protocol.py
+++ b/src/leap/bonafide/_protocol.py
@@ -115,7 +115,7 @@ class BonafideProtocol(object):
return d
def do_stats(self):
- log.msg('Calculating Bonafide STATS')
+ log.msg('Calculating Bonafide Service STATS')
mem = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
return '[+] Bonafide service: [%s sessions] [Mem usage: %s KB]' % (
len(self._sessions), mem / 1024)
diff --git a/src/leap/bonafide/_srp.py b/src/leap/bonafide/_srp.py
index 4f4a605..1c711f3 100644
--- a/src/leap/bonafide/_srp.py
+++ b/src/leap/bonafide/_srp.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# srp_auth.py
+# _srp.py
# Copyright (C) 2015 LEAP
#
# This program is free software: you can redistribute it and/or modify
diff --git a/src/leap/bonafide/ssh_service.py b/src/leap/bonafide/ssh_service.py
new file mode 100644
index 0000000..3777b10
--- /dev/null
+++ b/src/leap/bonafide/ssh_service.py
@@ -0,0 +1,2 @@
+# TODO expose bonafide protocol through ssh, accessible through a hidden
+# service
diff --git a/src/leap/bonafide/ws_service.py b/src/leap/bonafide/ws_service.py
new file mode 100644
index 0000000..feaa4b0
--- /dev/null
+++ b/src/leap/bonafide/ws_service.py
@@ -0,0 +1 @@
+# TODO expose bonafide protocol through websockets
diff --git a/src/leap/bonafide/zmq_service.py b/src/leap/bonafide/zmq_service.py
index df8e234..38c0305 100644
--- a/src/leap/bonafide/zmq_service.py
+++ b/src/leap/bonafide/zmq_service.py
@@ -14,11 +14,13 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
"""
Bonafide ZMQ Service.
"""
+
from leap.bonafide import config
-from leap.bonafide.protocol import BonafideProtocol, COMMANDS
+from leap.bonafide._protocol import BonafideProtocol, COMMANDS
from txzmq import ZmqEndpoint, ZmqFactory, ZmqREPConnection
@@ -27,6 +29,8 @@ from twisted.internet import reactor
from twisted.python import log
+# TODO [] should shutdown all the ongoing connections when stopping the service
+
class BonafideZMQService(service.Service):
def __init__(self):
@@ -36,9 +40,14 @@ class BonafideZMQService(service.Service):
def startService(self):
zf = ZmqFactory()
e = ZmqEndpoint("bind", config.ENDPOINT)
+
self._conn = _BonafideZmqREPConnection(zf, e, self._bonafide)
reactor.callWhenRunning(self._conn.do_greet)
+ #def stopService(self):
+ # pass
+
+
class _BonafideZmqREPConnection(ZmqREPConnection):
@@ -50,7 +59,7 @@ class _BonafideZmqREPConnection(ZmqREPConnection):
print "Bonafide service running..."
def do_bye(self):
- print "[+] Bonafide service stopped. Have a nice day."
+ print "Bonafide service stopped. Have a nice day."
reactor.stop()
def gotMessage(self, msgId, *parts):
@@ -59,7 +68,6 @@ class _BonafideZmqREPConnection(ZmqREPConnection):
def log_err(failure):
log.err(failure)
- print "FAILURE", failure
defer_reply("ERROR: %r" % failure)
cmd = parts[0]