Update OAuth login workflow#52
Merged
Merged
Conversation
- Add `containsString` helper function to check if a string contains a substring. - Enhance OAuth error detection in `isOAuthError` method to identify specific OAuth-related errors. - Improve `isAuthError` method to exclude OAuth errors from non-OAuth authentication checks. - Introduce rate limiting for browser opening during OAuth authorization to prevent excessive attempts. This update improves the robustness of the OAuth authentication flow and enhances error handling during connection initialization.
- Introduced `auth` command with subcommands for manual OAuth login and status checks. - Implemented `runAuthLogin` and `runAuthStatus` functions for handling authentication flows. - Enhanced CLI client with manual OAuth triggering and status retrieval methods. - Updated main command structure to include the new authentication commands. This update improves user experience by providing direct command-line access to OAuth authentication management.
- Introduced TokenStoreManager for shared token persistence across client instances. - Updated server creation to track the actual config path used. - Enhanced OAuth client creation with detailed logging and context-based timeouts. - Implemented OAuth login functionality in the tray application, allowing users to authenticate directly from the menu. - Improved error handling and logging for OAuth processes, ensuring better observability and user guidance. This update streamlines the OAuth authentication flow and enhances user experience by providing direct access to OAuth login from the tray menu.
- Updated `runAuthLogin` and `runAuthStatus` functions to use underscore parameters for clarity. - Introduced `oauthRequired` constant for better readability in OAuth status checks. - Enhanced connection handling by replacing string literals with defined constants for transport types. This update improves code clarity and maintainability by adhering to best practices in constant usage and function signatures.
- Updated the ListTools method to check for server info availability before verifying tool support. - Added debug logging for better observability when server info is not available. This change improves error handling and provides clearer diagnostics when the client is not connected to a server.
- Simplified manual OAuth flow detection by using a context key instead of inspecting the call stack. - Enhanced logging to include server name and time since the last browser opening for better diagnostics. This update improves the clarity and observability of the OAuth authorization process.
…tation - Introduced a detailed debugging guide in CLAUDE.md, covering log locations, essential commands, and common issues for OAuth and tool discovery. - Implemented PersistentTokenStore for OAuth token management, allowing tokens to be stored and retrieved from a BoltDB database. - Enhanced existing authentication command functions to ensure proper resource management with deferred closure of clients. - Updated various components to utilize the new persistent storage for OAuth tokens, improving reliability and cross-process notifications. This update enhances the debugging capabilities and token management for OAuth, providing better observability and persistence across client instances.
- Added persistent storage support for OAuth tokens across various client components. - Improved logging during HTTP client and transport configuration creation for better observability. - Updated client constructors to include storage parameters, ensuring consistent token management. - Implemented connection retry logic after OAuth completion, enhancing reliability in cross-process scenarios. This update strengthens the OAuth flow and improves debugging capabilities across client instances.
- Updated `runAuthStatus` to close the client connection per iteration, avoiding defers in loops for better resource management. - Renamed `OAuthCompletionEvent` to `CompletionEvent` for clarity and consistency across the codebase. - Enhanced the `TokenStoreManager` and related methods to ensure proper handling of OAuth completion events. - Improved logging and error handling in various components to enhance observability during OAuth processes. This update streamlines the OAuth flow and optimizes resource management, ensuring better performance and reliability.
- Updated `connectStdio` method to accept a context parameter for better context management. - Implemented a persistent background context for stdio transport to ensure the child process remains active. - Added MCP `initialize()` handshake for stdio transports to populate `c.serverInfo`, enabling tool discovery. This update enhances the reliability of stdio connections and improves the initialization process for tool discovery.
- Added preflight checks in `StartManualOAuth` to determine if OAuth is required based on server configuration, improving user feedback. - Implemented a no-auth initialization attempt to confirm OAuth necessity before triggering the flow. - Enhanced error handling in `ForceOAuthFlow` to fast-fail when OAuth is not applicable, ensuring clearer diagnostics. This update improves the efficiency of the OAuth process and enhances user experience by providing informative error messages.
rannow
pushed a commit
to rannow/mcpproxy-go
that referenced
this pull request
Sep 23, 2025
* Implement OAuth error handling and string containment checks - Add `containsString` helper function to check if a string contains a substring. - Enhance OAuth error detection in `isOAuthError` method to identify specific OAuth-related errors. - Improve `isAuthError` method to exclude OAuth errors from non-OAuth authentication checks. - Introduce rate limiting for browser opening during OAuth authorization to prevent excessive attempts. This update improves the robustness of the OAuth authentication flow and enhances error handling during connection initialization. * Add OAuth authentication commands and client integration - Introduced `auth` command with subcommands for manual OAuth login and status checks. - Implemented `runAuthLogin` and `runAuthStatus` functions for handling authentication flows. - Enhanced CLI client with manual OAuth triggering and status retrieval methods. - Updated main command structure to include the new authentication commands. This update improves user experience by providing direct command-line access to OAuth authentication management. * Enhance OAuth integration and server management - Introduced TokenStoreManager for shared token persistence across client instances. - Updated server creation to track the actual config path used. - Enhanced OAuth client creation with detailed logging and context-based timeouts. - Implemented OAuth login functionality in the tray application, allowing users to authenticate directly from the menu. - Improved error handling and logging for OAuth processes, ensuring better observability and user guidance. This update streamlines the OAuth authentication flow and enhances user experience by providing direct access to OAuth login from the tray menu. * Refactor authentication command functions and improve constant usage - Updated `runAuthLogin` and `runAuthStatus` functions to use underscore parameters for clarity. - Introduced `oauthRequired` constant for better readability in OAuth status checks. - Enhanced connection handling by replacing string literals with defined constants for transport types. This update improves code clarity and maintainability by adhering to best practices in constant usage and function signatures. * Enhance server info validation in ListTools method - Updated the ListTools method to check for server info availability before verifying tool support. - Added debug logging for better observability when server info is not available. This change improves error handling and provides clearer diagnostics when the client is not connected to a server. * Refactor OAuth flow detection and logging improvements - Simplified manual OAuth flow detection by using a context key instead of inspecting the call stack. - Enhanced logging to include server name and time since the last browser opening for better diagnostics. This update improves the clarity and observability of the OAuth authorization process. * Add comprehensive debugging guide and persistent token store implementation - Introduced a detailed debugging guide in CLAUDE.md, covering log locations, essential commands, and common issues for OAuth and tool discovery. - Implemented PersistentTokenStore for OAuth token management, allowing tokens to be stored and retrieved from a BoltDB database. - Enhanced existing authentication command functions to ensure proper resource management with deferred closure of clients. - Updated various components to utilize the new persistent storage for OAuth tokens, improving reliability and cross-process notifications. This update enhances the debugging capabilities and token management for OAuth, providing better observability and persistence across client instances. * Enhance OAuth integration and logging for client management - Added persistent storage support for OAuth tokens across various client components. - Improved logging during HTTP client and transport configuration creation for better observability. - Updated client constructors to include storage parameters, ensuring consistent token management. - Implemented connection retry logic after OAuth completion, enhancing reliability in cross-process scenarios. This update strengthens the OAuth flow and improves debugging capabilities across client instances. * Refactor OAuth handling and improve resource management - Updated `runAuthStatus` to close the client connection per iteration, avoiding defers in loops for better resource management. - Renamed `OAuthCompletionEvent` to `CompletionEvent` for clarity and consistency across the codebase. - Enhanced the `TokenStoreManager` and related methods to ensure proper handling of OAuth completion events. - Improved logging and error handling in various components to enhance observability during OAuth processes. This update streamlines the OAuth flow and optimizes resource management, ensuring better performance and reliability. * Refactor stdio transport connection handling - Updated `connectStdio` method to accept a context parameter for better context management. - Implemented a persistent background context for stdio transport to ensure the child process remains active. - Added MCP `initialize()` handshake for stdio transports to populate `c.serverInfo`, enabling tool discovery. This update enhances the reliability of stdio connections and improves the initialization process for tool discovery. * Enhance OAuth flow handling and preflight checks - Added preflight checks in `StartManualOAuth` to determine if OAuth is required based on server configuration, improving user feedback. - Implemented a no-auth initialization attempt to confirm OAuth necessity before triggering the flow. - Enhanced error handling in `ForceOAuthFlow` to fast-fail when OAuth is not applicable, ensuring clearer diagnostics. This update improves the efficiency of the OAuth process and enhances user experience by providing informative error messages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
containsStringhelper function to check if a string contains a substring.isOAuthErrormethod to identify specific OAuth-related errors.isAuthErrormethod to exclude OAuth errors from non-OAuth authentication checks.This update improves the robustness of the OAuth authentication flow and enhances error handling during connection initialization.