Remove backwards-compatible authentication config#537
Remove backwards-compatible authentication config#537ambient-code[bot] wants to merge 2 commits intomainfrom
Conversation
….7.0) Remove the legacy `authentication` configmap key and `authenticationConfig` Helm value that were kept for backwards compatibility with a TODO to remove in 0.7.0. The project is now past v0.8.1, so this cleanup is overdue. Also removes the now-unused `oidc.LoadAuthenticationConfiguration` function and updates documentation to reference the current config approach. Closes #530 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for jumpstarter-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
CI Status UpdateThe pytest failure in This PR only modifies:
The failing test is a macOS-specific Python test that validates bash substring syntax in hook execution. This is not touched by any of the authentication config removal changes. The test expects the output Is this a known flaky test on macOS, or should we investigate further? |
|
|
||
| 3. Configure Jumpstarter to trust Dex. Use this configuration for | ||
| `jumpstarter-controller.authenticationConfiguration` during installation: | ||
| 3. Configure Jumpstarter to trust Dex. Set `spec.authentication.jwt` on your |
There was a problem hiding this comment.
[CRITICAL] While this documentation update is correct, the removal of the legacy authentication config path is incomplete. The extractOIDCConfigs() function in controller/cmd/main.go (around lines 353-359) still has a fallback block that reads configmap.Data["authentication"]. This was missed during cleanup. A stale or maliciously crafted authentication key in the ConfigMap could still influence the login endpoint's OIDC issuer discovery, creating an inconsistency with the authenticator path.
Suggestion: Remove the legacy fallback block in extractOIDCConfigs() in controller/cmd/main.go as well. After removal, that function should return nil if the config key is not found or cannot be parsed.
[MEDIUM] There are no tests covering extractOIDCConfigs() in controller/cmd/main.go to verify it only reads from the config key. The missed legacy fallback mentioned above is exactly the kind of thing a regression test would have caught.
Suggestion: Add a test for extractOIDCConfigs() that provides a ConfigMap with only the config key and verifies correct behavior. A negative test confirming that a ConfigMap with only the legacy authentication key does NOT produce OIDC configs would also be valuable.
AI-generated, human reviewed
There was a problem hiding this comment.
Good catch on the [CRITICAL] finding -- the legacy authentication fallback in extractOIDCConfigs() was indeed missed. Fixed in 7adea6f: the function now only reads from the config key and returns nil if it is not found or cannot be parsed. I also improved the error handling so parse failures are logged rather than silently swallowed.
Regarding the [MEDIUM] test suggestion: I agree this would be valuable coverage. However, extractOIDCConfigs lives in package main and takes a client.Reader (Kubernetes API reader), so testing it properly requires either extracting it to a separate package or setting up a fake client. I think that refactoring is worthwhile but would be better addressed in a follow-up to keep this PR focused on the cleanup. I'll open a tracking issue for it.
The extractOIDCConfigs() function in controller/cmd/main.go still had a fallback block reading configmap.Data["authentication"], which was missed during the initial cleanup. This removes that legacy path so the function only reads from the "config" key, consistent with the rest of this PR. Also improves error handling by logging parse errors instead of silently swallowing them. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
authenticationconfigmap key andauthenticationConfigHelm value that were kept for backwards compatibility, with TODO comments saying "remove in 0.7.0"oidc.LoadAuthenticationConfigurationfunction and its helpernewJWTAuthenticator(theconfigpackage has its own equivalent implementations that remain in use)authenticationfallback fromextractOIDCConfigs()incontroller/cmd/main.goso it only reads from theconfigkeyspec.authentication.jwton the Jumpstarter resource instead of the removedjumpstarter-controller.authenticationConfigurationHelm valueTest plan
go build ./...passes in the controller module with no errorsauthenticationConfigvalueconfigkey continue to workCloses #530
Generated with Claude Code