mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 00:35:50 +02:00
common.Plugin (with .conf(var), PluginEntryPoint, PluginRegistry
This commit is contained in:
@@ -1,18 +1,27 @@
|
||||
"""Example Let's Encrypt plugins."""
|
||||
"""Example Let's Encrypt plugins.
|
||||
|
||||
For full examples, see `letsencrypt.client.plugins`.
|
||||
|
||||
"""
|
||||
import zope.interface
|
||||
|
||||
from letsencrypt.client import interfaces
|
||||
from letsencrypt.client.plugins import common
|
||||
|
||||
|
||||
class Authenticator(object):
|
||||
class Authenticator(common.Plugin):
|
||||
zope.interface.implements(interfaces.IAuthenticator)
|
||||
|
||||
description = 'Example Authenticator plugin'
|
||||
|
||||
def __init__(self, config):
|
||||
self.config = config
|
||||
|
||||
# Implement all methods from IAuthenticator, remembering to add
|
||||
# "self" as first argument, e.g. def prepare(self)...
|
||||
|
||||
# For full examples, see letsencrypt.client.plugins
|
||||
|
||||
class Installer(common.Plugins):
|
||||
zope.interface.implements(interfaces.IInstaller)
|
||||
|
||||
description = 'Example Installer plugin'
|
||||
|
||||
# Implement all methods from IInstaller, remembering to add
|
||||
# "self" as first argument, e.g. def get_all_names(self)...
|
||||
|
||||
@@ -10,7 +10,8 @@ setup(
|
||||
],
|
||||
entry_points={
|
||||
'letsencrypt.plugins': [
|
||||
'example = letsencrypt_example_plugins:Authenticator',
|
||||
'example_authenticator = letsencrypt_example_plugins:Authenticator',
|
||||
'example_installer = letsencrypt_example_plugins:Installer',
|
||||
],
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user