Skip to content

Commit 0c5d405

Browse files
Add update_user method
1 parent 0fdc8ee commit 0c5d405

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

authsignal/client.py

+18
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing import Dict, Any, Optional
77
import json
88
import requests
9+
import urllib.parse
910

1011
_UNICODE_STRING = str
1112

@@ -148,6 +149,23 @@ def get_user(self, user_id, redirect_url=None, path=None):
148149
return humps.decamelize(response.json())
149150
except requests.exceptions.RequestException as e:
150151
raise ApiException(str(e), path) from e
152+
153+
def update_user(self, user_id, data):
154+
user_id = urllib.parse.quote(user_id)
155+
156+
path = self._get_user_url(user_id)
157+
158+
headers = self._default_headers()
159+
160+
response = requests.post(path,
161+
json=data,
162+
headers=headers,
163+
auth=requests.auth.HTTPBasicAuth(self.api_key, '')
164+
)
165+
166+
response.raise_for_status()
167+
168+
return response.json()
151169

152170
def enroll_verified_authenticator(self, user_id, authenticator_payload, path=None):
153171
"""Enrols an authenticator like a phone number for SMS on behalf of the user

authsignal/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '2.0.3'
1+
VERSION = '2.0.4'

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "authsignal"
3-
version = "2.0.3"
3+
version = "2.0.4"
44
description = "Authsignal Python SDK for Passwordless Step Up Authentication"
55
authors = ["justinsoong <[email protected]>"]
66
license = "MIT"

0 commit comments

Comments
 (0)