Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions tableauserverclient/models/tableau_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,19 +198,26 @@ class JWTAuth(Credentials):

"""

def __init__(self, jwt: str, site_id: Optional[str] = None, user_id_to_impersonate: Optional[str] = None) -> None:
def __init__(
self,
jwt: str,
isUat: Optional[bool] = False,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is None a valid value for isUat? Optional indicates that it is.

Copy link
Contributor Author

@BereketBirbo BereketBirbo Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is, but I just pushed another version making isUat just True or False as that is more clear

site_id: Optional[str] = None,
user_id_to_impersonate: Optional[str] = None,
) -> None:
if jwt is None:
raise TabError("Must provide a JWT token when using JWT authentication")
super().__init__(site_id, user_id_to_impersonate)
self.jwt = jwt
self.isUat = isUat

@property
def credentials(self) -> dict[str, str]:
return {"jwt": self.jwt}
return {"jwt": self.jwt, "isUat": str(self.isUat).lower()}

def __repr__(self):
if self.user_id_to_impersonate:
uid = f", user_id_to_impersonate=f{self.user_id_to_impersonate}"
else:
uid = ""
return f"<{self.__class__.__qualname__} jwt={self.jwt[:5]}... (site={self.site_id}{uid})>"
return f"<{self.__class__.__qualname__} jwt={self.jwt[:5]}... isUat={self.isUat} (site={self.site_id}{uid})>"