Skip to content

feat(s3): S3アドオンにSigV4署名を追加#746

Draft
tishin-endou wants to merge 15 commits into
RCOSDP:developfrom
tishin-endou:feature/s3-sigv4-clean
Draft

feat(s3): S3アドオンにSigV4署名を追加#746
tishin-endou wants to merge 15 commits into
RCOSDP:developfrom
tishin-endou:feature/s3-sigv4-clean

Conversation

@tishin-endou

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

Copy link
Copy Markdown

概要

既存のS3アドオンをレガシーSignature V2からSignature V4認証に移行し、SigV4が必要なAWSリージョン(例: ap-northeast-1)との互換性を実現します。

変更内容

モデル (addons/s3/models.py)

  • SigV4認証モードをサポートする s3_auth_type フィールドを追加
  • WaterButlerへの認証タイプの受け渡しを更新

ビュー (addons/s3/views.py)

  • S3クライアント初期化をSigV4署名設定に対応
  • バケット一覧・ロケーションAPIをSigV4互換に修正

ユーティリティ (addons/s3/utils.py)

  • get_bucket_names() をSigV4署名リクエストに対応
  • S3クライアント生成時の署名バージョン設定を追加

フロントエンド (addons/s3/static/)

  • s3NodeConfig.jss3UserConfig.js をSigV4認証フローに対応
  • 認証モーダルテンプレートに認証タイプ選択を追加
  • Rubeus設定をSigV4プロバイダ設定に対応
  • ログアクション名を更新

テスト (addons/s3/tests/)

  • SigV4フィールドに対応したテストフィクスチャ・ファクトリの更新
  • test_model.pytest_view.pytest_serializer.py を新認証フローに適合

その他

  • S3アドオン設定を説明する README.md を追加
  • requirements.txt に必要な依存関係を追加
  • 未使用の addons/s3/requirements.txt を削除

関連PR

Based on anqiuy/RDM-osf.io@feature/s3-sigv4

Co-Authored-By: An Qiuyu <qiuyu.an@hotmail.com>
@tishin-endou tishin-endou changed the title feat(s3): Add SigV4 signing support to S3 addon feat(s3): S3アドオンにSigV4署名を追加 Jun 5, 2026
- import InstitutionFactory
- test_s3_settings_input_empty_secret_key: assert_equals/assert_in -> pytest assert + rv.text
- test_s3_settings_rdm_addons_denied: post_json -> post(url, json=...) + pytest assert + rv.text
…7/G8 tests

- Replace all self.app.post(url, json={...}) with post_json(url, {...})
  and self.app.put(url, json={...}) with put_json(url, {...}) so tests
  work with the webtest_plus version in CI (older version lacks json= kwarg)
- Add expect_errors=True for all calls that expect 4xx responses
- Add expect_errors=True to delete/get calls that expect 401/403
- Add G1 (missing key field → 400), G2 (get_user_info=None → 400),
  G4 (bad bucket name → 400), G5 (provider_id format + dedup),
  G7 (bucket_exists empty), G8 (can_list None) coverage
mock.patch(...).return_value sets attribute on the patcher object, not the
started Mock. Use mock.patch(..., return_value=mock.Mock(id=..., ...)) so
user_info.id / user_info.display_name are accessible in the view.

Fixes test_provider_id_format and test_provider_id_dedup.
Wrappers were accidentally dropped when the feature branch was created.
Restored ${ _("...") } for all 20 translatable strings across:
- s3_credentials_modal.mako (5 strings)
- s3_node_settings.mako (10 strings)
- s3_user_settings.mako (5 strings)

Feature-branch additions preserved: aria-label/alt on img tags,
OAuth comment fix, text-muted class removal from th.
…lity

boto (v2) was removed as part of SigV4 migration.
boto3/botocore are in the root requirements.txt.
The Jenkins Dockerfile still has COPY ./addons/s3/requirements.txt,
so an empty file is needed to prevent Docker build failure.
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.

1 participant