Skip to content

Commit 16a6c02

Browse files
amirejazclaude
andcommitted
Fix TTL zero-value guard and document CIMD+baseline scope interaction
- Change cache_fallback_ttl validation from < 0 to <= 0 in CIMDRunConfig.Validate(). A zero TTL would expire every cache entry immediately, causing an outbound CIMD fetch on every authorize request. - Add note to baselineClientScopes CRD field comment that when cimd.enabled is true, baseline scopes are also unioned into CIMD-resolved clients, including third-party ones. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 9dfadb0 commit 16a6c02

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

cmd/thv-operator/api/v1beta1/mcpexternalauthconfig_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ type EmbeddedAuthServerConfig struct {
293293
// "openid" and "offline_access"). Adding a privileged scope here — e.g.
294294
// "admin:read" — would grant it to every DCR-registered client, including
295295
// public clients like Claude Code, Cursor, and VS Code.
296+
// When cimd.enabled is true, these baseline scopes are also unioned into
297+
// the scope set of every CIMD-resolved client, including third-party clients
298+
// dynamically resolved from arbitrary HTTPS URLs.
296299
// +kubebuilder:validation:MaxItems=10
297300
// +kubebuilder:validation:items:MinLength=1
298301
// +kubebuilder:validation:items:Pattern=`^[\x21\x23-\x5B\x5D-\x7E]+$`

pkg/authserver/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ func (c *CIMDRunConfig) Validate() error {
157157
if err != nil {
158158
return fmt.Errorf("cache_fallback_ttl: %w", err)
159159
}
160-
if d < 0 {
161-
return fmt.Errorf("cache_fallback_ttl must be non-negative when CIMD is enabled, got %s", c.CacheFallbackTTL)
160+
if d <= 0 {
161+
return fmt.Errorf("cache_fallback_ttl must be positive when CIMD is enabled, got %s", c.CacheFallbackTTL)
162162
}
163163
}
164164
return nil

0 commit comments

Comments
 (0)