Skip to content
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

Visualization should not need tokens now in Open Access #206

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading