Repository navigation
fix(cli): bar a stale BEX_WORKSPACE name from direct-ID fallback searches - #240
Merged
Merged
Conversation
…ches A direct-ID command with an unresolvable BEX_WORKSPACE proceeds past startup resolution, but a missed typed id falls back to a workspace-scoped name search (ListServices/ListPostgres/ListKeyValue with ownerId), sending the raw name as ownerId on the 404 path. The control-plane transport now refuses requests carrying the barred name and fails fast in the words of the startup refusal; found paths send no workspace value and are unaffected. Pinned by TestStaleWorkspaceNameNeverLeaksOnDirectIDMiss and TestBlockedOwnerRefusesTheBarredName.
…fusal reason, and omit barred X-Bex-Workspace
Member
|
Pushed a small follow-up refinement before merging:
Verified with |
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
Direct-ID CLI commands (
pg get,kv get,services delete/update, …) proceed past startup whenBEX_WORKSPACEno longer resolves, but a missed typed id falls back to a workspace-scoped name search that sends the raw name asownerId— the exact leak w32/117 just closed on the found path. The control-plane transport now bars the unresolvable name fromownerId/owner path segments and fails fast in the words of the startup refusal. Found paths send no workspace value and are unaffected.Changes
lego/cli/internal/bridge/workspace.go:ResolveWorkspaceNamerecords the unresolvable name (blockedOwner) when a direct-ID command proceeds past a failed lookup; clarified theWorkspaceIfResolvabledoc.lego/cli/internal/bridge/transport.go:controlPlaneTransportrefuses (local 400) any control-plane request carrying the barred name, viacarriesBlockedOwner+blockedOwnerRefusal.TestStaleWorkspaceNameNeverLeaksOnDirectIDMiss(end-to-end: 4 refusal cells + 5 clean-miss cells, zero-leak oracle) andTestBlockedOwnerRefusesTheBarredName/TestBlockedOwnerRefusalNamesTheWorkspace(bridge unit tests)..claude/skills/rt-fix-logic-bugs/ledger.md: recorded the fix and the audited-holds cells (cap: dropped the two oldest Skipped).Testing
ownerId=stale-wsobserved onpostgres,key-value,servicesfallbacks), GREEN after.TestStaleWorkspaceNameBlocksOnlyConsumers(existing found-path matrix) still passes; fullinternal/bridgesuite passes.bash scripts/rt-pre-pr-check.sh origin/main: OK.🤖 Opened by a bex agent session (muse) · view session