-
Notifications
You must be signed in to change notification settings - Fork 558
Allow Preview User to download files without requiring a Guestbook Re… #12548
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
Closed
stevenwinship
wants to merge
6
commits into
develop
from
12535-download-without-guestbook-response-for-preview-user
+35
−11
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dd2dc36
Allow Preview User to download files without requiring a Guestbook Re…
stevenwinship feff8ba
comment fix for preview url user download access
stevenwinship 0b94953
fix release notes per review comment
stevenwinship d8aa544
set token in privateUrlUser in PrivateUrlServiceBean
stevenwinship 196286a
refactor based on review comment
stevenwinship 33244d7
remove need for signed url
stevenwinship File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
doc/release-notes/12535-download-without-guestbook-response-for-preview-user.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ## Bug ## | ||
| Preview URL users could not download files from the dataset being previewed if a guestbook was assigned to that dataset. This is now fixed. |
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to run a debugger - here's the core issue. For both Authenticated and Private URL users, user is Guest at this point (so exempt is always false). Before the check to see if there's an authenticated user with permissions below, getRequestor(user) is called, which returns the authenticateduser in that case. In the privateUrl user case, getRequestor(user) will return the PrivateUrlUser, which would allow the check currently on line 2239 to succeed for that case. So I'd suggest a reshuffle - go back to seeing if a guestbook response is required first, and, if it is, get the requestor and make both the authenticated and private url user checks against the requestor.
With this change, there's no need to store the PrivateUrlUser token or generate a URL with the key in it and those changes can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The private user token needs to be passed to the api as &key= in order for the ApiKeyAuthMechanism to recognize the user is a private user instead of a guest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #12569 - unless I made a typo merging this from QDR, I think this solves the issue with downloads from within JSF, building on your work in #12110, that you were trying to address here via signing or now adding the privateURL key.