Fix auth headers not applied after registration
Build and Push Docker Image / build (push) Successful in 51s
Details
Build and Push Docker Image / build (push) Successful in 51s
Details
Bug: After registration, credentials were set directly on private attributes (_agent_id, _agent_secret) instead of using property setters. This bypassed _invalidate_client(), so the HTTP client kept using old headers without X-Agent-Id/X-Agent-Secret. Fix: Use property setters (self.agent_id, self.agent_secret) which trigger _invalidate_client() to recreate the client with new headers. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
7b2674debf
commit
813e9127f5
|
|
@ -347,8 +347,9 @@ class OrchestratorClient:
|
||||||
# Handle response based on registration flow
|
# Handle response based on registration flow
|
||||||
if "agent_secret" in data:
|
if "agent_secret" in data:
|
||||||
# New secure registration response
|
# New secure registration response
|
||||||
self._agent_id = data["agent_id"]
|
# Use setters to trigger client invalidation
|
||||||
self._agent_secret = data["agent_secret"]
|
self.agent_id = data["agent_id"]
|
||||||
|
self.agent_secret = data["agent_secret"]
|
||||||
self._tenant_id = data.get("tenant_id")
|
self._tenant_id = data.get("tenant_id")
|
||||||
|
|
||||||
# Persist credentials for restart recovery
|
# Persist credentials for restart recovery
|
||||||
|
|
@ -362,8 +363,9 @@ class OrchestratorClient:
|
||||||
return self._agent_id, self._agent_secret, self._tenant_id
|
return self._agent_id, self._agent_secret, self._tenant_id
|
||||||
else:
|
else:
|
||||||
# Legacy registration response
|
# Legacy registration response
|
||||||
self._agent_id = data["agent_id"]
|
# Use setters to trigger client invalidation
|
||||||
self._token = data.get("token")
|
self.agent_id = data["agent_id"]
|
||||||
|
self.token = data.get("token")
|
||||||
self._tenant_id = self.settings.tenant_id
|
self._tenant_id = self.settings.tenant_id
|
||||||
|
|
||||||
# Also persist legacy credentials
|
# Also persist legacy credentials
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue