Skip to content
Snippets Groups Projects
Commit ff6a3bbe authored by Nicola Fulvio Calabria's avatar Nicola Fulvio Calabria
Browse files

Removed job_id from external link generated endpoint

parent 526288d2
No related branches found
No related tags found
No related merge requests found
......@@ -130,9 +130,9 @@ public class UriService {
Protocol protocol = new Protocol();
protocol.setUri(p.getUri());
protocol.setEndpoint(endpoint);
return protocol;
return protocol;
} else {
return null;
return null;
}
}).filter(Objects::nonNull)
.collect(Collectors.toList());
......@@ -224,6 +224,10 @@ public class UriService {
if (isLinkNode) {
endpoint = ((LinkNode) node).getTarget();
String linkTarget = ((LinkNode) node).getTarget();
if (linkedServiceDAO.isLinkedServiceUrl(linkTarget)) {
endpoint += "&token=" + getEndpointToken(linkTarget);
}
} else {
Location location = locationDAO.getNodeLocation(relativePath).orElse(null);
......@@ -238,17 +242,12 @@ public class UriService {
} else {
endpoint = fileServiceUrl + urlEncodePath(relativePath);
}
}
endpoint += "?jobId=" + job.getJobId();
endpoint += "?jobId=" + job.getJobId();
if (isLinkNode) {
String linkTarget = ((LinkNode) node).getTarget();
if (linkedServiceDAO.isLinkedServiceUrl(linkTarget)) {
endpoint += "&token=" + getEndpointToken(linkTarget);
if (!"true".equals(NodeProperties.getNodePropertyByURI(node, NodeProperties.PUBLIC_READ_URI))) {
endpoint += "&token=" + getEndpointToken(fileServiceUrl + relativePath);
}
} else if (!"true".equals(NodeProperties.getNodePropertyByURI(node, NodeProperties.PUBLIC_READ_URI))) {
endpoint += "&token=" + getEndpointToken(fileServiceUrl + relativePath);
}
return endpoint;
......@@ -364,7 +363,7 @@ public class UriService {
return this.uri;
}
public boolean isEndpointCompliant(String endpoint) {
public boolean isEndpointCompliant(String endpoint) {
return endpoint.toLowerCase()
.startsWith(this.protocolString + "://");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment