Update auth references from JWT to session tokens
- Remove previous_token_grace_until from RotateApiTokenResponse - Update client/async_client docstrings - Update CLI help text and README Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
1576447b4b
commit
024ea8ee97
5 files changed
+8
-9
No files matched your search
@@ -48,7 +48,7 @@ async def main():
|
|||||||
org_id="org-123",
|
org_id="org-123",
|
||||||
agent_id="agent-456",
|
agent_id="agent-456",
|
||||||
private_key="<base64url-encoded-ed25519-seed>",
|
private_key="<base64url-encoded-ed25519-seed>",
|
||||||
token="<jwt-token>",
|
token="<api-token>",
|
||||||
)
|
)
|
||||||
|
|
||||||
eor = client.create_operation(
|
eor = client.create_operation(
|
||||||
@@ -107,7 +107,7 @@ client = ElydoraClient(
|
|||||||
base_url="https://...", # API base URL (default: https://api.elydora.com)
|
base_url="https://...", # API base URL (default: https://api.elydora.com)
|
||||||
ttl_ms=30000, # Operation TTL in ms (default: 30000)
|
ttl_ms=30000, # Operation TTL in ms (default: 30000)
|
||||||
max_retries=3, # Max retries on transient failures (default: 3)
|
max_retries=3, # Max retries on transient failures (default: 3)
|
||||||
token="<jwt>", # Optional JWT bearer token
|
token="<api-token>", # Optional API token
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ client = ElydoraClient(
|
|||||||
# Register a new user and organization
|
# Register a new user and organization
|
||||||
reg = ElydoraClient.register(base_url, email, password, display_name=None, org_name=None)
|
reg = ElydoraClient.register(base_url, email, password, display_name=None, org_name=None)
|
||||||
|
|
||||||
# Login and receive a JWT
|
# Login and receive a session token
|
||||||
auth = ElydoraClient.login(base_url, email, password)
|
auth = ElydoraClient.login(base_url, email, password)
|
||||||
|
|
||||||
# Get current authenticated user profile
|
# Get current authenticated user profile
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class AsyncElydoraClient:
|
|||||||
base_url: API base URL.
|
base_url: API base URL.
|
||||||
ttl_ms: Time-to-live for operations in milliseconds.
|
ttl_ms: Time-to-live for operations in milliseconds.
|
||||||
max_retries: Maximum number of retries on transient failures.
|
max_retries: Maximum number of retries on transient failures.
|
||||||
token: Optional JWT bearer token for authenticated endpoints.
|
token: Optional API token for authenticated endpoints.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
@@ -187,7 +187,7 @@ class AsyncElydoraClient:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
async def login(base_url: str, email: str, password: str) -> AuthLoginResponse:
|
async def login(base_url: str, email: str, password: str) -> AuthLoginResponse:
|
||||||
"""Authenticate and receive a JWT."""
|
"""Authenticate and receive a session token."""
|
||||||
url = f"{base_url.rstrip('/')}/v1/auth/login"
|
url = f"{base_url.rstrip('/')}/v1/auth/login"
|
||||||
body = {"email": email, "password": password}
|
body = {"email": email, "password": password}
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
|
|||||||
+1
-1
@@ -172,7 +172,7 @@ def build_parser() -> argparse.ArgumentParser:
|
|||||||
install_parser.add_argument("--agent_id", required=True, help="Agent ID")
|
install_parser.add_argument("--agent_id", required=True, help="Agent ID")
|
||||||
install_parser.add_argument("--private_key", required=True, help="Base64url-encoded Ed25519 private key seed")
|
install_parser.add_argument("--private_key", required=True, help="Base64url-encoded Ed25519 private key seed")
|
||||||
install_parser.add_argument("--kid", required=True, help="Key ID")
|
install_parser.add_argument("--kid", required=True, help="Key ID")
|
||||||
install_parser.add_argument("--token", default="", help="JWT bearer token (optional)")
|
install_parser.add_argument("--token", default="", help="API token (from Console)")
|
||||||
install_parser.add_argument("--base_url", default="https://api.elydora.com", help="API base URL")
|
install_parser.add_argument("--base_url", default="https://api.elydora.com", help="API base URL")
|
||||||
|
|
||||||
# uninstall
|
# uninstall
|
||||||
|
|||||||
+2
-2
@@ -50,7 +50,7 @@ class ElydoraClient:
|
|||||||
base_url: API base URL.
|
base_url: API base URL.
|
||||||
ttl_ms: Time-to-live for operations in milliseconds.
|
ttl_ms: Time-to-live for operations in milliseconds.
|
||||||
max_retries: Maximum number of retries on transient failures.
|
max_retries: Maximum number of retries on transient failures.
|
||||||
token: Optional JWT bearer token for authenticated endpoints.
|
token: Optional API token for authenticated endpoints.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
@@ -181,7 +181,7 @@ class ElydoraClient:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def login(base_url: str, email: str, password: str) -> AuthLoginResponse:
|
def login(base_url: str, email: str, password: str) -> AuthLoginResponse:
|
||||||
"""Authenticate and receive a JWT."""
|
"""Authenticate and receive a session token."""
|
||||||
url = f"{base_url.rstrip('/')}/v1/auth/login"
|
url = f"{base_url.rstrip('/')}/v1/auth/login"
|
||||||
body = {"email": email, "password": password}
|
body = {"email": email, "password": password}
|
||||||
resp = requests.post(url, json=body, headers={"Content-Type": "application/json"}, timeout=30)
|
resp = requests.post(url, json=body, headers={"Content-Type": "application/json"}, timeout=30)
|
||||||
|
|||||||
@@ -315,7 +315,6 @@ class RotateApiTokenResponse(TypedDict):
|
|||||||
token: str
|
token: str
|
||||||
expires_at: Optional[int]
|
expires_at: Optional[int]
|
||||||
token_id: str
|
token_id: str
|
||||||
previous_token_grace_until: int
|
|
||||||
|
|
||||||
|
|
||||||
# Backward compatibility aliases (deprecated)
|
# Backward compatibility aliases (deprecated)
|
||||||
|
|||||||
Reference in new issue
Block a user