🚧 Update certificate management

This commit is contained in:
Jonas Bengtsson
2026-09-19 17:12:58 +02:00
parent 111d6cc390
commit a16a01b1e7
21 changed files with 1128 additions and 37 deletions
+13
View File
@@ -233,6 +233,19 @@ class DynsecClient:
def set_client_password(self, username: str, password: str) -> None:
self._command("setClientPassword", username=username, password=password)
def set_client_id(self, username: str, clientid: str | None) -> None:
"""Bind (or clear) the expected client ID for a username.
With a bound client ID, connections must present exactly that
client id (username + password + client id must all match) — this
is what stops one device's credentials being reused by another
program (spec section 11: "bind an expected client ID").
"""
if clientid is None or clientid == "":
self._command("setClientId", username=username, clientid="")
else:
self._command("setClientId", username=username, clientid=clientid)
def get_client(self, username: str) -> dict[str, Any]:
return self._command("getClient", username=username).get("client", {})