[Feature] Support virtual host S3 API calls
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
Línea de trabajo
Empieza leyendo localstack_client.config.get_endpoint y get_service_endpoints; después, reproduce la solicitud S3 con el registro de depuración de boto3 y Docker Compose. Revisa las indicaciones sobre endpoints en README.md y determina cuál de los tres enfoques propuestos debería adoptar el proyecto; done debe incluir un camino decidido y funcional para virtual-host addressing, junto con la documentación correspondiente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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?
- Lenguaje dominante
- Python
- Estrellas
- 191
- Forks
- 31
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de localstack/localstack-python-client
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
-
[Request] asyncio support Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
localstack/localstack-python-client#43 · 4 comentarios ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
localstack/localstack-python-client#38 · 1 comentario ·
Todos los issues de localstack/localstack-python-client
Issues similares
-
🐛 Bug 🔔 Pending processing
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
jumpserver/jumpserver#17584 ·
-
link-check link-check:sphinx-theme
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
modelscope/DiffSynth-Studio#1702 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
OpenHands/extensions#626 · 1 comentario ·