Sync types and clients with backend for social auth and agent assignments

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 4.6 committed 2026-03-24 22:42:43 -04:00
1 parent 3c75c2296e
commit 1576447b4b
4 files changed
+46 -9

No files matched your search

+6
View File
@@ -42,7 +42,10 @@ from .types import (
AuthRegisterResponse, AuthRegisterResponse,
AuthLoginResponse, AuthLoginResponse,
GetMeResponse, GetMeResponse,
IssueApiTokenResponse,
RotateApiTokenResponse,
IssueTokenResponse, IssueTokenResponse,
RotateTokenResponse,
HealthResponse, HealthResponse,
) )
@@ -91,6 +94,9 @@ __all__ = [
"AuthRegisterResponse", "AuthRegisterResponse",
"AuthLoginResponse", "AuthLoginResponse",
"GetMeResponse", "GetMeResponse",
"IssueApiTokenResponse",
"RotateApiTokenResponse",
"IssueTokenResponse", "IssueTokenResponse",
"RotateTokenResponse",
"HealthResponse", "HealthResponse",
] ]
+12 -3
View File
@@ -23,7 +23,8 @@ from .types import (
GetMeResponse, GetMeResponse,
GetOperationResponse, GetOperationResponse,
HealthResponse, HealthResponse,
IssueTokenResponse, IssueApiTokenResponse,
RotateApiTokenResponse,
JWKSResponse, JWKSResponse,
ListAgentsResponse, ListAgentsResponse,
ListEpochsResponse, ListEpochsResponse,
@@ -199,13 +200,21 @@ class AsyncElydoraClient:
"""Get the current user's profile.""" """Get the current user's profile."""
return await self._request("GET", "/v1/auth/me") return await self._request("GET", "/v1/auth/me")
async def issue_token(self, ttl_seconds: Optional[int] = None) -> IssueTokenResponse: async def issue_api_token(self, ttl_seconds: Optional[int] = None) -> IssueApiTokenResponse:
"""Issue an API token with an optional TTL.""" """Issue an API token with an optional TTL."""
body: Dict[str, Any] = {} body: Dict[str, Any] = {}
if ttl_seconds is not None: if ttl_seconds is not None:
body["ttl_seconds"] = ttl_seconds body["ttl_seconds"] = ttl_seconds
return await self._request("POST", "/v1/auth/token", json_body=body) return await self._request("POST", "/v1/auth/token", json_body=body)
async def issue_token(self, ttl_seconds: Optional[int] = None) -> IssueApiTokenResponse:
"""Deprecated: Use issue_api_token() instead."""
return await self.issue_api_token(ttl_seconds=ttl_seconds)
async def rotate_api_token(self) -> RotateApiTokenResponse:
"""Rotate the current API token and keep the old token in 24h grace."""
return await self._request("POST", "/v1/auth/rotate", json_body={})
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# Agent management # Agent management
# ----------------------------------------------------------------- # -----------------------------------------------------------------
@@ -300,7 +309,7 @@ class AsyncElydoraClient:
async def verify_operation(self, operation_id: str) -> VerifyOperationResponse: async def verify_operation(self, operation_id: str) -> VerifyOperationResponse:
"""Verify an operation's integrity.""" """Verify an operation's integrity."""
return await self._request("POST", f"/v1/operations/{operation_id}/verify") return await self._request("POST", f"/v1/operations/{operation_id}/verify", json_body={})
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# Audit # Audit
+12 -3
View File
@@ -22,7 +22,8 @@ from .types import (
GetMeResponse, GetMeResponse,
GetOperationResponse, GetOperationResponse,
HealthResponse, HealthResponse,
IssueTokenResponse, IssueApiTokenResponse,
RotateApiTokenResponse,
JWKSResponse, JWKSResponse,
ListAgentsResponse, ListAgentsResponse,
ListEpochsResponse, ListEpochsResponse,
@@ -190,13 +191,21 @@ class ElydoraClient:
"""Get the current user's profile.""" """Get the current user's profile."""
return self._request("GET", "/v1/auth/me") return self._request("GET", "/v1/auth/me")
def issue_token(self, ttl_seconds: Optional[int] = None) -> IssueTokenResponse: def issue_api_token(self, ttl_seconds: Optional[int] = None) -> IssueApiTokenResponse:
"""Issue an API token with an optional TTL.""" """Issue an API token with an optional TTL."""
body: Dict[str, Any] = {} body: Dict[str, Any] = {}
if ttl_seconds is not None: if ttl_seconds is not None:
body["ttl_seconds"] = ttl_seconds body["ttl_seconds"] = ttl_seconds
return self._request("POST", "/v1/auth/token", json_body=body) return self._request("POST", "/v1/auth/token", json_body=body)
def issue_token(self, ttl_seconds: Optional[int] = None) -> IssueApiTokenResponse:
"""Deprecated: Use issue_api_token() instead."""
return self.issue_api_token(ttl_seconds=ttl_seconds)
def rotate_api_token(self) -> RotateApiTokenResponse:
"""Rotate the current API token and keep the old token in 24h grace."""
return self._request("POST", "/v1/auth/rotate", json_body={})
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# Agent management # Agent management
# ----------------------------------------------------------------- # -----------------------------------------------------------------
@@ -293,7 +302,7 @@ class ElydoraClient:
def verify_operation(self, operation_id: str) -> VerifyOperationResponse: def verify_operation(self, operation_id: str) -> VerifyOperationResponse:
"""Verify an operation's integrity.""" """Verify an operation's integrity."""
return self._request("POST", f"/v1/operations/{operation_id}/verify") return self._request("POST", f"/v1/operations/{operation_id}/verify", json_body={})
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# Audit # Audit
+16 -3
View File
@@ -79,8 +79,8 @@ class Operation(TypedDict):
issued_at: int issued_at: int
ttl_ms: int ttl_ms: int
nonce: str nonce: str
subject: Dict[str, Any] subject: str
action: Dict[str, Any] action: str
payload_hash: str payload_hash: str
prev_chain_hash: str prev_chain_hash: str
chain_hash: str chain_hash: str
@@ -305,9 +305,22 @@ class GetMeResponse(TypedDict):
user: User user: User
class IssueTokenResponse(TypedDict): class IssueApiTokenResponse(TypedDict):
token: str token: str
expires_at: Optional[int] expires_at: Optional[int]
token_id: str
class RotateApiTokenResponse(TypedDict):
token: str
expires_at: Optional[int]
token_id: str
previous_token_grace_until: int
# Backward compatibility aliases (deprecated)
IssueTokenResponse = IssueApiTokenResponse
RotateTokenResponse = RotateApiTokenResponse
class HealthResponse(TypedDict): class HealthResponse(TypedDict):