neicnordic / sensitive-data-archive

https://neic-sda.readthedocs.io
GNU Affero General Public License v3.0
3 stars 7 forks source link

Update the metadata from the sda-download API #923

Closed nanjiangshu closed 3 months ago

nanjiangshu commented 3 months ago

Related issue(s) and PR(s)
This PR closes #875

Description This PR updates the metadata returned form the download API so that we don't leak any unnecessary info. Apart from that, checksum info for the encrypted files are also included.

How to test

  1. Build the image by running the following command in the sub-folder sda-download

    docker build . -t harbor.nbis.se/gdi/sda-download:20240415
  2. Start the docker setup from the repo starter-kit-storage-and-interfaces (main branch) by

    docker compose -f docker-compose-demo.yml up -d

    note that you need to comment out this line for the download service so that the docker setup can be started properly

  3. Get the token and check if the metadata returned from the API meet the A/C

    token=$(curl -s -k https://localhost:8080/tokens | jq -r '.[0]')
    curl  -H "Authorization: Bearer $token" http://localhost:8443/metadata/datasets/DATASET0001/files | jq