Skip to content

feature/refactor network#17

Merged
Dumbris merged 10 commits into
mainfrom
feature/refactor-network
Jul 14, 2025
Merged

feature/refactor network#17
Dumbris merged 10 commits into
mainfrom
feature/refactor-network

Conversation

@Dumbris

@Dumbris Dumbris commented Jul 13, 2025

Copy link
Copy Markdown
Member
  • Implement OAuth configuration and transport handling for upstream connections
  • Enhance OAuth handling and transport client creation
  • Document OAuth 2.1 authentication implementation and features in DESIGN.md and README.md

Dumbris added 10 commits July 13, 2025 07:57
…nections

- Added OAuthConfig struct to manage OAuth settings in ServerConfig.
- Introduced CreateOAuthConfig and related functions for OAuth handling in transport.
- Enhanced transport package to support HTTP, SSE, and stdio clients with OAuth integration.
- Implemented state management for connection states, improving error handling and notifications.
- Added NotificationManager for handling state change notifications across upstream connections.
- Implemented dynamic client registration for OAuth in the transport layer.
- Refactored CreateOAuthConfig to support callback server management and dynamic port allocation.
- Improved error handling and logging for OAuth flow in client connection methods.
- Added support for opening the browser for user authentication during OAuth flow.
- Enhanced logging for better traceability of OAuth-related operations.
…GN.md and README.md

- Added detailed description of OAuth 2.1 Authorization Code Flow with PKCE in DESIGN.md.
- Included key implementation features, OAuth flow sequence, and security considerations.
- Updated README.md to highlight OAuth authentication support, key features, and configuration options.
- Added ReadHeaderTimeout to the HTTP server configuration to mitigate Slowloris attacks.
- Updated error messages in client tests to reflect OAuth authorization requirements instead of SSE transport support.
- Introduced a constant for OS detection to improve code readability in client.go.
…nt tests

- Added environment variable check to disable OAuth during tests in config.go.
- Updated client tests to set the environment variable, ensuring no network calls are made.
- Adjusted error assertions to reflect connection errors instead of OAuth authorization errors when OAuth is disabled.
- Introduced a test HTTP server to simulate SSE endpoint responses in client_test.go.
- Updated test cases to utilize the test server, improving error handling assertions for connection failures.
- Refactored URL handling in tests to dynamically use the test server's URL for better isolation and reliability.
…andling

- Disabled OAuth for end-to-end tests to prevent network calls to mock servers.
- Restored original OAuth environment variable after test execution.
- Updated test server to simulate connection issues, returning 503 Service Unavailable for better error handling.
- Updated createTestServer function to use a blank identifier for the request parameter.
- Changed response writing to handle errors gracefully while simulating connection issues with a 503 Service Unavailable status.
- Added detailed debug logging for server configuration changes, including updates and removals.
- Improved logging for configuration reloads and file saves to provide better traceability.
- Introduced helper functions for comparing server configurations in the upstream manager.
- Simplified logging messages by removing debug prefixes and enhancing clarity.
- Updated log levels for configuration changes and reloads to improve traceability.
- Streamlined logging in the upstream manager for better consistency.
@Dumbris Dumbris merged commit 47f94ff into main Jul 14, 2025
31 checks passed
rannow pushed a commit to rannow/mcpproxy-go that referenced this pull request Sep 23, 2025
* Implement OAuth configuration and transport handling for upstream connections

- Added OAuthConfig struct to manage OAuth settings in ServerConfig.
- Introduced CreateOAuthConfig and related functions for OAuth handling in transport.
- Enhanced transport package to support HTTP, SSE, and stdio clients with OAuth integration.
- Implemented state management for connection states, improving error handling and notifications.
- Added NotificationManager for handling state change notifications across upstream connections.

* Enhance OAuth handling and transport client creation

- Implemented dynamic client registration for OAuth in the transport layer.
- Refactored CreateOAuthConfig to support callback server management and dynamic port allocation.
- Improved error handling and logging for OAuth flow in client connection methods.
- Added support for opening the browser for user authentication during OAuth flow.
- Enhanced logging for better traceability of OAuth-related operations.

* Document OAuth 2.1 authentication implementation and features in DESIGN.md and README.md

- Added detailed description of OAuth 2.1 Authorization Code Flow with PKCE in DESIGN.md.
- Included key implementation features, OAuth flow sequence, and security considerations.
- Updated README.md to highlight OAuth authentication support, key features, and configuration options.

* Enhance OAuth error handling and server configuration

- Added ReadHeaderTimeout to the HTTP server configuration to mitigate Slowloris attacks.
- Updated error messages in client tests to reflect OAuth authorization requirements instead of SSE transport support.
- Introduced a constant for OS detection to improve code readability in client.go.

* Implement OAuth disabling for tests and update error handling in client tests

- Added environment variable check to disable OAuth during tests in config.go.
- Updated client tests to set the environment variable, ensuring no network calls are made.
- Adjusted error assertions to reflect connection errors instead of OAuth authorization errors when OAuth is disabled.

* Add test server for SSE protocol handling in client tests

- Introduced a test HTTP server to simulate SSE endpoint responses in client_test.go.
- Updated test cases to utilize the test server, improving error handling assertions for connection failures.
- Refactored URL handling in tests to dynamically use the test server's URL for better isolation and reliability.

* Enhance e2e test environment by disabling OAuth and improving error handling

- Disabled OAuth for end-to-end tests to prevent network calls to mock servers.
- Restored original OAuth environment variable after test execution.
- Updated test server to simulate connection issues, returning 503 Service Unavailable for better error handling.

* Refactor test server to improve error handling in client tests

- Updated createTestServer function to use a blank identifier for the request parameter.
- Changed response writing to handle errors gracefully while simulating connection issues with a 503 Service Unavailable status.

* Enhance logging for server configuration changes and file operations

- Added detailed debug logging for server configuration changes, including updates and removals.
- Improved logging for configuration reloads and file saves to provide better traceability.
- Introduced helper functions for comparing server configurations in the upstream manager.

* Refactor logging for server configuration and file operations

- Simplified logging messages by removing debug prefixes and enhancing clarity.
- Updated log levels for configuration changes and reloads to improve traceability.
- Streamlined logging in the upstream manager for better consistency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant