🚧 Update certificate management
This commit is contained in:
@@ -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", {})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user