Add auth cache in nginx for s3 endpoint#712
Open
mishaschwartz wants to merge 3 commits into
Open
Conversation
Collaborator
E2E Test ResultsDACCS-iac Pipeline ResultsBuild URL : http://daccs-jenkins.crim.ca:80/job/DACCS-iac-birdhouse/4312/Result 🆘 ABORTEDBIRDHOUSE_DEPLOY_BRANCH : s3-auth-cache DACCS_IAC_BRANCH : master DACCS_CONFIGS_BRANCH : master PAVICS_E2E_WORKFLOW_TESTS_BRANCH : master PAVICS_SDI_BRANCH : master DESTROY_INFRA_ON_EXIT : true PAVICS_HOST : https://host-140-118.rdext.crim.ca
|
tlvu
approved these changes
Jun 1, 2026
| # of the same file in parallel (for example). | ||
| proxy_cache "s3_auth_cache"; | ||
| proxy_cache_key "$request_uri:uri:$http_authorization:cache:$cookie_${MAGPIE_COOKIE_NAME}"; | ||
| proxy_cache_valid 200 401 403 1m; |
Collaborator
There was a problem hiding this comment.
Any reasons someone would want a longer or shorter cache timeout than 1m? Worth to make it configurable?
Collaborator
Author
There was a problem hiding this comment.
I think that 1m is a reasonable default but it's always worth making things configurable
fmigneault
reviewed
Jun 2, 2026
Collaborator
E2E Test ResultsDACCS-iac Pipeline ResultsBuild URL : http://daccs-jenkins.crim.ca:80/job/DACCS-iac-birdhouse/4323/Result ❌ FAILUREBIRDHOUSE_DEPLOY_BRANCH : s3-auth-cache DACCS_IAC_BRANCH : master DACCS_CONFIGS_BRANCH : master PAVICS_E2E_WORKFLOW_TESTS_BRANCH : master PAVICS_SDI_BRANCH : master DESTROY_INFRA_ON_EXIT : true PAVICS_HOST : https://host-140-118.rdext.crim.ca PAVICS-e2e-workflow-tests Pipeline ResultsTests URL : http://daccs-jenkins.crim.ca:80/job/PAVICS-e2e-workflow-tests/job/master/845/NOTEBOOK TEST RESULTS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds a cache for the
s3auth endpoint (that calls Twitcher's verify endpoint) so that repeated requests to the S3 store don't overwhelm twitcher and cause client connection issues if twitcher or nginx fails to properly authorize access to a resource.This issue may arise if a client is processing a large S3 object in parallel by accessing different byte-ranges simultaneously. This results in many simultaneous requests to the same resource, each of which hits twitcher's verify endpoint. With this change, only the first request each minute will hit twitcher and the rest will only hit the cache.
Some implementation details to note:
permissions expire quickly
and token-based authentication methods
Changes
Non-breaking changes
Breaking changes
Related Issue / Discussion
Additional Information
Note that this could be implemented for other endpoints as well (i.e. thredds).
CI Operations
birdhouse_daccs_configs_branch: master
birdhouse_skip_ci: false