From 05f0d84fcc77cbd07b06bda60f21faac250c71b5 Mon Sep 17 00:00:00 2001 From: Vijay Bandari Date: Tue, 21 Apr 2026 17:51:00 -0700 Subject: [PATCH] Set auth header to Bearer to support service accounts --- lightdash/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lightdash/client.py b/lightdash/client.py index 2e44768..09d65a2 100644 --- a/lightdash/client.py +++ b/lightdash/client.py @@ -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 {} @@ -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