Skip to content

feat(s3): S3プロバイダにSigV4署名を追加 - #93

Open
tishin-endou wants to merge 9 commits into
RCOSDP:developfrom
tishin-endou:feature/s3-sigv4
Open

feat(s3): S3プロバイダにSigV4署名を追加#93
tishin-endou wants to merge 9 commits into
RCOSDP:developfrom
tishin-endou:feature/s3-sigv4

Conversation

@tishin-endou

@tishin-endou tishin-endou commented Jun 5, 2026

Copy link
Copy Markdown

概要

S3プロバイダをレガシーSignature V2からSignature V4認証に移行し、SigV4が必要なAWSリージョンとの互換性を実現します。

変更内容

プロバイダ (waterbutler/providers/s3/provider.py)

  • S3クライアント初期化をSigV4署名設定に対応
  • アップロード、ダウンロード、削除、コピー、移動をSigV4互換にリファクタ
  • アップロード時の Content-MD5 整合性チェックを追加
  • MinIO互換ストレージからの VersionId='null' レスポンスを処理
  • バージョン管理なしストレージ向けに ListObjectsV2 フォールバックを _delete_folder に追加
  • リネーム・移動時の孤立フォルダプレフィックスオブジェクトをクリーンアップ
  • ListObjectVersions レスポンスのキーをURLデコード

メタデータ (waterbutler/providers/s3/metadata.py)

  • SigV4レスポンス形式に対応したメタデータ解析の更新

コア (waterbutler/core/metadata.py)

  • 共通メタデータユーティリティを追加

依存関係 (requirements.txt)

  • SigV4サポートに必要な依存関係を更新

テスト (tests/providers/s3/)

  • SigV4設定に対応したフィクスチャの更新
  • プロバイダテストを新実装に適合
  • VersionId='null' フィルタリングロジックにテストアサーションを整合

関連PR

Based on anqiuy/RDM-waterbutler@feature/s3-addon-migration

Co-Authored-By: An Qiuyu <qiuyu.an@hotmail.com>
@tishin-endou tishin-endou changed the title feat(s3): Add SigV4 signing support to S3 provider feat(s3): S3プロバイダにSigV4署名を追加 Jun 5, 2026
tishin-endou and others added 8 commits June 10, 2026 00:01
- test_region_host: mock get_s3_bucket_object_location to use pre-registered
  URL and avoid timestamp divergence between two aiobotocore sessions
- test_validate_v1_path_file: register root_listing_url (my-subfolder/) instead
  of bucket root
- test_validate_v1_path_file_with_subfolder: fix listing_url to my-subfolder/
  and add proper XML body
- test_validate_v1_path_folder: fix listing_url to my-subfolder/Photos/
- test_chunked_upload_upload_part: pass params= to register_uri/has_call so
  ImmutableFurl hash matches when make_request passes params separately
- test_metadata_folder: assert 'photos' (xmltodict strips leading whitespace)
- test_errors_out/test_creates: GET 200 empty XML + HEAD 404 to let exists()
  return False; DownloadError from GET 404 is not caught by exists()
- test_errors_out_metadata: expect DownloadError (not MetadataError) on GET 403
@tishin-endou
tishin-endou marked this pull request as ready for review July 17, 2026 00:53

@yacchin1205 yacchin1205 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

過去に意図的に導入した仕様や既知問題への対策が複数失われているように見えるため、変更をご検討ください。また、コメントアウトして残しているコードがいくつか散見されますが、不要なものであれば削除、採用すべきものであれば、そちらを採用すべきと考えます。どちらか、ご判断いただければと思います。

以下、見つけた回帰と思われる箇所です(これが全てではないかもしれません):

  • PR #77 で追加された、Version/DeleteMarkerの全削除および1000件超のVersion対応が失われているように見えます - # Check and delete all versions of the file in batches のコードを削除しており、移植されているように見えない
  • PR #53 で5GB超のCopyObject問題を理由に無効化したintra-copy/moveが、サイズ制限なしで再有効化されている - can_intra_copy 等のコードが仕様変更されている

また、テストの多くが既存の振る舞いを保証する形ではなく、新しい内部ヘルパーをモックして呼び出しだけを確認する形へ置き換えられているため、CIが成功していても上記の回帰を検出できません。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants