Added DataDistributor Uri binding authorization checks - #520
Conversation
chenejac
left a comment
There was a problem hiding this comment.
@litvinovg please check my comment(s)
| @@ -142,7 +154,7 @@ private void do400BadRequest(String message, HttpServletResponse resp) throws IO | |||
| private void do403Forbidden(HttpServletResponse resp) throws IOException { | |||
| log.debug("403Forbidden"); | |||
There was a problem hiding this comment.
| log.debug("403Forbidden"); | |
| log.debug("403 Forbidden"); |
932a6ec to
ccb33fd
Compare
|
I haven't been able to reproduce the intended behavior. I added a select-from-content distributor with URI binding "thething": I have a vivo:AcademicDepartment http://vivo.mydomain.edu/individual/n6267 where I've set "Suppress Display for roles": Public |
…SelectfromGraphDistributor
Right, it's supposed to return unauthorized. I applied authorization checks to sparql select data distributors. Please try it when you have time. |
There was a problem hiding this comment.
Checked all three of SelectFromContentDistributor, SelectFromGraphDistributor and RDFGraphDistributor, and the authorization check behaves as expected. The only issue is that for the SelectFromGraphDistributor and and RDFGraphDistributor I got the plain-text "Not authorized..." message returned with the wrong content type (application/sparql-results+json and application/rdf+xml, respectively), leading to these two screenshots:
chenejac
left a comment
There was a problem hiding this comment.
One checkstyle validation has been reported:
Error: /home/runner/work/Vitro/Vitro/Vitro/api/src/main/java/edu/cornell/library/scholars/webapp/controller/api/DistributeDataApiController.java:38:8: Unused import - edu.cornell.mannlib.vitro.webapp.web.ContentType. [UnusedImports]
Related to VIVO GitHub issue
What does this pull request do?
Adds authorization checks for bound URI values in Data Distribution API
How should this be tested?
For each type of distributors: SelectFromContentDistributor, SelectFromGraphDistributor, RDFGraphDistributor
Interested parties
@VIVO-project/vivo-committers
Candidates for reviewing this PR should have some of the following expertises:
Reviewers' report template
General comment
A reviewer should provide here comments and suggestions for requested changes if any.
Testing
A reviewer should briefly describe here how it was tested
Code reviewing
A reviewer should briefly describe here which part was code reviewed