Skip to content
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

Auxiliary & Access file download #203

Merged
merged 1 commit into from
May 2, 2024
Merged

Auxiliary & Access file download #203

merged 1 commit into from
May 2, 2024

Conversation

kdid
Copy link
Contributor

@kdid kdid commented Apr 29, 2024

Summary

Adds support for "downloading" PDF and ZIP "Auxiliary" files through the file-sets/id/download endpoint

Changes in this PR

  • Adds rendering to IIIF manifests containing PDF Aux files: https://iiif.io/api/cookbook/recipe/0046-rendering/
  • Update get-file-set-download handler to allow downloading .pdf or .zip Auxiliary files
    • Generates presigned url and sends a 302 redirect response
    • Token/auth requirements follow regular DC access policies (AV Download an exception)
  • Update get-file-set-download handler to allow "downloading" full size IIIF image for Access/Auxiliary image files through the IIIF server
    • Performs token based auth during OpenSearch query then sends superuser token to IIIF server

To Test

@mbklein mbklein force-pushed the deploy/staging branch 3 times, most recently from d5f9769 to 03d3e02 Compare April 29, 2024 21:22
@kdid kdid force-pushed the 4546-pdf branch 2 times, most recently from d0a11bf to 7d9a0b1 Compare April 30, 2024 18:18
@kdid kdid marked this pull request as ready for review April 30, 2024 19:12
@kdid kdid mentioned this pull request Apr 30, 2024
25 tasks
return "derivatives/" + prefix + "/" + id;
}

function extensionFromMimeType(mimeType) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this implementation works fine for now, but I'd be more comfortable with the mime.extension(type) method from the mime-types package. That's not currently a top-level project dependency, but it's already pulled in indirectly by axios, so we wouldn't be adding bloat by making use of it. And it may prevent other issues down the road.

@kdid kdid force-pushed the 4546-pdf branch 3 times, most recently from 8cdadca to 83ecbf3 Compare May 2, 2024 16:59
@kdid kdid merged commit d3044d3 into deploy/staging May 2, 2024
1 check passed
@kdid kdid deleted the 4546-pdf branch May 2, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants