resolve() truncates object keys containing '#', '?', or ';' (breaks special-char keys and presigned URLs)
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Comienza en registry.py, en ObjectStoreRegistry.resolve(), y reproduce el problema con los ejemplos de object-key y presigned-URL del informe. Añade cobertura de regresión para claves que contengan punto y coma, signos de interrogación y fragmentos, y confirma que la resolución conserva la clave o URL completa que necesita el store correspondiente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
ObjectStoreRegistry.resolve() derives the object key from urlparse(url).path, which silently discards anything urlparse treats as URL params (;), query (?), or fragment (#). As a result the resolved key is truncated whenever a URL contains one of those characters.
This bites in two distinct, real situations:
Motivation 1 — object keys that contain # / ? / ;
These characters are valid in S3/GCS/Azure object keys. Concrete example: the Cell Painting Gallery (AWS Open Data) has image files named like DC_DCAM#1_CAM3.tif.
from obspec_utils.registry import ObjectStoreRegistry
from obstore.store import MemoryStore
reg = ObjectStoreRegistry()
reg.register("s3://bucket", MemoryStore())
store, path = reg.resolve("s3://bucket/path/DC_DCAM#1_CAM3.tif")
print(path) # -> 'path/DC_DCAM' ❌ expected 'path/DC_DCAM#1_CAM3.tif'
Downstream this surfaces as a spurious FileNotFound for the truncated key. We hit it via virtual_tiff → async-tiff reading the gallery:
AsyncTiffException: FileNotFoundError: Object at location .../Dest210531-152149/DC_DCAM ...
Motivation 2 — presigned URLs / SAS tokens for private buckets
A natural way to give a reader access to a private bucket without distributing credentials is to hand VirtualiZarr presigned URLs (or Azure SAS URLs), where the signature lives in the query string:
https://bucket.s3.us-east-1.amazonaws.com/key?X-Amz-Credential=...&X-Amz-Signature=...
resolve() currently drops the entire ?... query, i.e. it strips the signature, so every read against a generic HTTP store fails auth (403). Preserving the query is required for this pattern to work at all.
store, path = reg.resolve("https://host/data/file.nc?token=abc123")
print(path) # -> 'data/file.nc' ❌ token lost (expected 'data/file.nc?token=abc123')
Cause
registry.py, in resolve():
parsed = urlparse(url)
path = parsed.path # drops fragment ('#...'), query ('?...'), params (';...')
Fix
Reattach params/query/fragment to reconstruct the full key. PR to follow.
Note: for a presigned URL that resolves to an already-credentialed object store (rather than a
generic HTTP store), the reattached query would become part of the key — but that is a
contradictory configuration (the store already authenticates), and is out of scope for both
motivations above. Happy to gate on store type if maintainers prefer.
- Lenguaje dominante
- Python
- Estrellas
- 12
- Forks
- 3
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 developmentseed/obspec-utils
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
developmentseed/obspec-utils#93 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
developmentseed/obspec-utils#79 · 4 comentarios ·
-
Switch docs hosting to developmentseed domainQuizá libre de nuevo @maxrjones la tomó hace 181 días y no hay ningún pull request abierto. Abierto
developmentseed/obspec-utils#67 · 1 comentario · 1 asignado ·
-
doc: Add explanation of when to use obstore's HttpStore vs obspec-utils AiohttpReadableStoreAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 52/100
developmentseed/obspec-utils#63 · 2 reacciones ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
developmentseed/obspec-utils#62 · 1 comentario ·
Todos los issues de developmentseed/obspec-utils
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
pydot/pydot#601 · 4 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
letsencrypt/cp-cps#361 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
CI: startup_failure because callers grant fewer permissions than ledger-app-workflows@v1 declaresPosiblemente ocupada @maykonmichel la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
LedgerHQ/app-boilerplate-rust#227 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
linuxmint/mintupdate#1107 ·