mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
fix(mcp): serialize hosted oauth reauthorization
This commit is contained in:
parent
b09f1ba770
commit
11eaa77daf
4 changed files with 56 additions and 0 deletions
|
|
@ -72,6 +72,28 @@ def test_dashboard_flow_rejects_second_callback():
|
|||
flow.deliver_callback(code="second", state="state", error=None)
|
||||
|
||||
|
||||
def test_dashboard_flow_cannot_resurrect_after_terminal_error():
|
||||
from tools.mcp_dashboard_oauth import DashboardOAuthFlow
|
||||
|
||||
flow = DashboardOAuthFlow(
|
||||
flow_id="flow-terminal",
|
||||
server_name="reports",
|
||||
profile=None,
|
||||
redirect_uri="https://agent.example/mcp/oauth/callback/flow-terminal",
|
||||
)
|
||||
flow.mark_error("start timed out")
|
||||
|
||||
with pytest.raises(RuntimeError, match="already ended"):
|
||||
asyncio.run(
|
||||
flow.publish_authorization_url(
|
||||
"https://idp.example/authorize?state=too-late"
|
||||
)
|
||||
)
|
||||
|
||||
assert flow.status == "error"
|
||||
assert flow.authorization_url is None
|
||||
|
||||
|
||||
def test_dashboard_context_overrides_redirect_and_handlers():
|
||||
from tools.mcp_dashboard_oauth import (
|
||||
DashboardOAuthFlow,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue