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

Use the x-client-ip header for file set auth to allow proxying #80

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

mbklein
Copy link
Contributor

@mbklein mbklein commented Jan 21, 2023

The IIIF - API auth pipeline wasn't able to tell if a request was coming from the reading room because the request to the API is coming from IIIF, not from the client. It used to work because we were persisting the reading room API token, so it would get sent through in the cookie header that the IIIF server forwards to the API, but that was causing other problems.

The solution is to have the IIIF auth function add the real client IP to a custom x-client-ip header, which the API can then check against the list of reading room IPs. However, it's important only to use that header on FileSet auth requests, because otherwise any client could spoof a reading room IP address to get private metadata or search results. This PR addresses that by toggling the feature using an environment variable that is only set on the getFileSetAuthFunction resource.

The PR for the IIIF side of the transaction is nulib/iiif-server-terraform#10.

This code has already been deployed to staging.

@bmquinn bmquinn merged commit 58fceef into deploy/staging Jan 23, 2023
@bmquinn bmquinn deleted the 3487-reading-room-proxy branch January 23, 2023 15:28
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.

3 participants