[Feature] Support virtual host S3 API calls
還沒有人認領這個 Issue。
評估
研究方向
先閱讀 localstack_client.config.get_endpoint 和 get_service_endpoints,接著使用 boto3 偵錯記錄和 Docker Compose 重現 S3 請求。檢視 README.md 中的 endpoint 指引,並判斷專案應採用所提出的三種方法中的哪一種;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 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 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
-
from:qa priority:P2 reliability tech-debt
難度 2/5 1-3 小時 新手友好度 78/100
spec-kitty/spec-kitty#4874 ·
-
fix: inaccuracy ⚠️
難度 2/5 1-3 小時 新手友好度 72/100
uabrc/uabrc.github.io#1255 · 1 則留言 ·
-
kind:bug needs-triage
難度 2/5 1-3 小時 新手友好度 88/100
-
docs
難度 1/5 1 小時以內 新手友好度 85/100
-
難度 2/5 1-3 小時 新手友好度 84/100
ethereum-optimism/factory#64 ·