Skip to content

Commit

Permalink
Merge pull request #57 from One-Click-Auth/work_branch
Browse files Browse the repository at this point in the history
Update trustauthx to version 0.8.1
  • Loading branch information
moonlightnexus authored Apr 18, 2024
2 parents 5619fd4 + df7271e commit e67dcd1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
17 changes: 9 additions & 8 deletions trustauthx/authlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit e67dcd1

Please sign in to comment.