-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
htsget download endpoints #695
Conversation
af7a735
to
8a27350
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small things
faf9d4c
to
c49f140
Compare
I'm not sure what's in scope for this PR, should header reencryption be included or not? Some things may be premature without that. |
Valid points! The scope of this PR is to be able to communicate and do requests with htsget + sda-download. Some future work is mentioned under Further comments in the PR body. So, no, all things are not in place yet, but maybe good as a first step? |
I would say, if we can keep the changes in the scope of the reason i am mentioning this is because is while for htsget re-encryption might work in a certain way and that is ok, for serving decrypted filles we might need to generate fresh key pair every time (see changes in sda.go from https://github.com/neicnordic/sda-download/pull/330/files) and those changes need to come together. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some tests and error handling that's missing
sda-download/.github/integration/tests/common/70_check_download.sh
Outdated
Show resolved
Hide resolved
sda-download/.github/integration/tests/common/70_check_download.sh
Outdated
Show resolved
Hide resolved
sda-download/.github/integration/tests/common/70_check_download.sh
Outdated
Show resolved
Hide resolved
sda-download/.github/integration/tests/common/70_check_download.sh
Outdated
Show resolved
Hide resolved
Co-authored-by: Nanjiang Shu <nanjiang.shu@gmail.com>
to be readded when re-encryption is in place
947dd25
to
4021de3
Compare
only set the content-length for HEAD requests. The crypt4gh header should be added to the size.
2784d99
to
7994e9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Related issue(s) and PR(s)
This PR closes NBISweden/LocalEGA-SE-Deployment#725 and neicnordic/sda-download#372.
It is based on the work in neicnordic/sda-download#327.
Description
/s3-encrypted
which is similar to/s3
but returns an encrypted file.endCoordinate
or - for encrypted files - with the http headerRange: bytes=0-1000
. The later overrides the first, and is strictly interpreted, whileendCoordinate
will be used to find the nearest crypt4gh data block boundary and cut the file there.How to test
token=$(curl -s -k https://localhost:8080/tokens | jq -r '.[0]')
curl 'http://localhost:8443/s3-encrypted/DATASET0001/htsnexus_test_NA12878.bam' -H "Authorization: Bearer $token" -o test.bam.c4gh
curl 'http://localhost:8443/s3-encrypted/DATASET0001/htsnexus_test_NA12878.bam' -H "Authorization: Bearer $token" -o test3000.bam.c4gh -H "Range: bytes=0-3000
curl 'http://localhost:8443/s3-encrypted/DATASET0001/htsnexus_test_NA12878.bam?endCoordinate=3000' -H "Authorization: Bearer $token" -o test3000ok.bam.c4gh
curl --head -i 'http://localhost:8443/s3-encrypted/DATASET0001/htsnexus_test_NA12878.bam' -H "Authorization: Bearer $token"
Further comments
startCoordinate
is not implemented (see [sda-download] Implement random access in encrypted files #696)