Skip to content

Commit

Permalink
Revert redirect endpoint, fix jwt filter logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 committed Nov 8, 2024
1 parent 223034b commit 3e26b93
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,4 @@ public Response getProxy(
return proxyWebClient.getProxy(containerId, request, uriInfo.getQueryParameters(), headers);
}

@GET
@Path("/query/{queryId}/signed-redirect")
@Consumes("*/*")
public Response getSignedRedirect(
@PathParam("queryId") UUID queryId,
@QueryParam("target") String target,
@Parameter QueryRequest credentialsQueryRequest,
@Context HttpHeaders headers) {
return queryService.getSignedRedirect(queryId, credentialsQueryRequest, headers, target);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ private HashMap<String, Object> prepareRequestMap(ContainerRequestContext reques
// Read the query from the backing store if we are getting the results (full query may not be specified in request)
if (requestPath.startsWith("/query/") &&
(requestPath.endsWith("result") || requestPath.endsWith("result/") ||
requestPath.endsWith("signed-redirect") || requestPath.endsWith("signed-redirect/"))
requestPath.endsWith("signed-url") || requestPath.endsWith("signed-url/"))
) {
// Path: /query/{queryId}/result
String[] pathParts = requestPath.split("/");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,17 +430,5 @@ private Resource verifyQueryRequest(QueryRequest dataQueryRequest, HttpHeaders h
);
return resource;
}

public Response getSignedRedirect(UUID queryId, QueryRequest credentialsQueryRequest, HttpHeaders headers, String target) {
Response response = this.queryResultSignedUrl(queryId, credentialsQueryRequest, headers);
String responseString = response.getEntity().toString();
try {
SignedUrlResponse signedUrlResponse = mapper.readValue(responseString, SignedUrlResponse.class);
String formattedString = String.format(target, URLEncoder.encode(signedUrlResponse.getSignedUrl(), StandardCharsets.UTF_8));
return Response.status(Response.Status.FOUND).location(URI.create(formattedString)).build();
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
}

0 comments on commit 3e26b93

Please sign in to comment.