sul-dlss / sdr-client

SDR API client (in Ruby)
https://sul-dlss.github.io/sdr-api/
Other
0 stars 1 forks source link

readme example produces invalid rights situation #156

Open andrewjbtw opened 3 years ago

andrewjbtw commented 3 years ago

In the readme, one of the suggested commands is:

sdr --service-url https://sdr-api-server:3000 deposit --label 'hey there' \
  --admin-policy 'druid:bk123gh4567' \
  --collection 'druid:gh456kw9876' \
  --source-id 'googlebooks:stanford_12345' file1.png file2.png

This works as an API request but then leads to an error with the rights: https://app.honeybadger.io/projects/67994/faults/64639563

Dor::Services::Client::UnexpectedResponse: Bad Request: 400 ({"errors":[{"status":"400","title":"Bad Request","detail":"Not all files have dark access and/or are unshelved when item access is dark: [\"placeholder.txt\"]"}]})

I think what may be happening is that the request is defaulting to object rights as dark, but the files are given incompatible file-level rights and/or file-level shelve/preserve settings. Explicitly setting rights to world works, though what happens there is the object gets "world no-download".

In the long run, this probably needs we have to dedicate some time to looking at the client options, and possibly require the rights option to be set explicitly, but for my immediate purposes any non-dark rights setting was fine.