Skip to content

Commit

Permalink
Update key id pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
jschlyter committed Jan 7, 2025
1 parent 6d51825 commit ba9de78
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dnstapir/key_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(self, client_database_base_url: str, key_cache: KeyCache | None = N
super().__init__(key_cache=key_cache)
self.client_database_base_url = client_database_base_url
self._httpx_client: httpx.Client | None = None
self.key_id_pattern = "%s"
self.key_id_pattern = "{key_id}"

def get_public_key_pem(self, key_id: str) -> bytes:
with tracer.start_as_current_span("get_public_key_pem_from_url"):
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.0"
version = "1.2.1"
description = "DNS TAPIR Python Library"
authors = ["Jakob Schlyter <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_key_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_url_key_resolver_pattern(httpx_mock: HTTPXMock):
httpx_mock.add_response(url=f"https://nodeman/api/v1/node/{key_id}/public_key", content=public_key_pem)
httpx_mock.add_response(url="https://nodeman/api/v1/node/unknown/public_key", status_code=404)

resolver = UrlKeyResolver(client_database_base_url="https://nodeman/api/v1/node/%s/public_key")
resolver = UrlKeyResolver(client_database_base_url="https://nodeman/api/v1/node/{key_id}/public_key")
res = resolver.resolve_public_key(key_id)
assert res == public_key

Expand Down

0 comments on commit ba9de78

Please sign in to comment.