From 4b51e3004c0cbd02922276eaa71a8a71af925bf9 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Wed, 18 Sep 2024 14:07:35 -0700 Subject: [PATCH] remove certbot_dns_route53.authenticator (#10014) This is another and very minor piece of https://github.com/certbot/certbot/issues/9988. We've done nothing to warn/migrate installations using the old `certbot-route53:auth` plugin name and installations like that still exist according to https://gist.github.com/bmw/aceb69020dceee50ba827ec17b22e08a. We could try to warn/migrate these users for a future release or decide it's niche enough that we'll just let it break, but I think it's easy enough to keep the simple shim around. This PR just moves the code raising a deprecation warning into `_internal` as part of cleaning up all deprecation warnings I found in https://github.com/certbot/certbot/issues/9988. I manually tested this with a Certbot config using the `certbot-route53:auth` plugin name and renewal worked just fine. --- .../_internal/dns_route53.py | 10 ++++++++++ .../certbot_dns_route53/authenticator.py | 17 ----------------- certbot-dns-route53/setup.py | 2 +- certbot/CHANGELOG.md | 3 +++ 4 files changed, 14 insertions(+), 18 deletions(-) delete mode 100644 certbot-dns-route53/certbot_dns_route53/authenticator.py diff --git a/certbot-dns-route53/certbot_dns_route53/_internal/dns_route53.py b/certbot-dns-route53/certbot_dns_route53/_internal/dns_route53.py index f61f9a0ed..906d6266d 100644 --- a/certbot-dns-route53/certbot_dns_route53/_internal/dns_route53.py +++ b/certbot-dns-route53/certbot_dns_route53/_internal/dns_route53.py @@ -178,3 +178,13 @@ class Authenticator(common.Plugin, interfaces.Authenticator): raise errors.PluginError( "Timed out waiting for Route53 change. Current status: %s" % response["ChangeInfo"]["Status"]) + + +# Our route53 plugin was initially a 3rd party plugin named `certbot-route53:auth` as described at +# https://github.com/certbot/certbot/issues/4688. This shim exists to allow installations using the +# old plugin name of `certbot-route53:auth` to continue to work without cluttering things like +# Certbot's help output with two route53 plugins. +class HiddenAuthenticator(Authenticator): + """A hidden shim around certbot-dns-route53 for backwards compatibility.""" + + hidden = True diff --git a/certbot-dns-route53/certbot_dns_route53/authenticator.py b/certbot-dns-route53/certbot_dns_route53/authenticator.py deleted file mode 100644 index 5b373da43..000000000 --- a/certbot-dns-route53/certbot_dns_route53/authenticator.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Shim around `~certbot_dns_route53._internal.dns_route53` for backwards compatibility.""" -from typing import Any -import warnings - -from certbot_dns_route53._internal import dns_route53 - - -class Authenticator(dns_route53.Authenticator): - """Shim around `~certbot_dns_route53._internal.dns_route53.Authenticator` - for backwards compatibility.""" - - hidden = True - - def __init__(self, *args: Any, **kwargs: Any) -> None: - warnings.warn("The 'authenticator' module was renamed 'dns_route53'", - DeprecationWarning) - super().__init__(*args, **kwargs) diff --git a/certbot-dns-route53/setup.py b/certbot-dns-route53/setup.py index 1a1ff65ac..eb918e852 100644 --- a/certbot-dns-route53/setup.py +++ b/certbot-dns-route53/setup.py @@ -71,7 +71,7 @@ setup( entry_points={ 'certbot.plugins': [ 'dns-route53 = certbot_dns_route53._internal.dns_route53:Authenticator', - 'certbot-route53:auth = certbot_dns_route53.authenticator:Authenticator' + 'certbot-route53:auth = certbot_dns_route53._internal.dns_route53:HiddenAuthenticator', ], }, ) diff --git a/certbot/CHANGELOG.md b/certbot/CHANGELOG.md index 7b31ceee5..22c93ec37 100644 --- a/certbot/CHANGELOG.md +++ b/certbot/CHANGELOG.md @@ -15,6 +15,9 @@ Certbot adheres to [Semantic Versioning](https://semver.org/). `certbot.configuration.NamespaceConfig` were removed. * The `--manual-public-ip-logging-ok` command line flag was removed. * The `--dns-route53-propagation-seconds` command line flag was removed. +* The `certbot_dns_route53.authenticator` module has been removed. This should + not affect any users of the plugin and instead would only affect developers + trying to develop on top of the old code. ### Fixed