feat: implement user-based daily publish rate limiting (#21)#491
Open
nagarwal-godaddy wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
Conversation
e2cf510 to
547242e
Compare
…rotocol#21) - Rate limit by authenticated user (authMethodSubject) instead of namespace - Admin bypass via hasGlobalPermissions parameter from auth handler - Atomic database operations with separate publish_attempts table - Integrated rate limiting directly into registry service - Support for rate limit exemptions with wildcard patterns - Comprehensive test coverage including concurrent request handling Configuration: - MCP_REGISTRY_RATE_LIMIT_ENABLED: Enable/disable rate limiting (default: true) - MCP_REGISTRY_RATE_LIMIT_PER_DAY: Daily publish limit per user (default: 10) - MCP_REGISTRY_RATE_LIMIT_EXEMPTIONS: Comma-separated exempt users/patterns Database changes: - New table: publish_attempts tracking auth_method_subject instead of namespace - Atomic check-and-increment operation prevents race conditions Testing: - All existing tests updated for new method signatures - New tests for concurrent requests, exemptions, and user-specific limits
547242e to
aa84790
Compare
Author
|
@domdomegg @tadasant I put together these changes based on #21 and an earlier PR #378 for reference. I’d love to start contributing to the project, and this seemed like a good place to begin since it hadn’t had much recent discussion. Happy to adjust and work through updates once you’ve had a chance to review, looking forward to your feedback! |
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.
Motivation and Context
Issue #21
How Has This Been Tested?
Breaking Changes
N/A
Types of changes
Checklist
Additional context
authMethodSubjectbased off of wip: daily publish limits #378Configuration:
Database changes: