fix(#267): forward all presigned POST fields to S3 in upload_body_image - #268
Open
sendashuichiro wants to merge 1 commit into
Open
sendashuichiro wants to merge 1 commit into
sendashuichiro wants to merge 1 commit into
Conversation
…ody_image The S3 presigned POST response includes an x-amz-security-token field (required when note.com issues temporary STS credentials), but the hardcoded field list only forwarded 8 fixed keys, silently dropping it. This caused every upload_body_image call to fail with 403 AccessDenied. Forward all fields returned by presigned_post instead of a fixed allowlist, so future field additions on note.com's side don't break uploads again. Verified against the real note.com API: image upload now succeeds and returns a valid asset URL. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zETzrAsuT6sm8YRdDdx9C
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.
概要
closes #267
upload_body_imageのS3プリサインドPOSTで、固定8キーの決め打ちによりx-amz-security-tokenフィールドが送信から漏れ、S3が常に403 AccessDeniedを返していた問題を修正します。変更内容
src/note_mcp/api/images.pyのupload_body_image内、S3へのmultipartフォームデータ構築部分で、固定キーのみを拾う実装から、presigned_postレスポンスのpostフィールドを全て動的に転送する実装に変更しました。必須フィールドの事前検証(
required_s3_fields)は変更していません。動作確認
実環境(note.com本番API・実アカウント)で
note_upload_body_imageを呼び出し、修正前は毎回403で失敗すること、修正後は画像アップロードが成功しS3アセットURLが返ることを確認しました。調査・検証について
原因調査、実装、実環境での動作確認はClaude Code(AI)が実施しました。人間によるコードレビューをお願いします。
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com