Repository navigation
Fixing external tools with guestbook responses - #12801
stevenwinship wants to merge 15 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Could you please sync the branch up with develop. |
|
@stevenwinship decoded: This in turn produces an /access url without the gbrid, which bombs with a 400. Please advise. |
86741c7 to
fea5d34
Compare
This comment has been minimized.
This comment has been minimized.
|
Did you install your own external tool? If so did you include "gbrecs=false" or "gbrecs=true" in the allowedapicalls? This is what it looks for to add the gb response id. I'll look into changing it so it gets added either way [{"name":"retrieveFileContents","httpMethod":"GET","urlTemplate":"/api/v1/access/datafile/{fileId}?gbrecs=true","timeOut":3600},{"name":"downloadFile","httpMethod":"GET","urlTemplate":"/api/v1/access/datafile/{fileId}?gbrecs=false","timeOut":3600},{"name":"getDatasetVersionMetadata","httpMethod":"GET","urlTemplate":"/api/v1/datasets/{datasetId}/versions/{datasetVersion}","timeOut":3600}] |
|
I installed the tool using the standard command as published. Which in my case was: seems to be the same - i.e.,
|
|
Do I need to re-test, with your latest commits from 1 hour ago? Or are these the same initial commits from force-pushing the branch? I'm getting errors/warning from |
|
... otherwise I can report another issue that I may be seeing. |
|
My latest commit was just a merge from develop |
|
I figured; but they are showing as new commits this am, above. I'm assuming because of a force-push? Since we do want/need to have the |
|
FWIW: ignoring when a gb is assigned, gbrecs determines whether an entry is made that signifies a download, so the main preview needs/needed true to avoid the API writing a download count. At some point, we decided that a preview is close enough to a download that we want to ask the guestbook questions, but I don't think we ever decided that, in the no guestbook case, previews should count as downloads. |
|
In other words, I was wrong above - in that On a side note, I'm not seeing either
|
Of course; I misread the code in Access.java earlier. |
|
I've been trying to reproduce your (@landreev) error using both .wav and .mpeg files. I am getting the dialog to enter the gb info and then I get the download to happen correctly with the id {"name":"downloadFile","httpMethod":"GET","urlTemplate":"/api/v1/access/datafile/{fileId}?gbrecs=true&gbrids=4","timeOut":3600}, Note: I can preview the wav file but I don't see the "eye" with the mpeg |
|
Made the change to pass the guestbook response instead of the id. The guestbook response will be written when the toolUrl is generated. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
Looks good, retesting now. |
|
And hopefully the last thing - when I use a previewer in JSF, the gbr recored has an Functionally everything is working as far as I can tell.
|
|
Hi, I'm not seeing any new commits since my last comments - were there supposed to be new changes? |
| TemplateServiceBean templateSvc; | ||
|
|
||
| @EJB | ||
| GuestbookResponseServiceBean guestbookResponseService; |
There was a problem hiding this comment.
Note that AbstractApiBean already had guestbookResponseService included, under a different name.
Also, there's a SonarCloud warning further down about Files.java duplicating guestbookResponseService under the same name.
| downloadResponse.then().assertThat() | ||
| .statusCode(OK.getStatusCode()); | ||
| signedUrl = UtilIT.getSignedUrlFromResponse(downloadResponse); | ||
| String fileId1GuestbookResponseId = UtilIT.getQueryParamValue(signedUrl, "gbrids"); |
There was a problem hiding this comment.
There is a whole bunch of SonarCloud warnings like this one about "useless assignments" in the test classes.
I'm not sure whether all of them are in fact useless; this variable doesn't seem to be used anywhere, but I'm guessing it's here to test for an exception (?).
Can these SonarCloud warnings be marked resolved or dismissed??
This comment has been minimized.
This comment has been minimized.
If we write a guestbook response with 'Explore' and the tool does a download, we will never get a 'Download' event. I'm not sure how to handle that |
It didn't sound like there was anything we could do to record the extra download (if the user decides to download a file that has an explicit guestbook defined from within the viewer). There was a discussion about that somewhere above. But all I'm requesting is to make the /toolUrl API behave identically to what the internal logic in jsf is doing: when a user clicks on the previewer there, it creates a GBR of type "Explore". It doesn't seem controversial to have the exact same behavior in /toolUrl. I.e., have the same end result in jsf and /modern. |
|
Hey, it sounds like you have a lot going on (I hope the kitten's ok too!). |
|
|
📦 Pushed preview images as 🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |


What this PR does / why we need it: External tools can't download files that require/have a guestbook response
Which issue(s) this PR closes:#12760
Special notes for your reviewer:
Suggestions on how to test this: Create a dataset with multiple files to preview. Add a guestbook to the dataset and publish. Test previewing the files and download from the external tool. Test files with restricted access.
Download timeout comes from the external tool params. Try creating an external tool with a 1 minute timeout and make sure the signed url expires.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?: included
Additional documentation: