From f790273ab458e14a42a17ad9e77f602a313d7c25 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 30 Sep 2023 20:59:46 +0200 Subject: [PATCH] Version 3.15.0 --- CHANGELOG.md | 2 ++ pyproject.toml | 2 +- src/lexicon/_private/providers/auto.py | 3 ++- src/lexicon/_private/providers/hover.py | 10 ++++++++-- src/lexicon/_private/providers/valuedomain.py | 6 ++++-- tests/providers/test_hover.py | 4 +--- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aac83b55e..886a82490 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## master - CURRENT + +## 3.15.0 - 30/09/2023 ### Added * Add `pyotp` Python dependency in Lexicon to help implementing OTP (one-time password) on providers whose API supports this kind of authentication. diff --git a/pyproject.toml b/pyproject.toml index 89faf8eba..35874c24f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "dns-lexicon" -version = "3.14.1" +version = "3.15.0" description = "Manipulate DNS records on various DNS providers in a standardized/agnostic way" license = "MIT" keywords = [ diff --git a/src/lexicon/_private/providers/auto.py b/src/lexicon/_private/providers/auto.py index 295ec5788..ec27d6b47 100644 --- a/src/lexicon/_private/providers/auto.py +++ b/src/lexicon/_private/providers/auto.py @@ -1,12 +1,13 @@ """Module provider for auto""" from __future__ import annotations + import logging import pkgutil import re import subprocess from argparse import ArgumentParser from types import ModuleType -from typing import Type, Any +from typing import Any, Type import tldextract # type: ignore diff --git a/src/lexicon/_private/providers/hover.py b/src/lexicon/_private/providers/hover.py index 3c7e774e2..62576e205 100644 --- a/src/lexicon/_private/providers/hover.py +++ b/src/lexicon/_private/providers/hover.py @@ -39,7 +39,9 @@ def __init__(self, config): self.domain_id = None self.api_endpoint = "https://www.hover.com/api" self.cookies = {} - shared_secret = re.sub(r"\s*", "", self._get_provider_option("auth_totp_secret") or "") + shared_secret = re.sub( + r"\s*", "", self._get_provider_option("auth_totp_secret") or "" + ) self.totp = pyotp.TOTP(shared_secret) def authenticate(self) -> None: @@ -191,7 +193,11 @@ def delete_record(self, identifier=None, rtype=None, name=None, content=None): delete_record_ids.append(identifier) LOGGER.debug("delete_records: %s", delete_record_ids) - payload = {"domains": [{"id": f"domain-{self.domain}", "dns_records": delete_record_ids}]} + payload = { + "domains": [ + {"id": f"domain-{self.domain}", "dns_records": delete_record_ids} + ] + } self._request("DELETE", "/control_panel/dns", payload) return True diff --git a/src/lexicon/_private/providers/valuedomain.py b/src/lexicon/_private/providers/valuedomain.py index 18eb4a5a3..f3dc2cc32 100644 --- a/src/lexicon/_private/providers/valuedomain.py +++ b/src/lexicon/_private/providers/valuedomain.py @@ -553,11 +553,13 @@ def tearDown(self): pass def _create_provider(self, domainname: str): - config = ConfigResolver().with_dict({ + config = ConfigResolver().with_dict( + { "provider_name": "valuedomain", "domain": domainname, "valuedomain": {"auth_token": self.auth_token}, - }) + } + ) return Provider(config) def test_vdapi_get_domain_list(self): diff --git a/tests/providers/test_hover.py b/tests/providers/test_hover.py index ca0555c8f..77774baf3 100644 --- a/tests/providers/test_hover.py +++ b/tests/providers/test_hover.py @@ -4,10 +4,8 @@ from unittest import TestCase import pyotp - from integration_tests import IntegrationTestsV2 - _FAKE_DOMAIN_ID = "dom1127777" _FAKE_HOVERAUTH = "0123456789abcdef0123456789abcdef" _FAKE_HOVER_SESSION = "0123456789abcdef0123456789abcdef" @@ -30,7 +28,7 @@ def _filter_query_parameters(self): return ["hover_session", "hoverauth"] def _test_parameters_overrides(self): - return {'auth_totp_secret': _FAKE_TOTP_SECRET} + return {"auth_totp_secret": _FAKE_TOTP_SECRET} def _replace_auth(self, cookie): cookie = re.sub(