Expose CIMD config in MCPExternalAuthConfig CRD#5384
Draft
amirejaz wants to merge 3 commits into
Draft
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## cimd-phase2-pr3-wiring #5384 +/- ##
==========================================================
- Coverage 68.78% 68.78% -0.01%
==========================================================
Files 627 627
Lines 63644 63643 -1
==========================================================
- Hits 43780 43778 -2
- Misses 16609 16614 +5
+ Partials 3255 3251 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e27ecdf to
dff1dd5
Compare
dff1dd5 to
bf8f137
Compare
bf8f137 to
04ee659
Compare
C3 - Thread ScopesSupported into NewCIMDStorageDecorator so CIMD scope
handling is consistent with DCR. Uses registration.ValidateScopes
(same function as the DCR handler) to validate declared scopes
against the AS allowlist and compute the effective scope list.
When ScopesSupported is unset, the document's declared scopes are
used directly; omitted scopes default to DefaultScopes.
C4 - Reject CIMD documents that declare grant_types or response_types
the embedded AS does not support for public clients
(authorization_code + refresh_token; code). Consistent with DCR
which returns invalid_client_metadata for the same cases.
buildFositeClient now receives pre-computed scopes from fetch() rather
than re-parsing doc.Scope, matching the DCR handler pattern where scope
computation and validation happen before client construction.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Adds EmbeddedAuthServerCIMDConfig to the CRD so operators can enable CIMD through the normal VirtualMCPServer manifest workflow instead of writing runconfig.json directly. Resolves the TODO(cimd) comment in pkg/authserver/config.go. The new cimd field on EmbeddedAuthServerConfig maps to authserver.CIMDRunConfig in the generated RunConfig. CacheFallbackTTL is stored as a Go duration string in the CRD (e.g. "5m") and parsed to time.Duration by the converter. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
CIMDRunConfig.CacheFallbackTTL changed from time.Duration to string in PR3. The operator converter now passes the string through unchanged; parsing to time.Duration happens in resolveCIMDConfig in the runner, after CIMDRunConfig.Validate() has already confirmed the format. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
04ee659 to
4f3e1cb
Compare
8e68d45 to
36b5e97
Compare
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.
Summary
TODO(cimd)left in PR Wire CIMD config through embedded AS and enable storage decorator #5348: CIMD config is now exposed in theMCPExternalAuthConfigCRD so Kubernetes operators can enable it through a normalVirtualMCPServermanifest instead of writingrunconfig.jsondirectly.EmbeddedAuthServerCIMDConfigstruct to the CRD API withenabled,cacheMaxSize, andcacheFallbackTtlfields, following the same patterns as existing fields (TokenLifespanConfigfor durations, kubebuilder markers for validation).BuildAuthServerRunConfigincontrollerutil/authserver.go, parsingcacheFallbackTtlfrom a Go duration string totime.Duration.zz_generated.deepcopy.goand CRD YAML manifests.Usage example after this PR:
Type of change
Test plan
go test ./cmd/thv-operator/pkg/controllerutil/...— newTestBuildAuthServerRunConfig_CIMDcovers nil, disabled, enabled with values, enabled with zero fields, invalid TTLgo build ./...passestask lint-fixcleancimdblock appears in bothmcpexternalauthconfigsandvirtualmcpserversCRDsGenerated with Claude Code