resolve() truncates object keys containing '#', '?', or ';' (breaks special-char keys and presigned URLs)
Đá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
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của developmentseed/obspec-utils
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
developmentseed/obspec-utils#93 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
developmentseed/obspec-utils#79 · 4 bình luận ·
-
Switch docs hosting to developmentseed domainCó thể làm lại được @maxrjones đã nhận 185 ngày trước và không có pull request nào đang mở. Đang mở
developmentseed/obspec-utils#67 · 1 bình luận · 1 người được giao ·
-
doc: Add explanation of when to use obstore's HttpStore vs obspec-utils AiohttpReadableStoreĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 52/100
developmentseed/obspec-utils#63 · 2 reaction ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
developmentseed/obspec-utils#62 · 1 bình luận ·
Tất cả issue của developmentseed/obspec-utils
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
NousResearch/hermes-agent#147104 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[oblt-aw][autodoc] Document new required `shared-org-key` input for `obs-aw-dependency-review`Có thể đã có người làm @github-actions đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bot-triaged module: inductor oncall: pt2 topic: fuzzer triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
getchaintips leaves out the active tip once a header is staged on it, where Core always lists itĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
btclib-org/btclib-node#2158 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
patrick-hudson/put.gd-desktop#979 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày