add apikey
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
class UserNotFound(Exception): ...
|
||||
|
||||
|
||||
def get_user(access_token: str, *, idp_client) -> dict | None:
|
||||
"""Gets the user attributes and metadata for a user."""
|
||||
try:
|
||||
user = idp_client.get_user(AccessToken=access_token)
|
||||
except idp_client.exceptions.ClientError:
|
||||
return None
|
||||
raise UserNotFound()
|
||||
else:
|
||||
return {attr['Name']: attr['Value'] for attr in user['UserAttributes']}
|
||||
|
||||
Reference in New Issue
Block a user