Skip to content
Open
Changes from all 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
3 changes: 2 additions & 1 deletion lightdash/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(self, instance_url: str, access_token: str, project_uuid: str, conf
self.instance_url = instance_url.rstrip('/')
self.access_token = access_token
self.project_uuid = project_uuid
self.auth_header = "Bearer" if access_token.startswith("ldsvc_") else "ApiKey"

# Extract config values with defaults
config = config or {}
Expand Down Expand Up @@ -88,7 +89,7 @@ def _make_request(

with httpx.Client(
headers={
"Authorization": f"ApiKey {self.access_token}",
"Authorization": f"{self.auth_header} {self.access_token}",
"Accept": "application/json",
},
timeout=self.timeout
Expand Down