Skip to content

Commit

Permalink
Expose key id validator (#43)
Browse files Browse the repository at this point in the history
* Expore key id validator

* Relax and use 1.2.3 as next version
  • Loading branch information
jschlyter authored Jan 8, 2025
1 parent d104c5a commit b6dd547
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dnstapir/key_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
description="The number of public key lookups",
)

KEY_ID_VALIDATOR = re.compile(r"^[a-zA-Z0-9_\-.]+$")


def key_resolver_from_client_database(client_database: str, key_cache: KeyCache | None = None):
if client_database.startswith("http://") or client_database.startswith("https://"):
Expand All @@ -35,7 +37,7 @@ def key_resolver_from_client_database(client_database: str, key_cache: KeyCache
class KeyResolver:
def __init__(self):
self.logger = logging.getLogger(__name__).getChild(self.__class__.__name__)
self.key_id_validator = re.compile(r"^[a-zA-Z0-9_\-.]+$")
self.key_id_validator = KEY_ID_VALIDATOR

@abstractmethod
def resolve_public_key(self, key_id: str) -> PublicKey:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dnstapir"
version = "1.2.2"
version = "1.2.3"
description = "DNS TAPIR Python Library"
authors = ["Jakob Schlyter <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit b6dd547

Please sign in to comment.