-
Notifications
You must be signed in to change notification settings - Fork 178
Add Operator CRD Types for Auth Server Redis Storage #3793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Large PR Detected
This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.
How to unblock this PR:
Add a section to your PR description with the following format:
## Large PR Justification
[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformationAlternative:
Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.
See our Contributing Guidelines for more details.
This review will be automatically dismissed once you add the justification section.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3793 +/- ##
==========================================
- Coverage 66.78% 66.76% -0.02%
==========================================
Files 437 437
Lines 43002 43057 +55
==========================================
+ Hits 28718 28748 +30
- Misses 12078 12105 +27
+ Partials 2206 2204 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| // validateStorageConfig validates the auth server storage configuration | ||
| func validateStorageConfig(cfg *AuthServerStorageConfig) error { | ||
| switch cfg.Type { | ||
| case "memory", "": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: constants would be nicer
| UpstreamProviders []UpstreamProviderConfig `json:"upstreamProviders"` | ||
|
|
||
| // Storage configures the storage backend for the embedded auth server. | ||
| // If not specified, defaults to in-memory storage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a note, we should probably mention this in the docs, along with howto (just the thv part of it) on setting up the redis storage
Closes #3792
Summary
Adds Kubernetes CRD types for configuring Redis storage in the embedded authorization server. This defines the declarative schema that operators will use to configure Redis-backed storage for horizontal scaling, building on the core Redis storage backend (#3628) and integration tests (#3629). The controller and runner integration that consumes these types is tracked separately in #3630.
Changes Made
CRD Types (
mcpexternalauthconfig_types.go)AuthServerStorageConfigwithtypefield supportingmemory(default) andredisbackendsRedisStorageConfigwith Sentinel configuration, ACL user authentication, and configurable timeouts (dial, read, write)RedisSentinelConfigwithmasterName,sentinelAddrs(explicit addresses), andsentinelService(Kubernetes Service discovery) — mutually exclusiveSentinelServiceReffor referencing a Kubernetes Service for Sentinel discovery (name, namespace, port)RedisACLUserConfigwithSecretKeyRefreferences for username and passwordStoragefield toEmbeddedAuthServerConfigValidation Webhooks (
mcpexternalauthconfig_webhook.go)validateStorageConfigenforcing type-specific configuration presencevalidateRedisStorageConfigrequiringsentinelConfigandaclUserConfig, plus Go duration format validation for timeout fieldsvalidateRedisSentinelConfigenforcing exactly one ofsentinelAddrsorsentinelServicevalidateRedisACLUserConfigrequiring both secret referencesvalidateEmbeddedAuthServerflowGenerated Files
zz_generated.deepcopy.gowith DeepCopy methods for all new typesdeploy/charts/operator-crds/(bothfiles/andtemplates/)Implementation Details
deploymentModeandauthTypeenum fields — since onlysentinelandaclUserare supported, these are implicit in the type structure rather than configurable enumsSecretKeyReffor secret references, kubebuilder validation annotations for enums and defaults, optional fields with sensible defaultsTesting
TestMCPExternalAuthConfig_ValidateStorageConfigwith 17 test cases covering:sentinelAddrsvssentinelService(both set, neither set)Additional Notes
Large PR Justification