fix: cross-namespace RBAC for local-auth secrets; preserve session key on upgrade (v0.3.3) - #5
Merged
Conversation
…n key on upgrade (v0.3.3) [fix/local-auth-rbac-and-deploy-types]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes HTTP 500
failed to update passwordwhen changing a local-auth user password via the UI.Root cause
The
kube-workspaces-local-auth-secretsRole+RoleBinding in the Helm chart was scoped to.Release.Namespace. Password Secrets always live inkube-workspaces-system, so when the chart is installed into a different namespace (e.g. a shared cluster namespace), the API ServiceAccount has no write access to them.The Kustomize base was already correct — it installs into
kube-workspaces-systemso the SA and the Secrets share the same namespace.Changes
Helm
rbac.yaml— whenauth.localAuth.enabled: trueand the release namespace differs fromkube-workspaces-system, render a second Role+RoleBinding inkube-workspaces-system. Guarded so it is a no-op for the default (--create-namespace kube-workspaces-system) install path.Helm
auth-secrets.yaml— uselookupto preserve the existing session signing key onhelm upgrade. PreviouslyrandAlphaNum 32re-generated a new key on every upgrade, invalidating all active sessions.Helm
tests/rbac_test.yaml— updated to cover the new cross-namespace Role and the document count with localAuth on/off.Kustomize
auth-local/session-secret.yaml— improved generation instructions (no functional change; kustomize base was already correct).docs/authentication.md— new troubleshooting section for the 500 error with recovery steps and akubectl auth can-iverification command.Deploy types affected
kube-workspaces-system