Skip to content

Commit 03710ea

Browse files
committed
fix(upload): pass session to delta/status endpoint for auth
Both standalone_upload_client.py and remote_upload_client.py now pass the session from ~/.ctxce/auth.json as a query parameter to the /api/v1/delta/status endpoint. This fixes 401 errors when auth is enabled and the user has logged in.
1 parent 292975d commit 03710ea

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

scripts/remote_upload_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,9 +1196,14 @@ def get_server_status(self) -> Dict[str, Any]:
11961196
connect_timeout = min(self.timeout, 10)
11971197
# Allow slower responses (e.g., cold starts/large collections) before bailing
11981198
read_timeout = max(self.timeout, 30)
1199+
params = {'workspace_path': container_workspace_path}
1200+
# Add session to params if available (flows through to backend auth)
1201+
sess = get_auth_session(self.upload_endpoint)
1202+
if sess:
1203+
params['session'] = sess
11991204
response = self.session.get(
12001205
f"{self.upload_endpoint}/api/v1/delta/status",
1201-
params={'workspace_path': container_workspace_path},
1206+
params=params,
12021207
timeout=(connect_timeout, read_timeout)
12031208
)
12041209

scripts/standalone_upload_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1398,9 +1398,14 @@ def get_server_status(self) -> Dict[str, Any]:
13981398
connect_timeout = min(self.timeout, 10)
13991399
# Allow slower responses (e.g., cold starts/large collections) before bailing
14001400
read_timeout = max(self.timeout, 30)
1401+
params = {'workspace_path': container_workspace_path}
1402+
# Add session to params if available (flows through to backend auth)
1403+
sess = get_auth_session(self.upload_endpoint)
1404+
if sess:
1405+
params['session'] = sess
14011406
response = self.session.get(
14021407
f"{self.upload_endpoint}/api/v1/delta/status",
1403-
params={'workspace_path': container_workspace_path},
1408+
params=params,
14041409
timeout=(connect_timeout, read_timeout)
14051410
)
14061411

0 commit comments

Comments
 (0)