From 13322d2cac9135c6fbafc207dde215c4dd2f0063 Mon Sep 17 00:00:00 2001 From: Jono Templeton Date: Fri, 29 Nov 2024 10:39:29 +1300 Subject: [PATCH] AUT-2461: updating python sdk --- authsignal/client.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/authsignal/client.py b/authsignal/client.py index b10227a..c261d0a 100644 --- a/authsignal/client.py +++ b/authsignal/client.py @@ -155,7 +155,7 @@ def update_user(self, user_id: str, attributes: Dict[str, Any]) -> Dict[str, Any path = f"{self.api_url}/users/{urllib.parse.quote(user_id)}" - response = self.session.post( + response = self.session.patch( url=path, data=json.dumps(attributes, cls=DecimalEncoder) ) @@ -172,7 +172,7 @@ def delete_user(self, user_id: str) -> Dict[str, Any]: response = self.session.delete(url=path) - return response.decamelized_content + return def get_authenticators(self, user_id: str) -> Dict[str, Any]: """Retrieves the authenticators for a user @@ -221,13 +221,15 @@ def delete_authenticator( response = self.session.delete(url=path) - return response.decamelized_content + return def validate_challenge(self, attributes: Dict[str, Any]) -> Dict[str, Any]: """Validates a token from authsignal Args: attributes: A dictionary containing the token to validate. """ + _assert_non_empty_dict(attributes, "attributes") + path = f"{self.api_url}/validate" response = self.session.post(