xpander-sdk 2.0.180__py3-none-any.whl → 2.0.181__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xpander_sdk/modules/backend/utils/mcp_oauth.py +5 -10
- {xpander_sdk-2.0.180.dist-info → xpander_sdk-2.0.181.dist-info}/METADATA +1 -1
- {xpander_sdk-2.0.180.dist-info → xpander_sdk-2.0.181.dist-info}/RECORD +6 -6
- {xpander_sdk-2.0.180.dist-info → xpander_sdk-2.0.181.dist-info}/WHEEL +0 -0
- {xpander_sdk-2.0.180.dist-info → xpander_sdk-2.0.181.dist-info}/licenses/LICENSE +0 -0
- {xpander_sdk-2.0.180.dist-info → xpander_sdk-2.0.181.dist-info}/top_level.txt +0 -0
|
@@ -43,15 +43,16 @@ async def push_event(task: Task, event: TaskUpdateEvent, event_type: TaskUpdateE
|
|
|
43
43
|
if registry.has_auth_handlers():
|
|
44
44
|
await registry.invoke_auth_handlers(task.configuration.state.agent, task, evt)
|
|
45
45
|
|
|
46
|
-
async def get_token(mcp_server: MCPServerDetails, task: Task, user_id: str) -> MCPOAuthGetTokenResponse:
|
|
46
|
+
async def get_token(mcp_server: MCPServerDetails, task: Task, user_id: str, return_result: Optional[bool] = False, generate_login_url: Optional[bool] = True) -> MCPOAuthGetTokenResponse:
|
|
47
47
|
client = APIClient(configuration=task.configuration)
|
|
48
48
|
result: MCPOAuthGetTokenResponse = await client.make_request(
|
|
49
49
|
path=APIRoute.GetUserMCPAuthToken.format(agent_id=task.agent_id, user_id=user_id),
|
|
50
50
|
method="POST",
|
|
51
|
+
query={"generate_login_url": generate_login_url},
|
|
51
52
|
payload=mcp_server.model_dump(),
|
|
52
53
|
model=MCPOAuthGetTokenResponse
|
|
53
54
|
)
|
|
54
|
-
if result.type == MCPOAuthResponseType.TOKEN_READY:
|
|
55
|
+
if result.type == MCPOAuthResponseType.TOKEN_READY or return_result:
|
|
55
56
|
return result
|
|
56
57
|
|
|
57
58
|
return None
|
|
@@ -62,13 +63,7 @@ async def authenticate_mcp_server(mcp_server: MCPServerDetails, task: Task, user
|
|
|
62
63
|
|
|
63
64
|
user_identifier = user_id if mcp_server.share_user_token_across_other_agents else f"{task.agent_id}_{user_id}"
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
result: MCPOAuthGetTokenResponse = await client.make_request(
|
|
67
|
-
path=APIRoute.GetUserMCPAuthToken.format(agent_id=task.agent_id, user_id=user_identifier),
|
|
68
|
-
method="POST",
|
|
69
|
-
payload=mcp_server.model_dump(),
|
|
70
|
-
model=MCPOAuthGetTokenResponse
|
|
71
|
-
)
|
|
66
|
+
result: MCPOAuthGetTokenResponse = await get_token(mcp_server=mcp_server, task=task, user_id=user_identifier, return_result=True)
|
|
72
67
|
|
|
73
68
|
if not result:
|
|
74
69
|
raise Exception("Invalid response")
|
|
@@ -85,7 +80,7 @@ async def authenticate_mcp_server(mcp_server: MCPServerDetails, task: Task, user
|
|
|
85
80
|
elapsed_time += POLLING_INTERVAL
|
|
86
81
|
|
|
87
82
|
# Check for token
|
|
88
|
-
token_result = await get_token(mcp_server=mcp_server, task=task, user_id=user_identifier)
|
|
83
|
+
token_result = await get_token(mcp_server=mcp_server, task=task, user_id=user_identifier, generate_login_url=False)
|
|
89
84
|
if token_result and token_result.type == MCPOAuthResponseType.TOKEN_READY:
|
|
90
85
|
logger.info(f"Successful login for MCP Server {mcp_server.url}")
|
|
91
86
|
redacted_token_result = MCPOAuthGetTokenResponse(**token_result.model_dump_safe())
|
|
@@ -36,7 +36,7 @@ xpander_sdk/modules/backend/frameworks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JC
|
|
|
36
36
|
xpander_sdk/modules/backend/frameworks/agno.py,sha256=N5XCXIo81MRhg4GVtB5NofbXiu_EDJC_Av_rCabZA-Y,41394
|
|
37
37
|
xpander_sdk/modules/backend/frameworks/dispatch.py,sha256=ht9hT5-cHATofQbWsbWeTARx51Hne3TNNNjw6KECRtA,1814
|
|
38
38
|
xpander_sdk/modules/backend/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
|
-
xpander_sdk/modules/backend/utils/mcp_oauth.py,sha256=
|
|
39
|
+
xpander_sdk/modules/backend/utils/mcp_oauth.py,sha256=5sYJcw557V3pSgutxUFzkBp5YxUJFUoB1V1rEe814pc,5430
|
|
40
40
|
xpander_sdk/modules/events/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
41
|
xpander_sdk/modules/events/events_module.py,sha256=DVlho7JxT6Jy8GeyuSakswmYwR18xqO2JcCJ-8Zc3s8,25317
|
|
42
42
|
xpander_sdk/modules/events/decorators/__init__.py,sha256=8GhR9afoLiS83a0OMLpn7TN2W6iTnlcVqos6bM34nac,129
|
|
@@ -87,8 +87,8 @@ xpander_sdk/utils/generic.py,sha256=XrRj2-L8c0YWpfPdDyXE-pVL-6lKF9VpyZzKHQ4wuCc,
|
|
|
87
87
|
xpander_sdk/utils/tools.py,sha256=lyFkq2yP7DxBkyXYVlnFRwDhQCvf0fZZMDm5fBycze4,1244
|
|
88
88
|
xpander_sdk/utils/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
89
89
|
xpander_sdk/utils/agents/compactization_agent.py,sha256=pqaf7LVSyPFaeXU62dMPY6iQ160TFga1KJ0Kgu1dIgg,14449
|
|
90
|
-
xpander_sdk-2.0.
|
|
91
|
-
xpander_sdk-2.0.
|
|
92
|
-
xpander_sdk-2.0.
|
|
93
|
-
xpander_sdk-2.0.
|
|
94
|
-
xpander_sdk-2.0.
|
|
90
|
+
xpander_sdk-2.0.181.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
91
|
+
xpander_sdk-2.0.181.dist-info/METADATA,sha256=t_sSqi0SqtoylSuNshvi1pFqNeolJSeArA9wKxAK0pg,17880
|
|
92
|
+
xpander_sdk-2.0.181.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
93
|
+
xpander_sdk-2.0.181.dist-info/top_level.txt,sha256=UCjnxQpsMy5Zoe7lmRuVDO6DI2V_6PgRFfm4oizRbVs,12
|
|
94
|
+
xpander_sdk-2.0.181.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|