Skip to content

Commit 81c470f

Browse files
committed
refactor: pull out oauth helper functions
1 parent da4fce2 commit 81c470f

File tree

6 files changed

+465
-270
lines changed

6 files changed

+465
-270
lines changed

src/mcp/client/auth/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
Implements authorization code flow with PKCE and automatic token refresh.
55
"""
66

7+
from mcp.client.auth.exceptions import OAuthFlowError, OAuthRegistrationError, OAuthTokenError
78
from mcp.client.auth.oauth2 import (
89
OAuthClientProvider,
9-
OAuthFlowError,
10-
OAuthRegistrationError,
11-
OAuthTokenError,
1210
PKCEParameters,
1311
TokenStorage,
1412
)

src/mcp/client/auth/exceptions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class OAuthFlowError(Exception):
2+
"""Base exception for OAuth flow errors."""
3+
4+
5+
class OAuthTokenError(OAuthFlowError):
6+
"""Raised when token operations fail."""
7+
8+
9+
class OAuthRegistrationError(OAuthFlowError):
10+
"""Raised when client registration fails."""

0 commit comments

Comments
 (0)