Skip to content

Commit

Permalink
[BUG] Visualization should not need tokens now in Open Access (#206)
Browse files Browse the repository at this point in the history
* Don't care about auth header in open access

* More open access checks
  • Loading branch information
JamesPeck authored Sep 20, 2024
1 parent fdff283 commit 1b740f2
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ public Map<String, Map<String, String>> getOpenCrossCountsMap(QueryRequest query
*/
private HttpHeaders prepareQueryRequest(QueryRequest queryRequest, ResultType resultType, String accessType) {
HttpHeaders headers = new HttpHeaders();
headers.add(AUTH_HEADER_NAME,
if (AUTHORIZED_ACCESS.getValue().equals(accessType)) {
headers.add(AUTH_HEADER_NAME,
queryRequest.getResourceCredentials().get(AUTH_HEADER_NAME)
);
);
}

headers.add("request-source", accessType);

Expand Down Expand Up @@ -128,7 +130,7 @@ private void sanityCheck(QueryRequest queryRequest, ResultType requestType, Stri
if (applicationProperties.getOrigin() == null) throw new IllegalArgumentException("picSureUrl is required");
if (applicationProperties.getAuthHpdsResourceId() == null)
throw new IllegalArgumentException("picSureUuid is required");
if (queryRequest.getResourceCredentials().get(AUTH_HEADER_NAME) == null)
if (AUTHORIZED_ACCESS.getValue().equals(accessType) && queryRequest.getResourceCredentials().get(AUTH_HEADER_NAME) == null)
throw new IllegalArgumentException("No authorization token found in queryRequest");
if (requestType == null) throw new IllegalArgumentException("ResultType is required");
if (requestType != ResultType.CATEGORICAL_CROSS_COUNT && requestType != ResultType.CONTINUOUS_CROSS_COUNT)
Expand Down

0 comments on commit 1b740f2

Please sign in to comment.