Skip to content

Commit 4d55a1d

Browse files
jfrench9claude
andauthored
Refactor authentication system and remove unused auth_token parameter (#16)
## Summary This PR delivers a comprehensive authentication system overhaul, expanding password management capabilities while streamlining the API interface by removing unused authentication parameters across all endpoints. ## Key Accomplishments ### 🔐 Enhanced Authentication Features - **New Password Management Flow**: Added complete forgot/reset password functionality with token validation - **Email Verification System**: Implemented email verification and resend verification capabilities - **SSO Integration**: Enhanced single sign-on token generation support - **Session Management**: Renamed and improved session refresh functionality for better clarity ### 🧹 API Cleanup & Optimization - **Parameter Removal**: Eliminated unused `auth_token` parameter from 70+ API methods across all modules (agent, backup, connections, graph operations, user management, etc.) - **Consistent Interface**: Standardized authentication handling across the entire API surface - **Improved Maintainability**: Reduced code complexity by removing redundant authentication parameters ### 📚 Documentation Improvements - **README Restructure**: Significantly streamlined documentation for enhanced clarity and organization - **Reduced Complexity**: Condensed README content by ~200 lines while improving readability ## Technical Details ### New Authentication Endpoints - Forgot password workflow with secure token generation - Password reset with validation - Email verification and resend capabilities - Enhanced SSO token management ### Affected Modules - Agent operations (6 endpoints) - Backup management (6 endpoints) - Connection handling (12 endpoints) - Graph operations (analytics, billing, credits, health, limits) - User management and analytics - MCP tool integration - Schema and subgraph operations ## Breaking Changes ⚠️ **API Parameter Changes**: The `auth_token` parameter has been removed from all API methods. Applications using this parameter will need to be updated to use the standard authentication mechanisms. ## Testing Notes - Verify all existing API calls function correctly without the `auth_token` parameter - Test new password reset flow end-to-end - Validate email verification functionality - Confirm SSO token generation works as expected - Ensure session refresh operates correctly with the renamed method ## Infrastructure Considerations - Authentication flows now rely on standardized token handling - Email delivery infrastructure should be verified for password reset and verification features - Session management has been streamlined for improved performance - Consider updating any API documentation or client libraries that reference the removed parameter --- 🤖 Generated with [Claude Code](https://claude.ai/code) **Branch Info:** - Source: `feature/auth-update` - Target: `main` - Type: feature Co-Authored-By: Claude <noreply@anthropic.com>
2 parents 1007224 + a31a8f9 commit 4d55a1d

92 files changed

Lines changed: 1391 additions & 1643 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 15 additions & 229 deletions
Original file line numberDiff line numberDiff line change
@@ -3,251 +3,37 @@
33
[![PyPI version](https://badge.fury.io/py/robosystems-client.svg)](https://pypi.org/project/robosystems-client/)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
55

6-
Official Python Client for the RoboSystems Financial Knowledge Graph API. Access comprehensive financial data including accounting records, SEC filings, and advanced graph analytics through a type-safe, async-ready Python interface.
6+
Official Python Client for the RoboSystems Financial Knowledge Graph API. Access comprehensive financial data including accounting transactions, financial reports, and advanced graph analytics through a type-safe, async-ready Python interface.
77

88
## Features
99

1010
- **Type-safe API client** with full type hints and Pydantic models
1111
- **Async/await support** for high-performance applications
12-
- **Multi-tenant support** with graph-scoped operations
13-
- **Authentication handling** with API key and SSO support
14-
- **Comprehensive error handling** with custom exceptions
15-
- **Pagination support** for large data sets
16-
- **Streaming query support** for memory-efficient processing of large result sets
12+
- **Streaming support** for memory-efficient processing of large result sets
1713
- **Financial AI Agent** integration for natural language queries
14+
- **Comprehensive error handling** with custom exceptions
1815

1916
## Installation
2017

2118
```bash
2219
pip install robosystems-client
2320
```
2421

25-
## Quick Start
26-
27-
```python
28-
from robosystems_client import RoboSystemsSDK
29-
from robosystems_client.api.query import execute_cypher_query
30-
from robosystems_client.models import CypherQueryRequest
31-
32-
# Initialize the SDK
33-
sdk = RoboSystemsSDK(
34-
base_url="https://api.robosystems.ai",
35-
token="your-api-key",
36-
auth_header_name="X-API-Key",
37-
prefix="" # No prefix needed for API key
38-
)
39-
40-
# Async usage (recommended)
41-
import asyncio
42-
43-
async def main():
44-
# Execute a Cypher query
45-
query = CypherQueryRequest(
46-
query="MATCH (c:Company)-[:HAS_FILING]->(f:Filing) RETURN c.name, f.form_type, f.filing_date LIMIT 10"
47-
)
48-
result = await execute_cypher_query.asyncio(graph_id="your-graph-id", client=sdk, body=query)
49-
50-
for row in result.data:
51-
print(f"{row['c.name']} filed {row['f.form_type']} on {row['f.filing_date']}")
52-
53-
asyncio.run(main())
54-
```
55-
56-
## Key API Endpoints
57-
58-
### Graph Queries & Analytics
59-
```python
60-
from robosystems_client.api.query import execute_cypher_query
61-
from robosystems_client.api.graph_analytics import get_graph_metrics
62-
from robosystems_client.models import CypherQueryRequest
63-
64-
# Execute Cypher queries with parameters
65-
query_request = CypherQueryRequest(
66-
query="""MATCH (c:Company {ticker: $ticker})-[:HAS_METRIC]->(m:Metric)
67-
WHERE m.fiscal_year >= $start_year
68-
RETURN m.name, m.value, m.fiscal_year
69-
ORDER BY m.fiscal_year DESC""",
70-
parameters={"ticker": "AAPL", "start_year": 2020}
71-
)
72-
results = await execute_cypher_query.asyncio(
73-
graph_id="your-graph-id",
74-
client=sdk,
75-
body=query_request
76-
)
77-
78-
# Get graph analytics and metrics
79-
metrics = await get_graph_metrics.asyncio(
80-
graph_id="your-graph-id",
81-
client=sdk
82-
)
83-
print(f"Total nodes: {metrics.total_nodes}")
84-
print(f"Total relationships: {metrics.total_relationships}")
85-
```
86-
87-
### Financial AI Agent
88-
```python
89-
from robosystems_client.api.agent import query_financial_agent
90-
from robosystems_client.models import AgentRequest
91-
92-
# Natural language financial queries
93-
agent_request = AgentRequest(
94-
message="What was Apple's revenue growth over the last 3 years?",
95-
force_extended_analysis=True,
96-
context={"include_schema": True}
97-
)
98-
agent_response = await query_financial_agent.asyncio(
99-
graph_id="your-graph-id",
100-
client=sdk,
101-
body=agent_request
102-
)
103-
print(f"Response: {agent_response.message}")
104-
```
105-
106-
### Function Patterns
107-
108-
Every API endpoint provides multiple calling patterns:
109-
110-
- **`asyncio()`** - Async call, returns parsed response (recommended)
111-
- **`asyncio_detailed()`** - Async call, returns full Response object
112-
- **`sync()`** - Synchronous call, returns parsed response
113-
- **`sync_detailed()`** - Synchronous call, returns full Response object
114-
115-
## Streaming Support with Extensions
22+
## API Reference
11623

117-
The SDK includes an extensions module with SSE (Server-Sent Events) support for real-time streaming operations:
24+
- API reference: [https://api.robosystems.ai](https://api.robosystems.ai)
25+
- API documentation: [https://api.robosystems.ai/docs](https://api.robosystems.ai/docs)
26+
- OpenAPI specification: [https://api.robosystems.ai/openapi.json](https://api.robosystems.ai/openapi.json)
11827

119-
```python
120-
from robosystems_client.extensions import (
121-
SSEClient,
122-
QueryClient,
123-
OperationClient,
124-
RoboSystemsExtensions
125-
)
126-
from robosystems_client.models import CypherQueryRequest
127-
128-
# Initialize extensions
129-
extensions = RoboSystemsExtensions()
130-
131-
# Use QueryClient for advanced query operations
132-
query_client = QueryClient(sdk)
133-
134-
# Execute queries with the query client
135-
query = CypherQueryRequest(
136-
query="""MATCH (c:Company)-[:HAS_METRIC]->(m:Metric)
137-
WHERE m.fiscal_year >= 2020
138-
RETURN c.name, m.name, m.value, m.fiscal_year
139-
ORDER BY c.name, m.fiscal_year""",
140-
parameters={}
141-
)
142-
143-
# Monitor long-running operations with SSE
144-
operation_client = OperationClient(sdk)
145-
146-
# Stream operation events
147-
from robosystems_client.api.operations import stream_operation_events
148-
await stream_operation_events.asyncio(
149-
operation_id="op-123",
150-
client=sdk
151-
)
152-
```
28+
## Support
15329

154-
The extensions module provides:
155-
- SSE client for real-time event streaming
156-
- Query client with advanced query management
157-
- Operation client for monitoring long-running tasks
158-
- Utilities for result processing and caching
30+
- Issues: [Issues](https://github.com/RoboFinSystems/robosystems-python-client/issues)
31+
- Discussions: [Discussions](https://github.com/RoboFinSystems/robosystems-python-client/discussions)
32+
- Projects: [Projects](https://github.com/RoboFinSystems/robosystems-python-client/projects)
33+
- Wiki: [Wiki](https://github.com/RoboFinSystems/robosystems-python-client/wiki)
15934

160-
## Error Handling
35+
## License
16136

162-
```python
163-
from robosystems_client.types import Response
164-
from robosystems_client.errors import UnexpectedStatus
165-
import httpx
37+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
16638

167-
try:
168-
# API calls that might fail
169-
result = await execute_cypher_query.asyncio(
170-
graph_id="your-graph-id",
171-
client=sdk,
172-
body=query_request
173-
)
174-
except UnexpectedStatus as e:
175-
# Handle API errors (4xx, 5xx)
176-
print(f"API error: {e.status_code}")
177-
print(f"Error details: {e.content}")
178-
179-
# Parse error response if JSON
180-
if e.status_code == 400:
181-
error_detail = e.content.decode('utf-8')
182-
print(f"Validation error: {error_detail}")
183-
elif e.status_code == 401:
184-
print("Authentication failed - check your API key")
185-
elif e.status_code == 403:
186-
print("Permission denied - check graph access")
187-
elif e.status_code == 429:
188-
print("Rate limit exceeded - retry later")
189-
except httpx.TimeoutException:
190-
print("Request timed out - try again")
191-
except httpx.NetworkError as e:
192-
print(f"Network error: {e}")
193-
except Exception as e:
194-
print(f"Unexpected error: {type(e).__name__}: {e}")
195-
196-
# Using detailed responses for better error handling
197-
from robosystems_client.api.query import execute_cypher_query
198-
199-
response = await execute_cypher_query.asyncio_detailed(
200-
graph_id="your-graph-id",
201-
client=sdk,
202-
body=query_request
203-
)
204-
205-
if response.status_code == 200:
206-
result = response.parsed
207-
print(f"Success: Query executed successfully")
208-
else:
209-
print(f"Failed with status {response.status_code}")
210-
print(f"Headers: {response.headers}")
211-
print(f"Content: {response.content}")
212-
```
213-
214-
## Development
215-
216-
This Client is auto-generated from the RoboSystems OpenAPI specification to ensure it stays in sync with the latest API changes.
217-
218-
### Setup
219-
220-
```bash
221-
just venv
222-
just install
223-
```
224-
225-
### Regenerating the Client
226-
227-
When the API changes, regenerate the Client from the OpenAPI spec:
228-
229-
```bash
230-
# From localhost (development)
231-
just generate-client http://localhost:8000/openapi.json
232-
233-
# From staging
234-
just generate-client https://staging.api.robosystems.ai/openapi.json
235-
236-
# From production
237-
just generate-client https://api.robosystems.ai/openapi.json
238-
```
239-
240-
### Testing
241-
242-
```bash
243-
just test
244-
just test-cov
245-
```
246-
247-
### Code Quality
248-
249-
```bash
250-
just lint
251-
just format
252-
just typecheck
253-
```
39+
MIT © 2025 RFS LLC

‎robosystems_client/api/agent/auto_select_agent.py‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,14 @@ def _get_kwargs(
1717
*,
1818
body: AgentRequest,
1919
authorization: Union[None, Unset, str] = UNSET,
20-
auth_token: Union[None, Unset, str] = UNSET,
2120
) -> dict[str, Any]:
2221
headers: dict[str, Any] = {}
2322
if not isinstance(authorization, Unset):
2423
headers["authorization"] = authorization
2524

26-
cookies = {}
27-
if auth_token is not UNSET:
28-
cookies["auth-token"] = auth_token
29-
3025
_kwargs: dict[str, Any] = {
3126
"method": "post",
3227
"url": f"/v1/{graph_id}/agent",
33-
"cookies": cookies,
3428
}
3529

3630
_kwargs["json"] = body.to_dict()
@@ -88,7 +82,6 @@ def sync_detailed(
8882
client: AuthenticatedClient,
8983
body: AgentRequest,
9084
authorization: Union[None, Unset, str] = UNSET,
91-
auth_token: Union[None, Unset, str] = UNSET,
9285
) -> Response[Union[AgentResponse, Any, ErrorResponse, HTTPValidationError]]:
9386
"""Auto-select agent for query
9487
@@ -105,7 +98,6 @@ def sync_detailed(
10598
Args:
10699
graph_id (str):
107100
authorization (Union[None, Unset, str]):
108-
auth_token (Union[None, Unset, str]):
109101
body (AgentRequest): Request model for agent interactions.
110102
111103
Raises:
@@ -120,7 +112,6 @@ def sync_detailed(
120112
graph_id=graph_id,
121113
body=body,
122114
authorization=authorization,
123-
auth_token=auth_token,
124115
)
125116

126117
response = client.get_httpx_client().request(
@@ -136,7 +127,6 @@ def sync(
136127
client: AuthenticatedClient,
137128
body: AgentRequest,
138129
authorization: Union[None, Unset, str] = UNSET,
139-
auth_token: Union[None, Unset, str] = UNSET,
140130
) -> Optional[Union[AgentResponse, Any, ErrorResponse, HTTPValidationError]]:
141131
"""Auto-select agent for query
142132
@@ -153,7 +143,6 @@ def sync(
153143
Args:
154144
graph_id (str):
155145
authorization (Union[None, Unset, str]):
156-
auth_token (Union[None, Unset, str]):
157146
body (AgentRequest): Request model for agent interactions.
158147
159148
Raises:
@@ -169,7 +158,6 @@ def sync(
169158
client=client,
170159
body=body,
171160
authorization=authorization,
172-
auth_token=auth_token,
173161
).parsed
174162

175163

@@ -179,7 +167,6 @@ async def asyncio_detailed(
179167
client: AuthenticatedClient,
180168
body: AgentRequest,
181169
authorization: Union[None, Unset, str] = UNSET,
182-
auth_token: Union[None, Unset, str] = UNSET,
183170
) -> Response[Union[AgentResponse, Any, ErrorResponse, HTTPValidationError]]:
184171
"""Auto-select agent for query
185172
@@ -196,7 +183,6 @@ async def asyncio_detailed(
196183
Args:
197184
graph_id (str):
198185
authorization (Union[None, Unset, str]):
199-
auth_token (Union[None, Unset, str]):
200186
body (AgentRequest): Request model for agent interactions.
201187
202188
Raises:
@@ -211,7 +197,6 @@ async def asyncio_detailed(
211197
graph_id=graph_id,
212198
body=body,
213199
authorization=authorization,
214-
auth_token=auth_token,
215200
)
216201

217202
response = await client.get_async_httpx_client().request(**kwargs)
@@ -225,7 +210,6 @@ async def asyncio(
225210
client: AuthenticatedClient,
226211
body: AgentRequest,
227212
authorization: Union[None, Unset, str] = UNSET,
228-
auth_token: Union[None, Unset, str] = UNSET,
229213
) -> Optional[Union[AgentResponse, Any, ErrorResponse, HTTPValidationError]]:
230214
"""Auto-select agent for query
231215
@@ -242,7 +226,6 @@ async def asyncio(
242226
Args:
243227
graph_id (str):
244228
authorization (Union[None, Unset, str]):
245-
auth_token (Union[None, Unset, str]):
246229
body (AgentRequest): Request model for agent interactions.
247230
248231
Raises:
@@ -259,6 +242,5 @@ async def asyncio(
259242
client=client,
260243
body=body,
261244
authorization=authorization,
262-
auth_token=auth_token,
263245
)
264246
).parsed

0 commit comments

Comments
 (0)