[Feature] Support virtual host S3 API calls
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
調査の方向性
まず localstack_client.config.get_endpoint と get_service_endpoints を読み、次に boto3 のデバッグログと Docker Compose を使って S3 リクエストを再現します。README.md のエンドポイントに関するガイダンスを確認し、プロジェクトが提案された 3 つのアプローチのどれを採用すべきか判断します。done には、決定済みで動作する virtual-host addressing の方法と、それに対応するドキュメントを含める必要があります。
索引モデルが issue の本文から書いたものです。
説明
After struggling for several hours with Docker Compose, I noticed my problem was actually in this library, which does not seem to support the virtual host addressing for the s3 client.
Looking at boto3 in debug mode, I noticed that when using Virtual host addressing, the HTTP request was aimed towards http://<bucket>.<endpoint_url>:<endpoint_port>. This is not a valid endpoint, and it should be http://<bucket>.s3.<endpoint_url>:<endpoint_port>, as described here.
After delving deeper I noticed localstack_client.config.get_endpoint it is not handling s3 in any special way. I manually patched the function and noticed that with a simple
def new_get_service_endpoint(
service: str, localstack_host: Optional[str] = None
) -> Optional[str]:
endpoints = localstack_client.config.get_service_endpoints(localstack_host=localstack_host)
endpoint = endpoints.get(service)
if service == "s3":
endpoint = "http://s3." + endpoint.split("http://")[1]
return endpoint
I know this doesn't handle SSL, it's just a draft. It works for both virtual and path based addressing.
I see three ways simple about this:
- Do not support virtual host addressing. This is a problem, as in theory AWS is deprecating path based addressing (also it has been deprecating it for 4 years, so...)
- Do a hack like the one proposed.
- Honor AWS service specific endpoints through envars (for instance
AWS_ENDPOINT_URL_S3) and leave it up to the user to set it up (with appropriate documentation, at least in theREADME.md).
What are your thoughts on this?
- 主要言語
- Python
- スター
- 191
- フォーク
- 31
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
localstack/localstack-python-client のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
localstack/localstack-python-client#43 · コメント 4 件 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
localstack/localstack-python-client#38 · コメント 1 件 ·
localstack/localstack-python-client の issue をすべて見る
似ている issue
-
🐛 Bug 🔔 Pending processing
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
jumpserver/jumpserver#17584 ·
-
link-check link-check:sphinx-theme
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
modelscope/DiffSynth-Studio#1702 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
OpenHands/extensions#626 · コメント 1 件 ·