Add Operator CRD Types for Auth Server Redis Storage#3793
Conversation
There was a problem hiding this comment.
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.84% 66.83% -0.02%
==========================================
Files 439 439
Lines 43509 43561 +52
==========================================
+ Hits 29083 29112 +29
- Misses 12175 12197 +22
- Partials 2251 2252 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
✅ Large PR justification has been provided. The size review has been dismissed and this PR can now proceed with normal review. |
Large PR justification has been provided. Thank you!
|
Not sure what's up with the CI though..it doesn't seem to be an issue in your PR |
|
@tgrunnagle we worked around the CI failures in #3815 would you mind rebasing atop origin/main? I'll ack the PR right away |
Address review feedback Address feedback - constants for storage types Run `task crdref-gen`
9a95bfc to
f2c27bf
Compare
Wires the Redis storage backend through the operator controller and auth server runner, enabling the embedded auth server to use Redis Sentinel for persistent, horizontally-scalable token storage in Kubernetes. This builds on the CRD types (#3793) and core Redis storage implementation (#3628) to complete the end-to-end integration.
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