Closed ajstanley closed 3 years ago
Can you lay out how I can test this?
Try running a bag on a node with locked down access. Any file or node that an anonymous user won't be able to see. You should get baggage.
The changes in the islandora_bagger_integration module will pass the Auth token as --extra
Sorry, I'm still not clear on how to test. What do I pass in? Where do I get an auth token?
Would you mind adding an example to the sample config file included in README.md explainsing what goes in the new auth
config setting? Maybe just after the existing drupal_basic_auth
setting, e.g.
# Required.
drupal_base_url: 'http://localhost:8000'
drupal_basic_auth: ['admin', 'islandora']
# Or, use an auth token. You can get this from ......
auth: xxxxxxxxxxx
# Required. How to name the Bag directory (or file if serialized). One of 'nid' or 'uuid'.
bag_name: nid
Testing this now and have found a backwards compatibility issue. In your branch, running bagger without passing the token (./bin/console app:islandora_bagger:create_bag --settings=sample_config.yml --node=65
), I am getting
./bin/console app:islandora_bagger:create_bag --settings=sample_config.yml --node=65
In AddMedia.php line 62:
Warning: Illegal string offset 'field_media_use'
I wonder if adding logic to test if $this->settings['auth']
is set and if so, adding it to the array we're passing into the Guzzle client would do the trick? Want me to try that locally and if it works, merge it in after I merge your PR?
OK, my fix worked when running it from the command line. Can you open a PR against Bagger Integration to add the code at https://github.com/roblib/islandora_bagger_integration/blob/master/src/Plugin/Form/IslandoraBaggerLocalForm.php#L94-L98 and I'll test that too?
Just noticed.... the code that adds the auth
option is in a form called IslandoraBaggerLocalForm.php, but that doesn't exist in the master branch. Is there another PR against Bagger Integration that I missed?
I added a bunch of token authorizations to allow for locked-down fedoras (Sorry about all the format changes, PHPStorm has opinions about how code should look)