fix: 일반 경로에 남은 VM 자국 정리 - #42
Merged
Merged
Conversation
A restricted row nulled hostname but passed vm.getName(), and approval builds the VM with name == hostname, so the slug went out anyway. The row now carries the display name, falling back to the id when the VM has none; the name is never null because the console labels a row as displayName || name.
The rule this 403 described was deleted: any member may ask, so the throw now fires only for someone outside the workspace. It said the caller lacked a rung and named VMs on a path every resource type travels. New code WORKSPACE_MEMBERSHIP_REQUIRED.
The submitted/approved/rejected notices are fired from the generic request and approval paths but were written as VM prose, and approval passed the resource name under a key called hostname. The type already travels in the args; the word now comes from it. VM's rendered text is unchanged.
vmRecipients was typed on Vm and hardcoded ResourceType.VM, so a second type would have needed a copy of a rule that does not depend on the type. The VM helpers now pass their own type through.
Deletion counted VMs directly, so a workspace holding live resources of a later type would have deleted cleanly. Each type answers through its adapter, the way grant revocation already asks. The count also moved after the in-flight requests are locked: taken first it reads zero while an approval holds those locks uncommitted, and the workspace is then soft-deleted around the VM that approval creates.
A request submitted concurrently with a workspace delete commits after that delete's cancellation sweep has run, so it survives as SUBMITTED. Approving it is refused; rejecting it still works.
Nothing under src/test touched /api/v1/resources, so its permission row was decorative. Covers a member's own workspace rows, an empty page for a workspace filter outside the caller's memberships, the restricted row (asserted against the whole body: the slug appears nowhere) and the 401.
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.
📝 작업내용
⭐️ 검증
💬 리뷰 포인트