You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please describe the feature
As a data recipient, I want download --api-version v2 to fetch files by fileId through the v2 re-encrypted Crypt4GH path, so my existing CLI commands keep working against the new server.
This is also where DownloadFile joins the Client interface and the legacy download.downloadFile / getFileIDURL go away. Deferred from #674 because it requires splitting the existing downloadFile (HTTP fetch + progress-bar write) into two pieces.
Acceptance criteria
Client interface: add DownloadFile(ctx, DownloadRequest) (io.ReadCloser, int64, error) and DownloadRequest type
V1Client.DownloadFile: absorbs the resolution logic from download.getFileIDURL (substring match kept) and the HTTP-fetch half of download.downloadFile. Returns the raw body for the caller to stream
V2Client.DownloadFile:
Resolves UserArg via ListFiles({ExactPath: ...}) for paths, list-and-match for bare IDs
Follows FileInfo.DownloadURL (server-provided; client does not construct /files/{id})
Sends X-C4GH-Public-Key (base64 of the raw 32-byte key preferred)
403 surfaces as ambiguous "dataset/file does not exist or access denied"
apiclient.File gains a DownloadURL field (empty on v1)
download.writeBodyToDisk(body, totalSize, destPath) extracted from downloadFile. Progress bar and .part handling unchanged
download --api-version v2 without --pubkey errors client-side with a clear message
End-to-end integration test: download the seeded file via v2, check body size matches Content-Length
Tests verifying the changes are added
Additional context
UX change: --pubkey is effectively required on v2. v1 currently accepts downloads without it; v2 will not. Document this in the PR description.
Part of #663. Depends on #676.
Please describe the feature
As a data recipient, I want
download --api-version v2to fetch files byfileIdthrough the v2 re-encrypted Crypt4GH path, so my existing CLI commands keep working against the new server.This is also where
DownloadFilejoins theClientinterface and the legacydownload.downloadFile/getFileIDURLgo away. Deferred from #674 because it requires splitting the existingdownloadFile(HTTP fetch + progress-bar write) into two pieces.Acceptance criteria
Clientinterface: addDownloadFile(ctx, DownloadRequest) (io.ReadCloser, int64, error)andDownloadRequesttypeV1Client.DownloadFile: absorbs the resolution logic fromdownload.getFileIDURL(substring match kept) and the HTTP-fetch half ofdownload.downloadFile. Returns the raw body for the caller to streamV2Client.DownloadFile:UserArgviaListFiles({ExactPath: ...})for paths, list-and-match for bare IDsFileInfo.DownloadURL(server-provided; client does not construct/files/{id})X-C4GH-Public-Key(base64 of the raw 32-byte key preferred)apiclient.Filegains aDownloadURLfield (empty on v1)download.writeBodyToDisk(body, totalSize, destPath)extracted fromdownloadFile. Progress bar and.parthandling unchangeddatasetCase/recursiveCase/fileCasecallclient.DownloadFile+writeBodyToDiskdownload.GetDatasets,download.GetFilesInfo,download.Filealias,download.getFileIDURL,download.downloadFiledownload --api-version v2without--pubkeyerrors client-side with a clear messageContent-LengthAdditional context
UX change:
--pubkeyis effectively required on v2. v1 currently accepts downloads without it; v2 will not. Document this in the PR description.Estimation of size: big
Estimation of priority: high