fix(#123): コメントの note_id 検証を追加し REST 階層整合性を修正する#136
Merged
Conversation
- GetCommentInput 型付き DTO を追加し GetCommentUseCase を更新 - CreateCommentUseCase が NoteRepository でノート存在を確認し、なければ 404 - get/update/delete ハンドラーで comment.note_id != path note_id の場合 404 - 存在しないノートへのコメント作成・異なるノート URL からのアクセスを防止 Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
GetCommentUseCase.executeがcomment_id: intを直接受け取っていたのをGetCommentInput型 DTO に変更CreateCommentUseCaseにNoteRepositoryInterfaceを追加し、存在しないノートへのコメント作成を 404 にget_comment/update_comment/delete_commentハンドラーでcomment.note_id != note_idの場合 404mcp.pyもGetCommentInputを使用するよう更新Test plan
test_create_raises_when_note_not_found— 存在しないノートへのコメント作成が NoteNotFoundException(新規)test_create_comment_for_nonexistent_note_returns_404— HTTP レベルで 404(新規)test_get_comment_from_wrong_note_returns_404— 異なるノード URL からのアクセスが 404(新規)Closes #123
🤖 Generated with Claude Code