Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

resolve() truncates object keys containing '#', '?', or ';' (breaks special-char keys and presigned URLs)

Đang mở Phù hợp với người mới
#85 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

@TomNicholas đang làm issue này rồi.

Từ ngày 19/7/2026.

  • #86 của @TomNicholas — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu trong registry.py tại ObjectStoreRegistry.resolve() và tái hiện vấn đề bằng các ví dụ object-key và presigned-URL trong báo cáo. Thêm kiểm thử hồi quy cho các key chứa dấu chấm phẩy, dấu hỏi và fragment, đồng thời xác nhận rằng việc resolve giữ nguyên toàn bộ key hoặc URL mà store liên quan cần.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
12
Fork
3
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của developmentseed/obspec-utils

Tất cả issue của developmentseed/obspec-utils

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.