Skip to content

Commit

Permalink
Key id format (#42)
Browse files Browse the repository at this point in the history
* Key identifiers may contain .

* bump
  • Loading branch information
jschlyter authored Jan 8, 2025
1 parent e8ca973 commit d104c5a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dnstapir/key_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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 = re.compile(r"^[a-zA-Z0-9_\-.]+$")

@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.1"
version = "1.2.2"
description = "DNS TAPIR Python Library"
authors = ["Jakob Schlyter <[email protected]>"]
readme = "README.md"
Expand Down
3 changes: 3 additions & 0 deletions tests/test_key_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def test_file_key_resolver(httpx_mock: HTTPXMock):
res = resolver.resolve_public_key(key_id)
assert res == public_key

with pytest.raises(KeyError):
_ = resolver.resolve_public_key("hostname.example.com")

with pytest.raises(ValueError):
_ = resolver.resolve_public_key("🔐")

Expand Down

0 comments on commit d104c5a

Please sign in to comment.