mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Remove all non essential references to the old Zope interfaces (#8988)
As a follow-up to #8971, this PR removes all references to the old Zope interfaces, except the ones used to deprecate them and prepare for their removal. In the process, some documentation and tests about the `Display` objects are simply removed since they are not relevant anymore given that they are removed from the public API. * Cleanup some interfaces.IInstaller * Cleanup IConfig doc * Allmost complete removal * Remove useless tests * Fixes * More cleanup * More cleanup * More cleanup * Remove a non existent reference * Better type * Fix lint
This commit is contained in:
parent
acf48df979
commit
143ea15253
32 changed files with 206 additions and 218 deletions
|
|
@ -121,7 +121,7 @@ class ApacheConfigurator(common.Installer, interfaces.Authenticator):
|
|||
"""Apache configurator.
|
||||
|
||||
:ivar config: Configuration.
|
||||
:type config: :class:`~certbot.interfaces.IConfig`
|
||||
:type config: certbot.configuration.NamespaceConfig
|
||||
|
||||
:ivar parser: Handles low level parsing
|
||||
:type parser: :class:`~certbot_apache._internal.parser`
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@ import pkg_resources
|
|||
from certbot.compat import os
|
||||
|
||||
MOD_SSL_CONF_DEST = "options-ssl-apache.conf"
|
||||
"""Name of the mod_ssl config file as saved in `IConfig.config_dir`."""
|
||||
"""Name of the mod_ssl config file as saved
|
||||
in `certbot.configuration.NamespaceConfig.config_dir`."""
|
||||
|
||||
|
||||
UPDATED_MOD_SSL_CONF_DIGEST = ".updated-options-ssl-apache-conf-digest.txt"
|
||||
"""Name of the hash of the updated or informed mod_ssl_conf as saved in `IConfig.config_dir`."""
|
||||
"""Name of the hash of the updated or informed mod_ssl_conf as saved
|
||||
in `certbot.configuration.NamespaceConfig.config_dir`."""
|
||||
|
||||
# NEVER REMOVE A SINGLE HASH FROM THIS LIST UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING!
|
||||
ALL_SSL_OPTIONS_HASHES = [
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
""" Distribution specific override class for Void Linux """
|
||||
import zope.interface
|
||||
|
||||
from certbot import interfaces
|
||||
from certbot_apache._internal import configurator
|
||||
from certbot_apache._internal.configurator import OsOptions
|
||||
|
||||
|
||||
@zope.interface.provider(interfaces.IPluginFactory)
|
||||
class VoidConfigurator(configurator.ApacheConfigurator):
|
||||
"""Void Linux specific ApacheConfigurator override class"""
|
||||
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ def setup_logging(args):
|
|||
|
||||
|
||||
def setup_display():
|
||||
""""Prepares IDisplay for the Certbot plugins """
|
||||
""""Prepares a display utility instace for the Certbot plugins """
|
||||
displayer = display_util.NoninteractiveDisplay(sys.stdout)
|
||||
display_obj.set_display(displayer)
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class NginxConfigurator(common.Installer, interfaces.Authenticator):
|
|||
config files modified by the configurator will lose all their comments.
|
||||
|
||||
:ivar config: Configuration.
|
||||
:type config: :class:`~certbot.interfaces.IConfig`
|
||||
:type config: certbot.configuration.NamespaceConfig
|
||||
|
||||
:ivar parser: Handles low level parsing
|
||||
:type parser: :class:`~certbot_nginx._internal.parser`
|
||||
|
|
@ -744,7 +744,7 @@ class NginxConfigurator(common.Installer, interfaces.Authenticator):
|
|||
vhost, ssl_block)
|
||||
|
||||
##################################
|
||||
# enhancement methods (IInstaller)
|
||||
# enhancement methods (Installer)
|
||||
##################################
|
||||
def supported_enhancements(self):
|
||||
"""Returns currently supported enhancements."""
|
||||
|
|
@ -956,7 +956,7 @@ class NginxConfigurator(common.Installer, interfaces.Authenticator):
|
|||
self.save_notes += "\tssl_stapling_verify on\n"
|
||||
|
||||
######################################
|
||||
# Nginx server management (IInstaller)
|
||||
# Nginx server management (Installer)
|
||||
######################################
|
||||
def restart(self):
|
||||
"""Restarts nginx server.
|
||||
|
|
@ -1086,7 +1086,7 @@ class NginxConfigurator(common.Installer, interfaces.Authenticator):
|
|||
)
|
||||
|
||||
###################################################
|
||||
# Wrapper functions for Reverter class (IInstaller)
|
||||
# Wrapper functions for Reverter class (Installer)
|
||||
###################################################
|
||||
def save(self, title=None, temporary=False):
|
||||
"""Saves all changes to the configuration files.
|
||||
|
|
@ -1148,7 +1148,7 @@ class NginxConfigurator(common.Installer, interfaces.Authenticator):
|
|||
self.parser.load()
|
||||
|
||||
###########################################################################
|
||||
# Challenges Section for IAuthenticator
|
||||
# Challenges Section for Authenticator
|
||||
###########################################################################
|
||||
def get_chall_pref(self, unused_domain):
|
||||
"""Return list of challenge preferences."""
|
||||
|
|
|
|||
|
|
@ -23,10 +23,12 @@ CLI_DEFAULTS: Dict[str, Any] = dict(
|
|||
|
||||
|
||||
MOD_SSL_CONF_DEST = "options-ssl-nginx.conf"
|
||||
"""Name of the mod_ssl config file as saved in `IConfig.config_dir`."""
|
||||
"""Name of the mod_ssl config file as saved
|
||||
in `certbot.configuration.NamespaceConfig.config_dir`."""
|
||||
|
||||
UPDATED_MOD_SSL_CONF_DIGEST = ".updated-options-ssl-nginx-conf-digest.txt"
|
||||
"""Name of the hash of the updated or informed mod_ssl_conf as saved in `IConfig.config_dir`."""
|
||||
"""Name of the hash of the updated or informed mod_ssl_conf as saved
|
||||
in `certbot.configuration.NamespaceConfig.config_dir`."""
|
||||
|
||||
ALL_SSL_OPTIONS_HASHES = [
|
||||
'0f81093a1465e3d4eaa8b0c14e77b2a2e93568b0fc1351c2b87893a95f0de87c',
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ class RegistrationResourceWithNewAuthzrURI(messages.RegistrationResource):
|
|||
class AccountFileStorage(interfaces.AccountStorage):
|
||||
"""Accounts file storage.
|
||||
|
||||
:ivar .IConfig config: Client configuration
|
||||
:ivar certbot.configuration.NamespaceConfig config: Client configuration
|
||||
|
||||
"""
|
||||
def __init__(self, config):
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class AuthHandler:
|
|||
|
||||
:ivar auth: Authenticator capable of solving
|
||||
:class:`~acme.challenges.Challenge` types
|
||||
:type auth: :class:`certbot.interfaces.IAuthenticator`
|
||||
:type auth: certbot.interfaces.Authenticator
|
||||
|
||||
:ivar acme.client.BackwardsCompatibleClientV2 acme_client: ACME client API.
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ class AuthHandler:
|
|||
Retrieve all authorizations, perform all challenges required to validate
|
||||
these authorizations, then poll and wait for the authorization to be checked.
|
||||
:param acme.messages.OrderResource orderr: must have authorizations filled in
|
||||
:param interfaces.IConfig config: current Certbot configuration
|
||||
:param certbot.configuration.NamespaceConfig config: current Certbot configuration
|
||||
:param bool best_effort: if True, not all authorizations need to be validated (eg. renew)
|
||||
:param int max_retries: maximum number of retries to poll authorizations
|
||||
:returns: list of all validated authorizations
|
||||
|
|
@ -415,8 +415,7 @@ def _report_no_chall_path(challbs):
|
|||
raise errors.AuthorizationError(msg)
|
||||
|
||||
|
||||
def _generate_failed_chall_msg(failed_achalls):
|
||||
# type: (List[achallenges.AnnotatedChallenge]) -> str
|
||||
def _generate_failed_chall_msg(failed_achalls: List[achallenges.AnnotatedChallenge]) -> str:
|
||||
"""Creates a user friendly error message about failed challenges.
|
||||
|
||||
:param list failed_achalls: A list of failed
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ def register(config, account_storage, tos_cb=None):
|
|||
and finally saving the account. It should be called prior to
|
||||
initialization of `Client`, unless account has already been created.
|
||||
|
||||
:param .IConfig config: Client configuration.
|
||||
:param certbot.configuration.NamespaceConfig config: Client configuration.
|
||||
|
||||
:param .AccountStorage account_storage: Account storage where newly
|
||||
registered account will be saved to. Save happens only after TOS
|
||||
|
|
@ -196,7 +196,7 @@ def perform_registration(acme, config, tos_cb):
|
|||
problems
|
||||
|
||||
:param acme.client.Client client: ACME client object.
|
||||
:param .IConfig config: Client configuration.
|
||||
:param certbot.configuration.NamespaceConfig config: Client configuration.
|
||||
:param Callable tos_cb: a callback to handle Term of Service agreement.
|
||||
|
||||
:returns: Registration Resource.
|
||||
|
|
@ -238,14 +238,14 @@ def perform_registration(acme, config, tos_cb):
|
|||
class Client:
|
||||
"""Certbot's client.
|
||||
|
||||
:ivar .IConfig config: Client configuration.
|
||||
:ivar certbot.configuration.NamespaceConfig config: Client configuration.
|
||||
:ivar .Account account: Account registered with `register`.
|
||||
:ivar .AuthHandler auth_handler: Authorizations handler that will
|
||||
dispatch DV challenges to appropriate authenticators
|
||||
(providing `.IAuthenticator` interface).
|
||||
:ivar .IAuthenticator auth: Prepared (`.IAuthenticator.prepare`)
|
||||
(providing `.Authenticator` interface).
|
||||
:ivar .Authenticator auth: Prepared (`.Authenticator.prepare`)
|
||||
authenticator that can solve ACME challenges.
|
||||
:ivar .IInstaller installer: Installer.
|
||||
:ivar .Installer installer: Installer.
|
||||
:ivar acme.client.BackwardsCompatibleClientV2 acme: Optional ACME
|
||||
client API handle. You might already have one from `register`.
|
||||
|
||||
|
|
@ -719,7 +719,7 @@ def rollback(default_installer, checkpoints, config, plugins):
|
|||
:param int checkpoints: Number of checkpoints to revert.
|
||||
|
||||
:param config: Configuration.
|
||||
:type config: :class:`certbot.interfaces.IConfig`
|
||||
:type config: :class:`certbot.configuration.NamespaceConfiguration`
|
||||
|
||||
"""
|
||||
# Misconfigurations are only a slight problems... allow the user to rollback
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ REVOCATION_REASONS = {
|
|||
"superseded": 4,
|
||||
"cessationofoperation": 5}
|
||||
|
||||
"""Defaults for CLI flags and `.IConfig` attributes."""
|
||||
"""Defaults for CLI flags and `certbot.configuration.NamespaceConfig` attributes."""
|
||||
|
||||
QUIET_LOGGING_LEVEL = logging.ERROR
|
||||
"""Logging level to use in quiet mode."""
|
||||
|
|
@ -156,10 +156,10 @@ RENEWER_DEFAULTS = dict(
|
|||
"""Defaults for renewer script."""
|
||||
|
||||
ARCHIVE_DIR = "archive"
|
||||
"""Archive directory, relative to `IConfig.config_dir`."""
|
||||
"""Archive directory, relative to `certbot.configuration.NamespaceConfig.config_dir`."""
|
||||
|
||||
CONFIG_DIRS_MODE = 0o755
|
||||
"""Directory mode for ``.IConfig.config_dir`` et al."""
|
||||
"""Directory mode for ``certbot.configuration.NamespaceConfig.config_dir`` et al."""
|
||||
|
||||
ACCOUNTS_DIR = "accounts"
|
||||
"""Directory where all accounts are saved."""
|
||||
|
|
@ -173,26 +173,30 @@ LE_REUSE_SERVERS = {
|
|||
"""Servers that can reuse accounts from other servers."""
|
||||
|
||||
BACKUP_DIR = "backups"
|
||||
"""Directory (relative to `IConfig.work_dir`) where backups are kept."""
|
||||
"""Directory (relative to `certbot.configuration.NamespaceConfig.work_dir`)
|
||||
where backups are kept."""
|
||||
|
||||
CSR_DIR = "csr"
|
||||
"""See `.IConfig.csr_dir`."""
|
||||
"""See `certbot.configuration.NamespaceConfig.csr_dir`."""
|
||||
|
||||
IN_PROGRESS_DIR = "IN_PROGRESS"
|
||||
"""Directory used before a permanent checkpoint is finalized (relative to
|
||||
`IConfig.work_dir`)."""
|
||||
`certbot.configuration.NamespaceConfig.work_dir`)."""
|
||||
|
||||
KEY_DIR = "keys"
|
||||
"""Directory (relative to `IConfig.config_dir`) where keys are saved."""
|
||||
"""Directory (relative to `certbot.configuration.NamespaceConfig.config_dir`)
|
||||
where keys are saved."""
|
||||
|
||||
LIVE_DIR = "live"
|
||||
"""Live directory, relative to `IConfig.config_dir`."""
|
||||
"""Live directory, relative to `certbot.configuration.NamespaceConfig.config_dir`."""
|
||||
|
||||
TEMP_CHECKPOINT_DIR = "temp_checkpoint"
|
||||
"""Temporary checkpoint directory (relative to `IConfig.work_dir`)."""
|
||||
"""Temporary checkpoint directory, relative
|
||||
to `certbot.configuration.NamespaceConfig.work_dir`."""
|
||||
|
||||
RENEWAL_CONFIGS_DIR = "renewal"
|
||||
"""Renewal configs directory, relative to `IConfig.config_dir`."""
|
||||
"""Renewal configs directory, relative
|
||||
to `certbot.configuration.NamespaceConfig.config_dir`."""
|
||||
|
||||
RENEWAL_HOOKS_DIR = "renewal-hooks"
|
||||
"""Basename of directory containing hooks to run with the renew command."""
|
||||
|
|
@ -207,20 +211,22 @@ RENEWAL_POST_HOOKS_DIR = "post"
|
|||
"""Basename of directory containing post-hooks to run with the renew command."""
|
||||
|
||||
FORCE_INTERACTIVE_FLAG = "--force-interactive"
|
||||
"""Flag to disable TTY checking in IDisplay."""
|
||||
"""Flag to disable TTY checking in certbot.display.util."""
|
||||
|
||||
EFF_SUBSCRIBE_URI = "https://supporters.eff.org/subscribe/certbot"
|
||||
"""EFF URI used to submit the e-mail address of users who opt-in."""
|
||||
|
||||
SSL_DHPARAMS_DEST = "ssl-dhparams.pem"
|
||||
"""Name of the ssl_dhparams file as saved in `IConfig.config_dir`."""
|
||||
"""Name of the ssl_dhparams file as saved
|
||||
in `certbot.configuration.NamespaceConfig.config_dir`."""
|
||||
|
||||
SSL_DHPARAMS_SRC = pkg_resources.resource_filename(
|
||||
"certbot", "ssl-dhparams.pem")
|
||||
"""Path to the nginx ssl_dhparams file found in the Certbot distribution."""
|
||||
|
||||
UPDATED_SSL_DHPARAMS_DIGEST = ".updated-ssl-dhparams-pem-digest.txt"
|
||||
"""Name of the hash of the updated or informed ssl_dhparams as saved in `IConfig.config_dir`."""
|
||||
"""Name of the hash of the updated or informed ssl_dhparams as saved
|
||||
in `certbot.configuration.NamespaceConfig.config_dir`."""
|
||||
|
||||
ALL_SSL_DHPARAMS_HASHES = [
|
||||
'9ba6429597aeed2d8617a7705b56e96d044f64b07971659382e426675105654b',
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
"""This modules define the actual display implementations used in Certbot"""
|
||||
import logging
|
||||
import sys
|
||||
from typing import Any
|
||||
from typing import Optional
|
||||
from typing import Union
|
||||
|
||||
|
|
@ -241,8 +240,7 @@ class FileDisplay:
|
|||
:param default: default answer to prompt
|
||||
:param str cli_flag: command line option for setting an answer
|
||||
to this question
|
||||
:param bool force_interactive: if interactivity is forced by the
|
||||
IDisplay call
|
||||
:param bool force_interactive: if interactivity is forced
|
||||
|
||||
:returns: True if we should return the default without prompting
|
||||
:rtype: bool
|
||||
|
|
@ -266,8 +264,7 @@ class FileDisplay:
|
|||
def _can_interact(self, force_interactive):
|
||||
"""Can we safely interact with the user?
|
||||
|
||||
:param bool force_interactive: if interactivity is forced by the
|
||||
IDisplay call
|
||||
:param bool force_interactive: if interactivity is forced
|
||||
|
||||
:returns: True if the display can interact with the user
|
||||
:rtype: bool
|
||||
|
|
@ -399,7 +396,7 @@ class FileDisplay:
|
|||
# through the public API in certbot.display.util.
|
||||
@zope.interface.implementer(interfaces.IDisplay)
|
||||
class NoninteractiveDisplay:
|
||||
"""An iDisplay implementation that never asks for interactive user input"""
|
||||
"""An diplay utility implementation that never asks for interactive user input"""
|
||||
|
||||
def __init__(self, outfile, *unused_args, **unused_kwargs):
|
||||
super().__init__()
|
||||
|
|
@ -532,16 +529,11 @@ class NoninteractiveDisplay:
|
|||
return self.input(message, default, cli_flag)
|
||||
|
||||
|
||||
# The two following functions use "Any" for their parameter/output types. Normally interfaces from
|
||||
# certbot.interfaces would be used, but MyPy will not understand their semantic. These interfaces
|
||||
# will be removed soon and replaced by ABC classes that will be used also here for type checking.
|
||||
# TODO: replace Any by actual ABC classes once available
|
||||
|
||||
def get_display() -> Any:
|
||||
def get_display() -> Union[FileDisplay, NoninteractiveDisplay]:
|
||||
"""Get the display utility.
|
||||
|
||||
:return: the display utility
|
||||
:rtype: IDisplay
|
||||
:rtype: Union[FileDisplay, NoninteractiveDisplay]
|
||||
:raise: ValueError if the display utility is not configured yet.
|
||||
|
||||
"""
|
||||
|
|
@ -551,10 +543,10 @@ def get_display() -> Any:
|
|||
return _SERVICE.display
|
||||
|
||||
|
||||
def set_display(display: Any) -> None:
|
||||
def set_display(display: Union[FileDisplay, NoninteractiveDisplay]) -> None:
|
||||
"""Set the display service.
|
||||
|
||||
:param IDisplay display: the display service
|
||||
:param Union[FileDisplay, NoninteractiveDisplay] display: the display service
|
||||
|
||||
"""
|
||||
# This call is done only for retro-compatibility purposes.
|
||||
|
|
|
|||
|
|
@ -4,16 +4,16 @@ from typing import Optional
|
|||
|
||||
import requests
|
||||
|
||||
from certbot import configuration
|
||||
from certbot._internal import constants
|
||||
from certbot._internal.account import Account
|
||||
from certbot._internal.account import AccountFileStorage
|
||||
from certbot.display import util as display_util
|
||||
from certbot.interfaces import IConfig
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def prepare_subscription(config: IConfig, acc: Account) -> None:
|
||||
def prepare_subscription(config: configuration.NamespaceConfig, acc: Account) -> None:
|
||||
"""High level function to store potential EFF newsletter subscriptions.
|
||||
|
||||
The user may be asked if they want to sign up for the newsletter if
|
||||
|
|
@ -22,7 +22,7 @@ def prepare_subscription(config: IConfig, acc: Account) -> None:
|
|||
|
||||
Decision about EFF subscription will be stored in the account metadata.
|
||||
|
||||
:param IConfig config: Client configuration.
|
||||
:param configuration.NamespaceConfig config: Client configuration.
|
||||
:param Account acc: Current client account.
|
||||
|
||||
"""
|
||||
|
|
@ -41,12 +41,12 @@ def prepare_subscription(config: IConfig, acc: Account) -> None:
|
|||
storage.update_meta(acc)
|
||||
|
||||
|
||||
def handle_subscription(config: IConfig, acc: Account) -> None:
|
||||
def handle_subscription(config: configuration.NamespaceConfig, acc: Account) -> None:
|
||||
"""High level function to take care of EFF newsletter subscriptions.
|
||||
|
||||
Once subscription is handled, it will not be handled again.
|
||||
|
||||
:param IConfig config: Client configuration.
|
||||
:param configuration.NamespaceConfig config: Client configuration.
|
||||
:param Account acc: Current client account.
|
||||
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ def post_arg_parse_setup(config):
|
|||
sent to that handler. Terminal logging output is set to the level
|
||||
requested by the user.
|
||||
|
||||
:param certbot.interface.IConfig config: Configuration object
|
||||
:param certbot.configuration.NamespaceConfig config: Configuration object
|
||||
|
||||
"""
|
||||
file_handler, file_path = setup_log_file_handler(
|
||||
|
|
@ -140,7 +140,7 @@ def post_arg_parse_setup(config):
|
|||
def setup_log_file_handler(config, logfile, fmt):
|
||||
"""Setup file debug logging.
|
||||
|
||||
:param certbot.interface.IConfig config: Configuration object
|
||||
:param certbot.configuration.NamespaceConfig config: Configuration object
|
||||
:param str logfile: basename for the log file
|
||||
:param str fmt: logging format string
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ import zope.interface
|
|||
|
||||
from acme import errors as acme_errors
|
||||
import certbot
|
||||
from certbot import crypto_util, configuration
|
||||
from certbot import configuration
|
||||
from certbot import crypto_util
|
||||
from certbot import errors
|
||||
from certbot import interfaces
|
||||
from certbot import util
|
||||
|
|
@ -59,7 +60,7 @@ def _suggest_donation_if_appropriate(config):
|
|||
"""Potentially suggest a donation to support Certbot.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:returns: `None`
|
||||
:rtype: None
|
||||
|
|
@ -86,7 +87,7 @@ def _get_and_save_cert(le_client, config, domains=None, certname=None, lineage=N
|
|||
checks, and requests for user input.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param domains: List of domain names to get a certificate. Defaults to `None`
|
||||
:type domains: `list` of `str`
|
||||
|
|
@ -166,7 +167,7 @@ def _handle_subset_cert_request(config: configuration.NamespaceConfig,
|
|||
"""Figure out what to do if a previous cert had a subset of the names now requested
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param domains: List of domain names
|
||||
:type domains: `list` of `str`
|
||||
|
|
@ -213,7 +214,7 @@ def _handle_identical_cert_request(config: configuration.NamespaceConfig,
|
|||
"""Figure out what to do if a lineage has the same names as a previously obtained one
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param lineage: Certificate lineage object
|
||||
:type lineage: storage.RenewableCert
|
||||
|
|
@ -267,7 +268,7 @@ def _find_lineage_for_domains(config, domains):
|
|||
prompted).
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param domains: List of domain names
|
||||
:type domains: `list` of `str`
|
||||
|
|
@ -304,7 +305,7 @@ def _find_cert(config, domains, certname):
|
|||
"""Finds an existing certificate object given domains and/or a certificate name.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param domains: List of domain names
|
||||
:type domains: `list` of `str`
|
||||
|
|
@ -331,7 +332,7 @@ def _find_lineage_for_domains_and_certname(config: configuration.NamespaceConfig
|
|||
"""Find appropriate lineage based on given domains and/or certname.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param domains: List of domain names
|
||||
:type domains: `list` of `str`
|
||||
|
|
@ -392,7 +393,7 @@ def _ask_user_to_confirm_new_names(config, new_domains, certname, old_domains):
|
|||
"""Ask user to confirm update cert certname to contain new_domains.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param new_domains: List of new domain names
|
||||
:type new_domains: `list` of `str`
|
||||
|
|
@ -429,10 +430,10 @@ def _find_domains_or_certname(config, installer, question=None):
|
|||
"""Retrieve domains and certname from config or user input.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param installer: Installer object
|
||||
:type installer: interfaces.IInstaller
|
||||
:type installer: interfaces.Installer
|
||||
|
||||
:param `str` question: Overriding default question to ask the user if asked
|
||||
to choose from domain names.
|
||||
|
|
@ -466,7 +467,7 @@ def _find_domains_or_certname(config, installer, question=None):
|
|||
return domains, certname
|
||||
|
||||
|
||||
def _report_next_steps(config: interfaces.IConfig, installer_err: Optional[errors.Error],
|
||||
def _report_next_steps(config: configuration.NamespaceConfig, installer_err: Optional[errors.Error],
|
||||
lineage: Optional[storage.RenewableCert],
|
||||
new_or_renewed_cert: bool = True) -> None:
|
||||
"""Displays post-run/certonly advice to the user about renewal and installation.
|
||||
|
|
@ -474,7 +475,7 @@ def _report_next_steps(config: interfaces.IConfig, installer_err: Optional[error
|
|||
The output varies by runtime configuration and any errors encountered during installation.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param installer_err: The installer/enhancement error encountered, if any.
|
||||
:type error: Optional[errors.Error]
|
||||
|
|
@ -534,12 +535,12 @@ def _report_next_steps(config: interfaces.IConfig, installer_err: Optional[error
|
|||
print()
|
||||
|
||||
|
||||
def _report_new_cert(config, cert_path, fullchain_path, key_path=None):
|
||||
# type: (interfaces.IConfig, Optional[str], Optional[str], Optional[str]) -> None
|
||||
def _report_new_cert(config: configuration.NamespaceConfig, cert_path: Optional[str],
|
||||
fullchain_path: Optional[str], key_path: Optional[str] = None) -> None:
|
||||
"""Reports the creation of a new certificate to the user.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param cert_path: path to certificate
|
||||
:type cert_path: str
|
||||
|
|
@ -579,7 +580,7 @@ def _report_new_cert(config, cert_path, fullchain_path, key_path=None):
|
|||
)
|
||||
|
||||
|
||||
def _is_interactive_only_auth(config: interfaces.IConfig) -> bool:
|
||||
def _is_interactive_only_auth(config: configuration.NamespaceConfig) -> bool:
|
||||
""" Whether the current authenticator params only support interactive renewal.
|
||||
"""
|
||||
# --manual without --manual-auth-hook can never autorenew
|
||||
|
|
@ -589,7 +590,7 @@ def _is_interactive_only_auth(config: interfaces.IConfig) -> bool:
|
|||
return False
|
||||
|
||||
|
||||
def _csr_report_new_cert(config: interfaces.IConfig, cert_path: Optional[str],
|
||||
def _csr_report_new_cert(config: configuration.NamespaceConfig, cert_path: Optional[str],
|
||||
chain_path: Optional[str], fullchain_path: Optional[str]):
|
||||
""" --csr variant of _report_new_cert.
|
||||
|
||||
|
|
@ -598,7 +599,7 @@ def _csr_report_new_cert(config: interfaces.IConfig, cert_path: Optional[str],
|
|||
TODO: remove this function and just call _report_new_cert when --csr is overhauled.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param str cert_path: path to cert.pem
|
||||
|
||||
|
|
@ -634,7 +635,7 @@ def _determine_account(config):
|
|||
user input. Same for ``config.email``.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:returns: Account and optionally ACME client API (biproduct of new
|
||||
registration).
|
||||
|
|
@ -690,7 +691,7 @@ def _delete_if_appropriate(config):
|
|||
deleting happens automatically.
|
||||
|
||||
:param config: parsed command line arguments
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:returns: `None`
|
||||
:rtype: None
|
||||
|
|
@ -741,12 +742,12 @@ def _init_le_client(config, authenticator, installer):
|
|||
"""Initialize Let's Encrypt Client
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param authenticator: Acme authentication handler
|
||||
:type authenticator: Optional[interfaces.IAuthenticator]
|
||||
:type authenticator: Optional[interfaces.Authenticator]
|
||||
:param installer: Installer object
|
||||
:type installer: interfaces.IInstaller
|
||||
:type installer: interfaces.Installer
|
||||
|
||||
:returns: client: Client object
|
||||
:rtype: client.Client
|
||||
|
|
@ -768,7 +769,7 @@ def unregister(config, unused_plugins):
|
|||
"""Deactivate account on server
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param unused_plugins: List of plugins (deprecated)
|
||||
:type unused_plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -807,7 +808,7 @@ def register(config, unused_plugins):
|
|||
"""Create accounts on the server.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param unused_plugins: List of plugins (deprecated)
|
||||
:type unused_plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -837,7 +838,7 @@ def update_account(config, unused_plugins):
|
|||
"""Modify accounts on the server.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param unused_plugins: List of plugins (deprecated)
|
||||
:type unused_plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -883,7 +884,7 @@ def update_account(config, unused_plugins):
|
|||
return None
|
||||
|
||||
|
||||
def _cert_name_from_config_or_lineage(config: interfaces.IConfig,
|
||||
def _cert_name_from_config_or_lineage(config: configuration.NamespaceConfig,
|
||||
lineage: Optional[storage.RenewableCert]) -> Optional[str]:
|
||||
if lineage:
|
||||
return lineage.lineagename
|
||||
|
|
@ -902,7 +903,7 @@ def _install_cert(config, le_client, domains, lineage=None):
|
|||
"""Install a cert
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param le_client: Client object
|
||||
:type le_client: client.Client
|
||||
|
|
@ -929,7 +930,7 @@ def install(config, plugins):
|
|||
"""Install a previously obtained cert in a server.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param plugins: List of plugins
|
||||
:type plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -1012,7 +1013,7 @@ def plugins_cmd(config, plugins):
|
|||
"""List server software plugins.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param plugins: List of plugins
|
||||
:type plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -1050,7 +1051,7 @@ def enhance(config, plugins):
|
|||
"""Add security enhancements to existing configuration
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param plugins: List of plugins
|
||||
:type plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -1109,7 +1110,7 @@ def rollback(config, plugins):
|
|||
"""Rollback server configuration changes made during install.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param plugins: List of plugins
|
||||
:type plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -1127,7 +1128,7 @@ def update_symlinks(config, unused_plugins):
|
|||
the correct archive directory.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param unused_plugins: List of plugins (deprecated)
|
||||
:type unused_plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -1145,7 +1146,7 @@ def rename(config, unused_plugins):
|
|||
lineage.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param unused_plugins: List of plugins (deprecated)
|
||||
:type unused_plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -1163,7 +1164,7 @@ def delete(config, unused_plugins):
|
|||
lineage.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param unused_plugins: List of plugins (deprecated)
|
||||
:type unused_plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -1179,7 +1180,7 @@ def certificates(config, unused_plugins):
|
|||
"""Display information about certs configured with Certbot
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param unused_plugins: List of plugins (deprecated)
|
||||
:type unused_plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -1195,7 +1196,7 @@ def revoke(config, unused_plugins: plugins_disco.PluginsRegistry) -> Optional[st
|
|||
"""Revoke a previously obtained certificate.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param unused_plugins: List of plugins (deprecated)
|
||||
:type unused_plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -1249,7 +1250,7 @@ def run(config, plugins):
|
|||
"""Obtain a certificate and install.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param plugins: List of plugins
|
||||
:type plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -1315,8 +1316,9 @@ def run(config, plugins):
|
|||
return None
|
||||
|
||||
|
||||
def _csr_get_and_save_cert(config, le_client):
|
||||
# type: (interfaces.IConfig, client.Client) -> Tuple[Optional[str], Optional[str], Optional[str]] # pylint: disable=line-too-long
|
||||
def _csr_get_and_save_cert(config: configuration.NamespaceConfig,
|
||||
le_client: client.Client) -> Tuple[
|
||||
Optional[str], Optional[str], Optional[str]]:
|
||||
"""Obtain a cert using a user-supplied CSR
|
||||
|
||||
This works differently in the CSR case (for now) because we don't
|
||||
|
|
@ -1324,7 +1326,7 @@ def _csr_get_and_save_cert(config, le_client):
|
|||
So we just save the cert & chain to disk :/
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param client: Client object
|
||||
:type client: client.Client
|
||||
|
|
@ -1358,7 +1360,7 @@ def renew_cert(config, plugins, lineage):
|
|||
"""Renew & save an existing cert. Do not install it.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param plugins: List of plugins
|
||||
:type plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -1391,7 +1393,7 @@ def certonly(config, plugins):
|
|||
This implements the 'certonly' subcommand.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param plugins: List of plugins
|
||||
:type plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -1440,7 +1442,7 @@ def renew(config, unused_plugins):
|
|||
"""Renew previously-obtained certificates.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:param unused_plugins: List of plugins (deprecated)
|
||||
:type unused_plugins: plugins_disco.PluginsRegistry
|
||||
|
|
@ -1459,7 +1461,7 @@ def make_or_verify_needed_dirs(config):
|
|||
"""Create or verify existence of config, work, and hook directories.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: configuration.NamespaceConfig
|
||||
|
||||
:returns: `None`
|
||||
:rtype: None
|
||||
|
|
@ -1483,7 +1485,7 @@ def make_displayer(config: configuration.NamespaceConfig
|
|||
|
||||
:param config: Configuration object
|
||||
|
||||
:returns: Display object implementing :class:`certbot.interfaces.IDisplay`
|
||||
:returns: Display object
|
||||
|
||||
"""
|
||||
displayer: Union[None, display_util.NoninteractiveDisplay,
|
||||
|
|
|
|||
|
|
@ -304,11 +304,9 @@ class PluginsRegistry(Mapping):
|
|||
def find_init(self, plugin):
|
||||
"""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)::
|
||||
This is particularly useful for finding a name for the plugin::
|
||||
|
||||
# plugin is an instance providing IPlugin, initialized
|
||||
# plugin is an instance providing Plugin, initialized
|
||||
# somewhere else in the code
|
||||
plugin_registry.find_init(plugin).name
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import logging
|
|||
from typing import Optional
|
||||
from typing import Tuple
|
||||
|
||||
from certbot import configuration
|
||||
from certbot import errors
|
||||
from certbot import interfaces
|
||||
from certbot._internal.plugins import disco
|
||||
|
|
@ -40,14 +41,14 @@ def pick_authenticator(
|
|||
|
||||
def get_unprepared_installer(config, plugins):
|
||||
"""
|
||||
Get an unprepared interfaces.IInstaller object.
|
||||
Get an unprepared interfaces.Installer object.
|
||||
|
||||
:param certbot.interfaces.IConfig config: Configuration
|
||||
:param certbot.configuration.NamespaceConfig config: Configuration
|
||||
:param certbot._internal.plugins.disco.PluginsRegistry plugins:
|
||||
All plugins registered as entry points.
|
||||
|
||||
:returns: Unprepared installer plugin or None
|
||||
:rtype: IPlugin or None
|
||||
:rtype: Plugin or None
|
||||
"""
|
||||
|
||||
_, req_inst = cli_plugin_requests(config)
|
||||
|
|
@ -71,7 +72,7 @@ def get_unprepared_installer(config, plugins):
|
|||
def pick_plugin(config, default, plugins, question, ifaces):
|
||||
"""Pick plugin.
|
||||
|
||||
:param certbot.interfaces.IConfig: Configuration
|
||||
:param certbot.configuration.NamespaceConfig: Configuration
|
||||
:param str default: Plugin name supplied by user or ``None``.
|
||||
:param certbot._internal.plugins.disco.PluginsRegistry plugins:
|
||||
All plugins registered as entry points.
|
||||
|
|
@ -80,7 +81,7 @@ def pick_plugin(config, default, plugins, question, ifaces):
|
|||
:param list ifaces: Interfaces that plugins must provide.
|
||||
|
||||
:returns: Initialized plugin.
|
||||
:rtype: IPlugin
|
||||
:rtype: Plugin
|
||||
|
||||
"""
|
||||
if default is not None:
|
||||
|
|
@ -164,9 +165,10 @@ def record_chosen_plugins(config, plugins, auth, inst):
|
|||
config.authenticator, config.installer)
|
||||
|
||||
|
||||
def choose_configurator_plugins(config: interfaces.IConfig, plugins: disco.PluginsRegistry,
|
||||
verb: str) -> Tuple[Optional[interfaces.IInstaller],
|
||||
Optional[interfaces.IAuthenticator]]:
|
||||
def choose_configurator_plugins(config: configuration.NamespaceConfig,
|
||||
plugins: disco.PluginsRegistry,
|
||||
verb: str) -> Tuple[Optional[interfaces.Installer],
|
||||
Optional[interfaces.Authenticator]]:
|
||||
"""
|
||||
Figure out which configurator we're going to use, modifies
|
||||
config.authenticator and config.installer strings to reflect that choice if
|
||||
|
|
@ -174,7 +176,7 @@ def choose_configurator_plugins(config: interfaces.IConfig, plugins: disco.Plugi
|
|||
|
||||
:raises errors.PluginSelectionError if there was a problem
|
||||
|
||||
:returns: tuple of (`IInstaller` or None, `IAuthenticator` or None)
|
||||
:returns: tuple of (`Installer` or None, `Authenticator` or None)
|
||||
:rtype: tuple
|
||||
"""
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ from cryptography.hazmat.primitives.asymmetric import rsa
|
|||
from cryptography.hazmat.primitives.serialization import load_pem_private_key
|
||||
import zope.component
|
||||
|
||||
from certbot import configuration
|
||||
from certbot import crypto_util
|
||||
from certbot import errors
|
||||
from certbot import interfaces
|
||||
|
|
@ -316,8 +317,8 @@ def _avoid_invalidating_lineage(config, lineage, original_server):
|
|||
"unless you use the --break-my-certs flag!".format(names))
|
||||
|
||||
|
||||
def renew_cert(config: interfaces.IConfig, domains: Optional[List[str]], le_client: client.Client,
|
||||
lineage: storage.RenewableCert) -> None:
|
||||
def renew_cert(config: configuration.NamespaceConfig, domains: Optional[List[str]],
|
||||
le_client: client.Client, lineage: storage.RenewableCert) -> None:
|
||||
"""Renew a certificate lineage."""
|
||||
renewal_params = lineage.configuration["renewalparams"]
|
||||
original_server = renewal_params.get("server", cli.flag_default("server"))
|
||||
|
|
@ -349,13 +350,13 @@ def report(msgs, category):
|
|||
return " " + "\n ".join(lines)
|
||||
|
||||
|
||||
def _renew_describe_results(config: interfaces.IConfig, renew_successes: List[str],
|
||||
def _renew_describe_results(config: configuration.NamespaceConfig, renew_successes: List[str],
|
||||
renew_failures: List[str], renew_skipped: List[str],
|
||||
parse_failures: List[str]) -> None:
|
||||
"""
|
||||
Print a report to the terminal about the results of the renewal process.
|
||||
|
||||
:param interfaces.IConfig config: Configuration
|
||||
:param configuration.NamespaceConfiguration config: Configuration
|
||||
:param list renew_successes: list of fullchain paths which were renewed
|
||||
:param list renew_failures: list of fullchain paths which failed to be renewed
|
||||
:param list renew_skipped: list of messages to print about skipped certificates
|
||||
|
|
@ -504,7 +505,7 @@ def handle_renewal_request(config):
|
|||
logger.debug("no renewal failures")
|
||||
|
||||
|
||||
def _update_renewal_params_from_key(key_path: str, config: interfaces.IConfig) -> None:
|
||||
def _update_renewal_params_from_key(key_path: str, config: configuration.NamespaceConfig) -> None:
|
||||
with open(key_path, 'rb') as file_h:
|
||||
key = load_pem_private_key(file_h.read(), password=None, backend=default_backend())
|
||||
if isinstance(key, rsa.RSAPrivateKey):
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import parsedatetime
|
|||
import pytz
|
||||
|
||||
import certbot
|
||||
from certbot import configuration
|
||||
from certbot import crypto_util
|
||||
from certbot import errors
|
||||
from certbot import interfaces
|
||||
|
|
@ -36,10 +37,10 @@ CURRENT_VERSION = util.get_strict_version(certbot.__version__)
|
|||
BASE_PRIVKEY_MODE = 0o600
|
||||
|
||||
|
||||
def renewal_conf_files(config):
|
||||
def renewal_conf_files(config: configuration.NamespaceConfig):
|
||||
"""Build a list of all renewal configuration files.
|
||||
|
||||
:param certbot.interfaces.IConfig config: Configuration object
|
||||
:param configuration.NamespaceConfig config: Configuration object
|
||||
|
||||
:returns: list of renewal configuration files
|
||||
:rtype: `list` of `str`
|
||||
|
|
@ -59,10 +60,10 @@ def renewal_file_for_certname(config, certname):
|
|||
return path
|
||||
|
||||
|
||||
def cert_path_for_cert_name(config: interfaces.IConfig, cert_name: str) -> str:
|
||||
def cert_path_for_cert_name(config: configuration.NamespaceConfig, cert_name: str) -> str:
|
||||
""" If `--cert-name` was specified, but you need a value for `--cert-path`.
|
||||
|
||||
:param `configuration.NamespaceConfig` config: parsed command line arguments
|
||||
:param configuration.NamespaceConfig config: parsed command line arguments
|
||||
:param str cert_name: cert name.
|
||||
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ def run_generic_updaters(config, lineage, plugins):
|
|||
"""Run updaters that the plugin supports
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: certbot.configuration.NamespaceConfig
|
||||
|
||||
:param lineage: Certificate lineage object
|
||||
:type lineage: storage.RenewableCert
|
||||
|
|
@ -40,13 +40,13 @@ def run_renewal_deployer(config, lineage, installer):
|
|||
installer plugin.
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: certbot.configuration.NamespaceConfig
|
||||
|
||||
:param lineage: Certificate lineage object
|
||||
:type lineage: storage.RenewableCert
|
||||
|
||||
:param installer: Installer object
|
||||
:type installer: interfaces.IInstaller
|
||||
:type installer: interfaces.Installer
|
||||
|
||||
:returns: `None`
|
||||
:rtype: None
|
||||
|
|
@ -68,7 +68,7 @@ def _run_updaters(lineage, installer, config):
|
|||
:type lineage: storage.RenewableCert
|
||||
|
||||
:param installer: Installer object
|
||||
:type installer: interfaces.IInstaller
|
||||
:type installer: interfaces.Installer
|
||||
|
||||
:returns: `None`
|
||||
:rtype: None
|
||||
|
|
@ -86,10 +86,10 @@ def _run_enhancement_updaters(lineage, installer, config):
|
|||
:type lineage: storage.RenewableCert
|
||||
|
||||
:param installer: Installer object
|
||||
:type installer: interfaces.IInstaller
|
||||
:type installer: interfaces.Installer
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: certbot.configuration.NamespaceConfig
|
||||
"""
|
||||
|
||||
if config.disable_renew_updates:
|
||||
|
|
@ -108,10 +108,10 @@ def _run_enhancement_deployers(lineage, installer, config):
|
|||
:type lineage: storage.RenewableCert
|
||||
|
||||
:param installer: Installer object
|
||||
:type installer: interfaces.IInstaller
|
||||
:type installer: interfaces.Installer
|
||||
|
||||
:param config: Configuration object
|
||||
:type config: interfaces.IConfig
|
||||
:type config: certbot.configuration.NamespaceConfig
|
||||
"""
|
||||
|
||||
if config.disable_renew_updates:
|
||||
|
|
|
|||
|
|
@ -14,10 +14,8 @@ from certbot.compat import os
|
|||
class NamespaceConfig:
|
||||
"""Configuration wrapper around :class:`argparse.Namespace`.
|
||||
|
||||
For more documentation, including available attributes, please see
|
||||
:class:`certbot.interfaces.IConfig`. However, note that
|
||||
the following attributes are dynamically resolved using
|
||||
:attr:`~certbot.interfaces.IConfig.work_dir` and relative
|
||||
Please note that the following attributes are dynamically resolved using
|
||||
:attr:`~certbot.configuration.NamespaceConfig.work_dir` and relative
|
||||
paths defined in :py:mod:`certbot._internal.constants`:
|
||||
|
||||
- `accounts_dir`
|
||||
|
|
@ -27,7 +25,7 @@ class NamespaceConfig:
|
|||
- `temp_checkpoint_dir`
|
||||
|
||||
And the following paths are dynamically resolved using
|
||||
:attr:`~certbot.interfaces.IConfig.config_dir` and relative
|
||||
:attr:`~certbot.configuration.NamespaceConfig.config_dir` and relative
|
||||
paths defined in :py:mod:`certbot._internal.constants`:
|
||||
|
||||
- `default_archive_dir`
|
||||
|
|
@ -77,6 +75,11 @@ class NamespaceConfig:
|
|||
"""Size of the RSA key."""
|
||||
return self.namespace.rsa_key_size
|
||||
|
||||
@rsa_key_size.setter
|
||||
def rsa_key_size(self, ksize: int) -> None:
|
||||
"""Set the rsa_key_size property"""
|
||||
self.namespace.rsa_key_size = ksize
|
||||
|
||||
@property
|
||||
def elliptic_curve(self) -> str:
|
||||
"""The SECG elliptic curve name to use.
|
||||
|
|
@ -85,6 +88,11 @@ class NamespaceConfig:
|
|||
"""
|
||||
return self.namespace.elliptic_curve
|
||||
|
||||
@elliptic_curve.setter
|
||||
def elliptic_curve(self, ecurve: str) -> None:
|
||||
"""Set the elliptic_curve property"""
|
||||
self.namespace.elliptic_curve = ecurve
|
||||
|
||||
@property
|
||||
def key_type(self) -> str:
|
||||
"""Type of generated private key.
|
||||
|
|
@ -93,6 +101,11 @@ class NamespaceConfig:
|
|||
"""
|
||||
return self.namespace.key_type
|
||||
|
||||
@key_type.setter
|
||||
def key_type(self, ktype: str) -> None:
|
||||
"""Set the key_type property"""
|
||||
self.namespace.key_type = ktype
|
||||
|
||||
@property
|
||||
def must_staple(self) -> bool:
|
||||
"""Adds the OCSP Must Staple extension to the certificate.
|
||||
|
|
@ -281,8 +294,8 @@ def _check_config_sanity(config):
|
|||
"""Validate command line options and display error message if
|
||||
requirements are not met.
|
||||
|
||||
:param config: IConfig instance holding user configuration
|
||||
:type args: :class:`certbot.interfaces.IConfig`
|
||||
:param config: NamespaceConfig instance holding user configuration
|
||||
:type args: :class:`certbot.configuration.NamespaceConfig`
|
||||
|
||||
"""
|
||||
# Port check
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ def choose_names(installer, question=None):
|
|||
"""Display screen to select domains to validate.
|
||||
|
||||
:param installer: An installer object
|
||||
:type installer: :class:`certbot.interfaces.IInstaller`
|
||||
:type installer: :class:`certbot.interfaces.Installer`
|
||||
|
||||
:param `str` question: Overriding default question to ask the user if asked
|
||||
to choose from domain names.
|
||||
|
|
@ -332,29 +332,29 @@ def _get_validated(method, validator, message, default=None, **kwargs):
|
|||
|
||||
|
||||
def validated_input(validator, *args, **kwargs):
|
||||
"""Like `~certbot.interfaces.IDisplay.input`, but with validation.
|
||||
"""Like `~certbot.display.util.input_text`, but with validation.
|
||||
|
||||
:param callable validator: A method which will be called on the
|
||||
supplied input. If the method raises an `errors.Error`, its
|
||||
text will be displayed and the user will be re-prompted.
|
||||
:param list `*args`: Arguments to be passed to `~certbot.interfaces.IDisplay.input`.
|
||||
:param dict `**kwargs`: Arguments to be passed to `~certbot.interfaces.IDisplay.input`.
|
||||
:return: as `~certbot.interfaces.IDisplay.input`
|
||||
:param list `*args`: Arguments to be passed to `~certbot.display.util.input_text`.
|
||||
:param dict `**kwargs`: Arguments to be passed to `~certbot.display.util.input_text`.
|
||||
:return: as `~certbot.display.util.input_text`
|
||||
:rtype: tuple
|
||||
"""
|
||||
return _get_validated(display_util.input_text, validator, *args, **kwargs)
|
||||
|
||||
|
||||
def validated_directory(validator, *args, **kwargs):
|
||||
"""Like `~certbot.interfaces.IDisplay.directory_select`, but with validation.
|
||||
"""Like `~certbot.display.util.directory_select`, but with validation.
|
||||
|
||||
:param callable validator: A method which will be called on the
|
||||
supplied input. If the method raises an `errors.Error`, its
|
||||
text will be displayed and the user will be re-prompted.
|
||||
:param list `*args`: Arguments to be passed to `~certbot.interfaces.IDisplay.directory_select`.
|
||||
:param list `*args`: Arguments to be passed to `~certbot.display.util.directory_select`.
|
||||
:param dict `**kwargs`: Arguments to be passed to
|
||||
`~certbot.interfaces.IDisplay.directory_select`.
|
||||
:return: as `~certbot.interfaces.IDisplay.directory_select`
|
||||
`~certbot.display.util.directory_select`.
|
||||
:return: as `~certbot.display.util.directory_select`
|
||||
:rtype: tuple
|
||||
"""
|
||||
return _get_validated(display_util.directory_select, validator, *args, **kwargs)
|
||||
|
|
|
|||
|
|
@ -191,17 +191,16 @@ def directory_select(message: str, default: Optional[str] = None, cli_flag: Opti
|
|||
|
||||
|
||||
def assert_valid_call(prompt, default, cli_flag, force_interactive):
|
||||
"""Verify that provided arguments is a valid IDisplay call.
|
||||
"""Verify that provided arguments is a valid display call.
|
||||
|
||||
:param str prompt: prompt for the user
|
||||
:param default: default answer to prompt
|
||||
:param str cli_flag: command line option for setting an answer
|
||||
to this question
|
||||
:param bool force_interactive: if interactivity is forced by the
|
||||
IDisplay call
|
||||
:param bool force_interactive: if interactivity is forced
|
||||
|
||||
"""
|
||||
msg = "Invalid IDisplay call for this prompt:\n{0}".format(prompt)
|
||||
msg = "Invalid display call for this prompt:\n{0}".format(prompt)
|
||||
if cli_flag:
|
||||
msg += ("\nYou can set an answer to "
|
||||
"this prompt with the {0} flag".format(cli_flag))
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class StandaloneBindError(Error):
|
|||
class ConfigurationError(Error):
|
||||
"""Configuration sanity error."""
|
||||
|
||||
# NoninteractiveDisplay iDisplay plugin error:
|
||||
# NoninteractiveDisplay error:
|
||||
|
||||
class MissingCommandlineFlag(Error):
|
||||
"""A command line argument was missing in noninteractive usage"""
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ class GenericUpdater(metaclass=ABCMeta):
|
|||
|
||||
The plugins implementing this enhancement are responsible of handling
|
||||
the saving of configuration checkpoints as well as other calls to
|
||||
interface methods of `interfaces.IInstaller` such as prepare() and restart()
|
||||
interface methods of `interfaces.Installer` such as prepare() and restart()
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class Plugin(AbstractPlugin, metaclass=ABCMeta):
|
|||
def inject_parser_options(cls, parser, name):
|
||||
"""Inject parser options.
|
||||
|
||||
See `~.IPlugin.inject_parser_options` for docs.
|
||||
See `~.certbot.interfaces.Plugin.inject_parser_options` for docs.
|
||||
|
||||
"""
|
||||
# dummy function, doesn't check if dest.startswith(self.dest_namespace)
|
||||
|
|
@ -96,8 +96,7 @@ class Plugin(AbstractPlugin, metaclass=ABCMeta):
|
|||
"""Find a configuration value for variable ``var``."""
|
||||
return getattr(self.config, self.dest(var))
|
||||
|
||||
def auth_hint(self, failed_achalls):
|
||||
# type: (List[achallenges.AnnotatedChallenge]) -> str
|
||||
def auth_hint(self, failed_achalls: List[achallenges.AnnotatedChallenge]) -> str:
|
||||
"""Human-readable string to help the user troubleshoot the authenticator.
|
||||
|
||||
Shown to the user if one or more of the attempted challenges were not a success.
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from typing import List
|
|||
from certbot._internal import constants
|
||||
|
||||
ENHANCEMENTS = ["redirect", "ensure-http-header", "ocsp-stapling"]
|
||||
"""List of possible :class:`certbot.interfaces.IInstaller`
|
||||
"""List of possible :class:`certbot.interfaces.Installer`
|
||||
enhancements.
|
||||
|
||||
List of expected options parameters:
|
||||
|
|
@ -22,7 +22,7 @@ def enabled_enhancements(config):
|
|||
Generator to yield the enabled new style enhancements.
|
||||
|
||||
:param config: Configuration.
|
||||
:type config: :class:`certbot.interfaces.IConfig`
|
||||
:type config: certbot.configuration.NamespaceConfig
|
||||
"""
|
||||
for enh in _INDEX:
|
||||
if getattr(config, enh["cli_dest"]):
|
||||
|
|
@ -34,7 +34,7 @@ def are_requested(config):
|
|||
enhancement interfaces.
|
||||
|
||||
:param config: Configuration.
|
||||
:type config: :class:`certbot.interfaces.IConfig`
|
||||
:type config: certbot.configuration.NamespaceConfig
|
||||
"""
|
||||
return any(enabled_enhancements(config))
|
||||
|
||||
|
|
@ -44,10 +44,10 @@ def are_supported(config, installer):
|
|||
installer.
|
||||
|
||||
:param config: Configuration.
|
||||
:type config: :class:`certbot.interfaces.IConfig`
|
||||
:type config: certbot.configuration.NamespaceConfig
|
||||
|
||||
:param installer: Installer object
|
||||
:type installer: interfaces.IInstaller
|
||||
:type installer: interfaces.Installer
|
||||
|
||||
:returns: If all the requested enhancements are supported by the installer
|
||||
:rtype: bool
|
||||
|
|
@ -68,10 +68,10 @@ def enable(lineage, domains, installer, config):
|
|||
:type domains: str
|
||||
|
||||
:param installer: Installer object
|
||||
:type installer: interfaces.IInstaller
|
||||
:type installer: interfaces.Installer
|
||||
|
||||
:param config: Configuration.
|
||||
:type config: :class:`certbot.interfaces.IConfig`
|
||||
:type config: certbot.configuration.NamespaceConfig
|
||||
"""
|
||||
for enh in enabled_enhancements(config):
|
||||
getattr(installer, enh["enable_function"])(lineage, domains)
|
||||
|
|
@ -124,7 +124,7 @@ class AutoHSTSEnhancement(object, metaclass=abc.ABCMeta):
|
|||
:param lineage: Certificate lineage object
|
||||
:type lineage: certbot.interfaces.RenewableCert
|
||||
|
||||
.. note:: prepare() method inherited from `interfaces.IPlugin` might need
|
||||
.. note:: prepare() method inherited from `interfaces.Plugin` might need
|
||||
to be called manually within implementation of this interface method
|
||||
to finalize the plugin initialization.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class Reverter:
|
|||
.. note:: Consider moving everything over to CSV format.
|
||||
|
||||
:param config: Configuration.
|
||||
:type config: :class:`certbot.interfaces.IConfig`
|
||||
:type config: :class:`certbot.configuration.NamespaceConfig`
|
||||
|
||||
"""
|
||||
def __init__(self, config):
|
||||
|
|
@ -384,7 +384,7 @@ class Reverter:
|
|||
:raises .errors.ReverterError: If unable to recover the configuration
|
||||
|
||||
"""
|
||||
# First, any changes found in IConfig.temp_checkpoint_dir are removed,
|
||||
# First, any changes found in NamespaceConfig.temp_checkpoint_dir are removed,
|
||||
# then IN_PROGRESS changes are removed The order is important.
|
||||
# IN_PROGRESS is unable to add files that are already added by a TEMP
|
||||
# change. Thus TEMP must be rolled back first because that will be the
|
||||
|
|
|
|||
|
|
@ -225,15 +225,15 @@ def patch_get_utility_with_stdout(target='zope.component.getUtility',
|
|||
|
||||
|
||||
def patch_display_util():
|
||||
"""Patch certbot.display.util to use a special mock IDisplay.
|
||||
"""Patch certbot.display.util to use a special mock display utility.
|
||||
|
||||
The mock IDisplay works like a regular mock object, except it also
|
||||
The mock display utility works like a regular mock object, except it also
|
||||
also asserts that methods are called with valid arguments.
|
||||
|
||||
The mock created by this patch mocks out Certbot internals so this can be
|
||||
used like the old patch_get_utility function. That is, the mock object will
|
||||
be called by the certbot.display.util functions and the mock returned by
|
||||
that call will be used as the IDisplay object. This was done to simplify
|
||||
that call will be used as the display utility. This was done to simplify
|
||||
the transition from zope.component and mocking certbot.display.util
|
||||
functions directly in test code should be preferred over using this
|
||||
function in the future.
|
||||
|
|
@ -241,7 +241,7 @@ def patch_display_util():
|
|||
See https://github.com/certbot/certbot/issues/8948
|
||||
|
||||
:returns: patch on the function used internally by certbot.display.util to
|
||||
get an IDisplay object
|
||||
get a display utility instance
|
||||
:rtype: unittest.mock._patch
|
||||
|
||||
"""
|
||||
|
|
@ -250,28 +250,28 @@ def patch_display_util():
|
|||
|
||||
|
||||
def patch_display_util_with_stdout(stdout=None):
|
||||
"""Patch certbot.display.util to use a special mock IDisplay.
|
||||
"""Patch certbot.display.util to use a special mock display utility.
|
||||
|
||||
The mock IDisplay works like a regular mock object, except it also
|
||||
The mock display utility works like a regular mock object, except it also
|
||||
asserts that methods are called with valid arguments.
|
||||
|
||||
The mock created by this patch mocks out Certbot internals so this can be
|
||||
used like the old patch_get_utility function. That is, the mock object will
|
||||
be called by the certbot.display.util functions and the mock returned by
|
||||
that call will be used as the IDisplay object. This was done to simplify
|
||||
that call will be used as the display utility. This was done to simplify
|
||||
the transition from zope.component and mocking certbot.display.util
|
||||
functions directly in test code should be preferred over using this
|
||||
function in the future.
|
||||
|
||||
See https://github.com/certbot/certbot/issues/8948
|
||||
|
||||
The `message` argument passed to the IDisplay methods is passed to
|
||||
The `message` argument passed to the display utility methods is passed to
|
||||
stdout's write method.
|
||||
|
||||
:param object stdout: object to write standard output to; it is
|
||||
expected to have a `write` method
|
||||
:returns: patch on the function used internally by certbot.display.util to
|
||||
get an IDisplay object
|
||||
get a display utility instance
|
||||
:rtype: unittest.mock._patch
|
||||
|
||||
"""
|
||||
|
|
@ -372,7 +372,7 @@ def _create_display_util_mock_with_stdout(stdout):
|
|||
|
||||
def mock_method(*args, **kwargs):
|
||||
"""
|
||||
Mock function for IDisplay methods.
|
||||
Mock function for display utility methods.
|
||||
"""
|
||||
_assert_valid_call(args, kwargs)
|
||||
_write_msg(*args, **kwargs)
|
||||
|
|
|
|||
|
|
@ -233,16 +233,13 @@ different webservers, other TLS servers, and operating systems.
|
|||
The interfaces available for plugins to implement are defined in
|
||||
`interfaces.py`_ and `plugins/common.py`_.
|
||||
|
||||
The main two plugin interfaces are `~certbot.interfaces.IAuthenticator`, which
|
||||
The main two plugin interfaces are `~certbot.interfaces.Authenticator`, which
|
||||
implements various ways of proving domain control to a certificate authority,
|
||||
and `~certbot.interfaces.IInstaller`, which configures a server to use a
|
||||
and `~certbot.interfaces.Installer`, which configures a server to use a
|
||||
certificate once it is issued. Some plugins, like the built-in Apache and Nginx
|
||||
plugins, implement both interfaces and perform both tasks. Others, like the
|
||||
built-in Standalone authenticator, implement just one interface.
|
||||
|
||||
There are also `~certbot.interfaces.IDisplay` plugins,
|
||||
which can change how prompts are displayed to a user.
|
||||
|
||||
.. _interfaces.py: https://github.com/certbot/certbot/blob/master/certbot/certbot/interfaces.py
|
||||
.. _plugins/common.py: https://github.com/certbot/certbot/blob/master/certbot/certbot/plugins/common.py#L45
|
||||
|
||||
|
|
@ -272,7 +269,7 @@ Installers plugins exist to actually setup the certificate in a server,
|
|||
possibly tweak the security configuration to make it more correct and secure
|
||||
(Fix some mixed content problems, turn on HSTS, redirect to HTTPS, etc).
|
||||
Installer plugins tell the main client about their abilities to do the latter
|
||||
via the :meth:`~.IInstaller.supported_enhancements` call. We currently
|
||||
via the :meth:`~.Installer.supported_enhancements` call. We currently
|
||||
have two Installers in the tree, the `~.ApacheConfigurator`. and the
|
||||
`~.NginxConfigurator`. External projects have made some progress toward
|
||||
support for IIS, Icecast and Plesk.
|
||||
|
|
@ -293,7 +290,7 @@ Installer Development
|
|||
---------------------
|
||||
|
||||
There are a few existing classes that may be beneficial while
|
||||
developing a new `~certbot.interfaces.IInstaller`.
|
||||
developing a new `~certbot.interfaces.Installer`.
|
||||
Installers aimed to reconfigure UNIX servers may use Augeas for
|
||||
configuration parsing and can inherit from `~.AugeasConfigurator` class
|
||||
to handle much of the interface. Installers that are unable to use
|
||||
|
|
@ -319,8 +316,8 @@ Writing your own plugin
|
|||
Certbot client supports dynamic discovery of plugins through the
|
||||
`setuptools entry points`_ using the `certbot.plugins` group. This
|
||||
way you can, for example, create a custom implementation of
|
||||
`~certbot.interfaces.IAuthenticator` or the
|
||||
`~certbot.interfaces.IInstaller` without having to merge it
|
||||
`~certbot.interfaces.Authenticator` or the
|
||||
`~certbot.interfaces.Installer` without having to merge it
|
||||
with the core upstream source code. An example is provided in
|
||||
``examples/plugins/`` directory.
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class Authenticator(common.Plugin, interfaces.Authenticator):
|
|||
|
||||
description = "Example Authenticator plugin"
|
||||
|
||||
# Implement all methods from IAuthenticator, remembering to add
|
||||
# Implement all methods from Authenticator, remembering to add
|
||||
# "self" as first argument, e.g. def prepare(self)...
|
||||
|
||||
|
||||
|
|
@ -21,5 +21,5 @@ class Installer(common.Plugin, interfaces.Installer):
|
|||
|
||||
description = "Example Installer plugin"
|
||||
|
||||
# Implement all methods from IInstaller, remembering to add
|
||||
# Implement all methods from Installer, remembering to add
|
||||
# "self" as first argument, e.g. def get_all_names(self)...
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
"""Test :mod:`certbot._internal.display.obj`."""
|
||||
import inspect
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
from certbot import errors, interfaces
|
||||
from certbot import errors
|
||||
from certbot._internal.display import obj as display_obj
|
||||
from certbot.display import util as display_util
|
||||
|
||||
|
|
@ -271,13 +270,6 @@ class FileOutputDisplayTest(unittest.TestCase):
|
|||
self.displayer._get_valid_int_ans(3),
|
||||
(display_util.CANCEL, -1))
|
||||
|
||||
def test_methods_take_force_interactive(self):
|
||||
# Every IDisplay method implemented by FileDisplay must take
|
||||
# force_interactive to prevent workflow regressions.
|
||||
for name in interfaces.IDisplay.names():
|
||||
arg_spec = inspect.getfullargspec(getattr(self.displayer, name))
|
||||
self.assertIn("force_interactive", arg_spec.args)
|
||||
|
||||
|
||||
class NoninteractiveDisplayTest(unittest.TestCase):
|
||||
"""Test non-interactive display. These tests are pretty easy!"""
|
||||
|
|
@ -335,19 +327,6 @@ class NoninteractiveDisplayTest(unittest.TestCase):
|
|||
self.assertRaises(
|
||||
errors.MissingCommandlineFlag, self.displayer.directory_select, "msg")
|
||||
|
||||
def test_methods_take_kwargs(self):
|
||||
# Every IDisplay method implemented by NoninteractiveDisplay
|
||||
# should take **kwargs because every method of FileDisplay must
|
||||
# take force_interactive which doesn't apply to
|
||||
# NoninteractiveDisplay.
|
||||
|
||||
# Use pylint code for disable to keep on single line under line length limit
|
||||
for name in interfaces.IDisplay.names(): # pylint: disable=E1120
|
||||
method = getattr(self.displayer, name)
|
||||
# asserts method accepts arbitrary keyword arguments
|
||||
result = inspect.getfullargspec(method).varkw
|
||||
self.assertIsNotNone(result)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main() # pragma: no cover
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class PickPluginTest(unittest.TestCase):
|
|||
self.default = None
|
||||
self.reg = mock.MagicMock()
|
||||
self.question = "Question?"
|
||||
self.ifaces: List[interfaces.IPlugin] = []
|
||||
self.ifaces: List[interfaces.Plugin] = []
|
||||
|
||||
def _call(self):
|
||||
from certbot._internal.plugins.selection import pick_plugin
|
||||
|
|
|
|||
Loading…
Reference in a new issue