letsencrypt.plugins.disco

Utilities for plugins discovery and selection.

class letsencrypt.plugins.disco.PluginEntryPoint(entry_point)[source]

Bases: object

Plugin entry point.

PREFIX_FREE_DISTRIBUTIONS = ['letsencrypt', 'letsencrypt-apache', 'letsencrypt-nginx']

Distributions for which prefix will be omitted.

classmethod entry_point_to_plugin_name(entry_point)[source]

Unique plugin name for an entry_point

description

Description of the plugin.

description_with_name

Description with name. Handy for UI.

hidden

Should this plugin be hidden from UI?

ifaces(*ifaces_groups)[source]

Does plugin implements specified interface groups?

initialized

Has the plugin been initialized already?

init(config=None)[source]

Memoized plugin inititialization.

verify(ifaces)[source]

Verify that the plugin conforms to the specified interfaces.

prepared

Has the plugin been prepared already?

prepare()[source]

Memoized plugin preparation.

misconfigured

Is plugin misconfigured?

problem

Return the Exception raised during plugin setup, or None if all is well

available

Is plugin available, i.e. prepared or misconfigured?

class letsencrypt.plugins.disco.PluginsRegistry(plugins)[source]

Bases: _abcoll.Mapping

Plugins registry.

classmethod find_all()[source]

Find plugins using setuptools entry points.

init(config)[source]

Initialize all plugins in the registry.

filter(pred)[source]

Filter plugins based on predicate.

visible()[source]

Filter plugins based on visibility.

ifaces(*ifaces_groups)[source]

Filter plugins based on interfaces.

verify(ifaces)[source]

Filter plugins based on verification.

prepare()[source]

Prepare all plugins in the registry.

available()[source]

Filter plugins based on availability.

find_init(plugin)[source]

Find an initialized plugin.

This is particularly useful for finding a name for the plugin (although IPluginFactory.__call__ takes name as one of the arguments, IPlugin.name is not part of the interface):

# plugin is an instance providing IPlugin, initialized
# somewhere else in the code
plugin_registry.find_init(plugin).name

Returns None if plugin is not found in the registry.