Repository navigation
Proposal: bound persistent CIMD client creation (#50532) #52796
Replies: 1 comment
|
I agree that a process-local or IP-based rate limiter would not solve the persistent-growth problem in a clustered deployment. My preference for the first implementation would be: Scope the quota to the matched trusted-domain rule, rather than to the full client_id URL. The URL should be normalized before determining the quota scope so that path or query variations cannot bypass the limit. For wildcard rules, I would use one aggregate quota for the rule. Keycloak already has a Max Clients Policy for client registration, but it appears to be realm-wide and does not provide a CIMD-specific ownership boundary, so I do not think it is sufficient by itself: Client Registration documentation. The proposed tests look good. I would additionally cover: Different paths and query strings under the same trusted host sharing one quota. |
Uh oh!
There was an error while loading. Please reload this page.
Context: #50532 is a triaged prerequisite for MCP Authorization support. On current main, a previously unseen URL-shaped client_id passes through the CIMD executor into AbstractPersistentClientIdMetadataDocumentProvider.createClientMetadata(), which persists a ClientModel. The only CIMD-specific state is the cache-expiry attribute; there is no quota, provenance marker, or garbage-collection path.
I would like to contribute a fix, but want to align on the intended protection before coding. A process-local/IP-based rate limiter would be ineffective across nodes and reverse proxies, so I do not think it is an appropriate solution.
Questions for maintainers:
Once the intended semantics are confirmed, I propose a focused PR with configuration and documentation, an explicit CIMD-only marker, and functional tests covering distinct paths under one trusted host, the capacity boundary, and preservation of ordinary clients. I will keep the patch limited to the CIMD provider/configuration boundary and use the existing integration-test style.
All reactions