Skip to content

Commit 7fafba2

Browse files
Merge branch 'tui_oauth' of github.com:Edison-Watch/open-edison into tui_oauth
2 parents bb0af7d + 0e9ef23 commit 7fafba2

File tree

6 files changed

+21
-4
lines changed

6 files changed

+21
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "open-edison"
3-
version = "0.1.47"
3+
version = "0.1.48"
44
description = "Open-source MCP security, aggregation, and monitoring. Single-user, self-hosted MCP proxy."
55
readme = "README.md"
66
authors = [

src/mcp_importer/api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
)
2727
from src.mcp_importer.merge import MergePolicy, merge_servers
2828
from src.oauth_manager import OAuthStatus, get_oauth_manager
29+
from src.oauth_override import OpenEdisonOAuth
2930

3031

3132
class CLIENT(str, Enum):
@@ -304,7 +305,7 @@ async def _authorize_async() -> bool:
304305
f"client_name={server.oauth_client_name or 'Open Edison Setup'}",
305306
)
306307

307-
oauth = OAuth(
308+
oauth = OpenEdisonOAuth(
308309
mcp_url=remote_url,
309310
scopes=server.oauth_scopes,
310311
client_name=server.oauth_client_name or "Open Edison Setup",

src/oauth_manager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
)
2020
from loguru import logger as log
2121

22+
from src.oauth_override import OpenEdisonOAuth
23+
2224

2325
class OAuthStatus(Enum):
2426
"""OAuth authentication status for MCP servers."""
@@ -209,7 +211,7 @@ def get_oauth_auth(
209211
return None
210212

211213
try:
212-
oauth = OAuth(
214+
oauth = OpenEdisonOAuth(
213215
mcp_url=mcp_url,
214216
scopes=scopes or info.scopes,
215217
client_name=client_name or info.client_name,

src/oauth_override.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import webbrowser
2+
3+
from fastmcp.client.auth.oauth import OAuth as _FastMCPOAuth
4+
5+
6+
class OpenEdisonOAuth(_FastMCPOAuth):
7+
async def redirect_handler(self, authorization_url: str) -> None: # noqa: ARG002
8+
# Print a clean, single-line URL and still open the browser.
9+
print(f"OAuth authorization URL: {authorization_url}", flush=True)
10+
webbrowser.open(authorization_url)

src/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
create_db_session,
3939
)
4040
from src.oauth_manager import OAuthStatus, get_oauth_manager
41+
from src.oauth_override import OpenEdisonOAuth
4142
from src.single_user_mcp import SingleUserMCP
4243
from src.telemetry import initialize_telemetry, set_servers_installed
4344

@@ -955,7 +956,7 @@ async def oauth_test_connection(
955956
log.info(f"🔗 Testing connection to {server_name} at {remote_url}")
956957

957958
# Create OAuth auth object
958-
oauth = OAuth(
959+
oauth = OpenEdisonOAuth(
959960
mcp_url=remote_url,
960961
scopes=scopes,
961962
client_name=client_name or "OpenEdison MCP Gateway",

src/vulture_whitelist.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from src.oauth_override import OpenEdisonOAuth
2+
3+
OpenEdisonOAuth.redirect_handler # noqa: B018 unused method (src/oauth_override.py:7)

0 commit comments

Comments
 (0)