diff --git a/setup.py b/setup.py index 139c6e4..52a48a2 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name="trustauthx", - version="0.7.3", + version="0.8.1", description="Official connector SDK for TrustAuthx", long_description=long_description, long_description_content_type="text/markdown", # This is important! diff --git a/trustauthx/authlite.py b/trustauthx/authlite.py index 3252ee1..7397fad 100644 --- a/trustauthx/authlite.py +++ b/trustauthx/authlite.py @@ -4,6 +4,7 @@ from dataclasses import asdict from functools import wraps from lib2to3.pgen2.parse import ParseError +from typing import Union import requests from jose import JWTError, jwt @@ -687,7 +688,7 @@ def re_auth(self, code): ) ) - def get_user(self, token, return_class=False) -> User | dict: + def get_user(self, token, return_class=False) -> Union[User, dict]: """ Validates the given authentication token and returns user data. @@ -919,12 +920,12 @@ def _re_init_roles(self) -> _Roles: def attach_role( self, uid: str, - rol_ids: str | list, + rol_ids: Union[str, list], signoff_session_and_assign=False, refresh_token=None, access_token=None, return_class: bool = False, - ) -> dict | SignOffSessionReplace: + ) -> Union[dict, SignOffSessionReplace]: """ Attaches a role to a user. @@ -984,12 +985,12 @@ def attach_role( def remove_role( self, uid: str, - rol_ids: str | list, + rol_ids: Union[str, list], signoff_session_and_assign=False, refresh_token=None, access_token=None, return_class: bool = False, - ) -> dict | SignOffSessionReplace: + ) -> Union[dict, SignOffSessionReplace]: """ Removes a role from a user. @@ -1049,13 +1050,13 @@ def remove_role( def update_role( self, uid: str, - rol_ids_to_add: str | list, - rol_ids_to_remove: str | list, + rol_ids_to_add: Union[str, list], + rol_ids_to_remove: Union[str, list], signoff_session_and_assign=False, refresh_token=None, access_token=None, return_class: bool = False, - ) -> dict | SignOffSessionReplace: + ) -> Union[dict, SignOffSessionReplace]: """ Updates a user's roles by adding and/or removing roles.