feat: add token rotation core and proxy config updates#54
feat: add token rotation core and proxy config updates#54buihongduc132 wants to merge 7 commits intotbxark:masterfrom
Conversation
Tests added: - config_test.go: Config parsing, loading, V1->V2 migration (100% parseMCPClientConfigV2, 100% newConfProvider, 95.7% load) - client_test.go: Client creation, server creation, options handling (92.9% newMCPClient, 100% newMCPServer) - http_test.go: Middleware chain, auth, logger, recovery (100% all middleware functions, 54.5% startHTTPServer) - integration_test.go: MCP server/client integration tests (85.7% addToMCPServer, 89.2% addToolsToServer, 82.4% addPromptsToServer, 71.4% addResourcesToServer) Coverage improved from 0.0% to 76.5% of statements
- Add pre-commit hook to run tests before commit - Add test coverage badge (76.5%) to README - Add Go Report Card badge to README - Add Makefile targets: test, test-cover, test-cover-html - Update .gitignore for coverage artifacts
- Block commits if coverage drops by >=5% - Track baseline coverage in .coverage_baseline (76.5%) - Show detailed coverage breakdown (functions/lines) - Auto-update baseline when coverage improves - Display helpful guidance when commit is blocked
- Implement TokenRotator interface with RoundRobin and OnFirstFailed modes - Add thread-safe token rotation with mutex-protected state - Create TokenExhaustedError for structured error handling - Add comprehensive test coverage for all rotation modes and edge cases - Include spec, plan, research, and data model documentation Related: tbxark#1-token-rotation-proxy
- ops/nomad/mcp_proxy.nomad.hcl for Nomad/Consul mesh - Uses Docker driver with ghcr.io/tbxark/mcp-proxy:latest - Port 9090 on tailscale network - Template-based config with websearch, context7, grep_app MCP servers
Summary of ChangesHello @buihongduc132, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the MCP Proxy's capabilities by introducing robust authentication token rotation and flexible proxy configuration for its clients. The token rotation feature allows for better load distribution and automatic failover, improving the reliability of connections to MCP servers. The new proxy support enables compliance with network policies and access to servers behind firewalls. Additionally, the PR integrates a pre-commit hook to maintain code quality through test coverage checks and updates deployment configurations for Nomad. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Summary
Testing