apache / apache/iceberg-python

S3 remote-signer Request header case duplicated

オープン 初心者向け
#2,422 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
1.1k
フォーク
581
平均マージ
1日 17時間
マージ済み PR(30日)
77

説明

### Apache Iceberg version

0.9.1 (latest release)

### Please describe the bug 🐞

request header **X-Amz-Content-SHA256** passed to the catalog service is **STREAMING-UNSIGNED-PAYLOAD-TRAILER**, and the header **X-Amz-Content-SHA256** returned by the catalog service is **UNSIGNED-PAYLOAD**

but the code logic will add both headers to the request (two X-Amz-Content-SHA256 header).

At this time, there is a possibility that the signature will not be passed (because the file storage service get **STREAMING-UNSIGNED-PAYLOAD-TRAILER** header, bug signed with **UNSIGNED-PAYLOAD**)

https://github.com/apache/iceberg-python/blob/52d810efb62e39ec6d8d6a2f4cd2cad8165e2d2c/pyiceberg/io/fsspec.py#L106-L121

line120-121 change to this can can solve the problem
```python
headers = HTTPHeaders()
for key, value in response_json["headers"].items():
headers.add_header(key, ", ".join(value))

request.headers = headers
```

### Willingness to contribute

- [x] I can contribute a fix for this bug independently
- [x] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- [ ] I cannot contribute a fix for this bug at this time

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

pyiceberg/io/fsspec.py の 106-121 行目から始め、remote-signer のレスポンスヘッダーがリクエストにコピーされる仕組みを追跡してください。変更によって返された値が維持され、重複した X-Amz-Content-SHA256 ヘッダーが作成されないことを確認し、その後、関連するテストで生成されたリクエストと署名動作を検証してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, python
領域
cloud
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
68/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。