Repository navigation
fix(auth): allow token downloads past expiry - #57
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Member
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
What changed and why
Password rotation redirects any user with an expired password to the change-password page. The API (
/api/) was already exempt, but file downloads were not. A service that fetches uploaded files with an API token, such as the datapusher, was redirected and its download failed.The idea, in simple words
Scripts cannot fill in a "change your password" form. The API was already excused for that reason. Download links were forgotten. Now a download link is also excused, but only when the request came in with an API token. A person using a browser session with an expired password is still sent to the change-password page. Every other page works the way it did before.
Files
ckanext/sse/password_policy.pyTOKEN_DOWNLOAD_ENDPOINTS:resource.download(CKAN core) ands3_resource.resource_download(ckanext-s3filestore)._enforce_rotation()returns early when the request is token-authenticated (g.login_via_auth_header) and the endpoint is one of those two.ckanext/sse/tests/test_password_policy.py: four new tests.Verified / not verified
Deployment
Merging to
mainrunsrelease.yml. Deployments that pin a specificckanext-ssecommit only pick this up when that pin is bumped.