Merge pull request #1079 from SwartzCr/issue_611

Fixed nits with plugin choice
This commit is contained in:
bmw
2015-10-28 16:43:28 -07:00
3 changed files with 20 additions and 12 deletions
+3 -1
View File
@@ -50,7 +50,9 @@ class PluginEntryPointTest(unittest.TestCase):
name, PluginEntryPoint.entry_point_to_plugin_name(entry_point))
def test_description(self):
self.assertEqual("Standalone Authenticator", self.plugin_ep.description)
self.assertEqual(
"Automatically configure and run a simple webserver",
self.plugin_ep.description)
def test_description_with_name(self):
self.plugin_ep.plugin_cls = mock.MagicMock(description="Desc")
+12 -8
View File
@@ -26,13 +26,18 @@ logger = logging.getLogger(__name__)
class Authenticator(common.Plugin):
"""Manual Authenticator.
.. todo:: Support for `~.challenges.DVSNI`.
This plugin requires user's manual intervention in setting up a HTTP
server for solving SimpleHTTP challenges and thus does not need to be
run as a privilidged process. Alternatively shows instructions on how
to use Python's built-in HTTP server.
.. todo:: Support for `~.challenges.DVSNI`.
"""
zope.interface.implements(interfaces.IAuthenticator)
zope.interface.classProvides(interfaces.IPluginFactory)
hidden = True
description = "Manual Authenticator"
description = "Manually configure and run a simple Python webserver"
MESSAGE_TEMPLATE = """\
Make sure your web server displays the following content at
@@ -89,12 +94,11 @@ s.serve_forever()" """
pass # pragma: no cover
def more_info(self): # pylint: disable=missing-docstring,no-self-use
return """\
This plugin requires user's manual intervention in setting up a HTTP
server for solving SimpleHTTP challenges and thus does not need to be
run as a privilidged process. Alternatively shows instructions on how
to use Python's built-in HTTP server and, in case of HTTPS, openssl
binary for temporary key/certificate generation.""".replace("\n", "")
return ("This plugin requires user's manual intervention in setting "
"up a HTTP server for solving SimpleHTTP challenges and thus "
"does not need to be run as a privilidged process. "
"Alternatively shows instructions on how to use Python's "
"built-in HTTP server.")
def get_chall_pref(self, domain):
# pylint: disable=missing-docstring,no-self-use,unused-argument
+5 -3
View File
@@ -140,12 +140,11 @@ class Authenticator(common.Plugin):
necessary port in order to respond to incoming DVSNI and SimpleHTTP
challenges from the certificate authority. Therefore, it does not
rely on any existing server program.
"""
zope.interface.implements(interfaces.IAuthenticator)
zope.interface.classProvides(interfaces.IPluginFactory)
description = "Standalone Authenticator"
description = "Automatically configure and run a simple webserver"
def __init__(self, *args, **kwargs):
super(Authenticator, self).__init__(*args, **kwargs)
@@ -191,7 +190,10 @@ class Authenticator(common.Plugin):
return necessary_ports
def more_info(self): # pylint: disable=missing-docstring
return self.__doc__
return("This authenticator creates its own ephemeral TCP listener "
"on the necessary port in order to respond to incoming DVSNI "
"and SimpleHTTP challenges from the certificate authority. "
"Therefore, it does not rely on any existing server program.")
def prepare(self): # pylint: disable=missing-docstring
pass