feat(download): add minimal DRS 1.5 object endpoint#2296
Open
jhagberg wants to merge 5 commits intofeature/sda-download-v2from
Open
feat(download): add minimal DRS 1.5 object endpoint#2296jhagberg wants to merge 5 commits intofeature/sda-download-v2from
jhagberg wants to merge 5 commits intofeature/sda-download-v2from
Conversation
DRS 1.5 requires size and checksums to describe the blob bytes served by access_url. Changed from DecryptedSize/UNENCRYPTED to ArchiveSize/ARCHIVED. Added GetFileChecksums DB method to return all checksums for a given source, supporting multiple algorithms.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feature/sda-download-v2 #2296 +/- ##
===========================================================
+ Coverage 42.29% 42.50% +0.21%
===========================================================
Files 120 121 +1
Lines 12242 12327 +85
===========================================================
+ Hits 5178 5240 +62
- Misses 6432 6454 +22
- Partials 632 633 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
fd30cd9 to
eecfa9c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue(s) and PR(s)
This PR closes #2246 (SDA-side work only; htsget-rs DrsStorage contribution is separate).
Related: umccr/htsget-rs#356
Description
Adds
GET /objects/{datasetId}/{filePath}— a minimal GA4GH DRS 1.5 endpoint that resolves a dataset + file path to aDrsObjectwith a pre-resolvedaccess_urlpointing to/files/{fileId}/content.Changes:
CreatedAttoFilestruct, newGetFileChecksumsmethod for querying checksums by source (ARCHIVED/UNENCRYPTED)handlers/drs.go— path parsing, auth, file resolution, DRS response constructionGET /objects/*pathregistered with auth middlewareDrsObject,DrsChecksum,DrsAccessMethod,DrsAccessURL)DRS 1.5 compliance:
size=ArchiveSize(encrypted blob size per spec: "blob size in bytes")checksumsfromARCHIVEDsource (per spec: "computed over the bytes in the blob")self_uri,created_time,access_methodsall per DRS 1.5 required fieldsNote: The htsget-rs maintainer pivoted to a
ResolveStoragebackend using the existing/datasets/{id}/files?filePath=endpoint. This DRS endpoint is an independent, spec-compliant addition with value for any DRS-aware tooling.ADR
docs/decisions/README.md)docs/decisions/How to test
10 unit tests covering: success path, 403 (not found + no access), 400 (malformed paths), 401, 500, empty checksums, multiple checksums, checksum type normalization. Route wiring test verifies auth requirement.