Remove backwards-compatible authentication config#537
Remove backwards-compatible authentication config#537ambient-code[bot] wants to merge 8 commits into
Conversation
|
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? |
7adea6f to
d26f745
Compare
raballew
left a comment
There was a problem hiding this comment.
Thanks for addressing the legacy fallback removal. The code changes look correct and complete: the authentication key fallback is fully removed from both extractOIDCConfigs() and LoadConfiguration(), the unused oidc/config.go is cleanly deleted, and the Helm chart and docs are updated consistently.
One previous concern remains open: there are still no tests for extractOIDCConfigs(). See inline comment for details.
Update: Added tests for
|
Fix planAddressing @raballew's latest review:
CI: The e2e-tests failures ( |
a55365a to
2c64294
Compare
Rebase onto mainRebased the branch onto current Conflict resolution: The conflict arose because
Verification:
|
CI Status UpdateAll CI checks are passing except for the This is an infrastructure issue when downloading the typos tool from GitHub releases, not related to the PR changes. The check should pass on the next retry or re-run. All other CI checks are green:
No code changes are needed for this PR. |
Ready for Re-ReviewAll requested changes from the last review have been addressed:
@raballew Ready for re-review when you have a moment. |
2c64294 to
c61a1bd
Compare
Rebase onto mainRebased the branch onto current Conflict resolution: Three Helm chart files ( Verification:
|
Status SummaryAll requested changes from the April 15 review have been addressed: Completed
Current State
@raballew Ready for re-review when you have a moment. |
|
@ambient-code rebase onto main |
c61a1bd to
958945a
Compare
Rebase onto mainRebased the branch onto current All 4 PR commits are now on top of the latest main:
|
Addressing review feedback (May 28)Pushed 668d735 with the following changes: Done in this commit
Acknowledged as follow-ups
All 8 test cases pass locally ( |
Addressing review feedback (May 28, round 2)Pushed c336f48 with the following changes: [LOW] Tautological ClientID assertion (comment by @raballew)Removed the [LOW] Duplicate ConfigMap fetch (comment by @raballew)Refactored to eliminate the second API server round-trip:
CI
All 8 test cases pass locally and |
|
The branch appears to be up-to-date with main. The only failing CI check is All other CI checks are passing. The PR is ready for review from a technical standpoint. |
|
I'll address the following requested changes:
Working on these fixes now. |
….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>
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>
Table-driven tests verify that extractOIDCConfigs() only reads from the "config" key in the ConfigMap, and that the legacy "authentication" key is no longer used. Covers valid parsing, localhost skipping, missing keys, invalid YAML, and missing ConfigMap scenarios. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The table-driven case "legacy authentication key only should NOT produce OIDC configs" duplicated the dedicated TestExtractOIDCConfigsIgnoresLegacyKey function. Keep the dedicated function for clearer regression intent. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mment - Add table-driven test for ConfigMap with both 'config' and legacy 'authentication' keys present, asserting results come from 'config' only - Remove redundant 5-line comment block on TestExtractOIDCConfigsIgnoresLegacyKey per project convention that code should be self-explanatory Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Eliminate the duplicate ConfigMap fetch by having LoadConfiguration return the parsed Config, then calling jwtAuthenticatorsToOIDCConfigs directly with the already-loaded JWT authenticators. Also removes the tautological ClientID assertion from tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add unit tests for LoadConfiguration to verify it returns an error when only the legacy 'authentication' key is present - Add test verifying that when both 'config' and 'authentication' keys are present, only the 'config' key is used - Add tests for missing config/router keys and invalid YAML - Generate self-signed test certificate for OIDC authentication testing - All tests pass, ensuring the removal of legacy authentication config is properly validated Addresses code review feedback from raballew. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c336f48 to
46729b0
Compare
|
Addressed all review feedback: ✅ Added comprehensive tests for
✅ Rebased onto main - Branch is now up-to-date with the latest main branch Note: The duplicate ConfigMap fetching issue mentioned in earlier review comments has already been addressed in the current code. All tests pass:
|
Reorder k8s.io imports alphabetically by full path to satisfy gofmt: k8s.io/apimachinery before k8s.io/apiserver. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Fixed the |
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)extractOIDCConfigs()entirely by havingLoadConfigurationreturn the parsed*Config, then callingjwtAuthenticatorsToOIDCConfigsdirectly with the already-loaded JWT authenticators (eliminates a duplicate ConfigMap fetch)spec.authentication.jwton the Jumpstarter resource instead of the removedjumpstarter-controller.authenticationConfigurationHelm valuejwtAuthenticatorsToOIDCConfigs()covering localhost filtering, nil/empty inputs, multiple authenticators, and content verificationLoadConfiguration()verifying error handling for legacy authentication key, both keys present scenario, missing keys, and invalid YAMLKnown follow-up
AuthenticationConfigurationtype incontroller/api/v1alpha1/authenticationconfiguration_types.gois now unreferenced after the removal ofoidc.LoadAuthenticationConfiguration. Removing it requires regeneratingzz_generated.deepcopy.goand updating scheme registration, so it will be handled in a separate PR to keep this one focused.Test plan
go build ./...passes in the controller module with no errorsgo test ./cmd/ -run TestJwtpasses with all test cases (8 total)go test ./internal/config -run TestLoadConfigurationpasses with 6 test cases covering:authenticationConfigvalueconfigkey continue to workCloses #530
Generated with Claude Code