fix(RHCLOUD-48919): Fix Kessel workspace 400 error during permission loading - #5
Closed
aferd wants to merge 1 commit into
Closed
fix(RHCLOUD-48919): Fix Kessel workspace 400 error during permission loading#5aferd wants to merge 1 commit into
aferd wants to merge 1 commit into
Conversation
…loading Fixes a 400 validation error when checking Kessel v2 permissions before the workspace ID has loaded. Previously, an empty string '' was passed as the workspace resource ID, which violates the Kessel API validation (resource_id must be at least 1 character). Now uses a placeholder UUID '00000000-0000-0000-0000-000000000000' when the workspace hasn't loaded yet. The useSelfAccessCheck hooks automatically re-run when the real workspace ID loads (via useMemo dependency on defaultWorkspaceId), ensuring permissions are correctly checked once the workspace is available. This prevents console errors and ensures permissions load reliably in v2 RBAC orgs. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Problem
As an org admin in a v2 RBAC org, the Kessel permission checks were throwing 400 validation errors:
This occurred because the
KesselRbacAccessProviderwas passing an empty string (id: '') as the workspace resource ID before the workspace had loaded, which violated the Kessel API's validation requirement.Solution
Changed the placeholder workspace resource ID from empty string to a valid UUID:
'00000000-0000-0000-0000-000000000000'.When the real workspace ID loads:
workspaceuseMemo updates (depends ondefaultWorkspaceId)useSelfAccessCheckhooks detect theresource.idchangeTesting
Local testing:
canReadEvents: true)Stage testing needed:
Technical Details
The
useSelfAccessCheckhook from@project-kessel/react-kessel-access-check@0.5.0watchesresource.idas a dependency, so it automatically re-runs when the workspace ID changes from placeholder to real value.Fixes RHCLOUD-48919