Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions src/firefly/java/edu/caltech/ipac/astro/ibe/IBE.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void multipleQueries(File results, File posFile, IbeQueryParam param) {

Map<String, String> paramMap = ibeDataSource.getMulipleQueryParam(param);
paramMap.remove(POS);
HttpServiceInput input = HttpServiceInput.createWithCredential(url);
HttpServiceInput input = new HttpServiceInput(url);
paramMap.forEach(input::setParam);
input.setFile(POS, posFile);

Expand Down Expand Up @@ -151,7 +151,7 @@ private FileInfo downloadViaUrl(URL url, Map<String, String> sourceParams, File
plotId = sourceParams.get("plotId");
}

HttpServiceInput addtlInfo = HttpServiceInput.createWithCredential(url.toString());
HttpServiceInput addtlInfo = new HttpServiceInput(url.toString());

return URLFileInfoProcessor.retrieveViaURL(url, dir, progressKey, plotId, addtlInfo);
} catch (DataAccessException e) {
Expand All @@ -162,7 +162,7 @@ private FileInfo downloadViaUrl(URL url, Map<String, String> sourceParams, File

private void downloadViaUrlToFile(URL url, File results) throws IOException {
try {
HttpServiceInput addtlInfo = HttpServiceInput.createWithCredential(url.toString());
HttpServiceInput addtlInfo = new HttpServiceInput(url.toString());
addtlInfo.setHeader("Accept", "text/plain");

URLDownload.getDataToFile(url, results, addtlInfo.getCookies(), addtlInfo.getHeaders());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static Set<String> importJobHistories(String svcDef, List<JobInfo> userJo
String paramStr= urlObs == null ? "" : urlObs.getQuery();
String urlBase= (!isEmpty(paramStr) && url.contains("?")) ? url.split("\\?")[0] : url;

HttpServiceInput input = HttpServiceInput.createWithCredential(urlBase);
HttpServiceInput input = new HttpServiceInput(urlBase);
if (!isEmpty(paramStr)) input.setRequestUrl(input.getRequestUrl()+"?"+paramStr);
LOG.info("Importing job histories from %s; svcId=%s svcType=%s".formatted(input.getRequestUrl(), svcId, svcType));
Ref<List<JobInfo>> jobList = new Ref<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ public String doCommand(SrvParam params) throws Exception {

String backToUrl = params.getRequired(ServerParams.BACK_TO_URL);

SsoAdapter ssoAdapter = ServerContext.getRequestOwner().getSsoAdapter();
UserInfo info = requestOwner.getUserInfo();
LOG.debug("GetUserInfo: " + info);

JSONObject data = new JSONObject();
data.put(UserInfo.GUEST, info.isGuestUser());
Expand All @@ -182,9 +182,12 @@ public String doCommand(SrvParam params) throws Exception {
data.put(UserInfo.FIRSTNAME, info.getFirstName());
data.put("loginName", info.getLoginName());
}
data.put("login_url", ssoAdapter.getLoginUrl(backToUrl));
data.put("logout_url", ssoAdapter.getLogoutUrl(backToUrl));
data.put("profile_url", ssoAdapter.getProfileUrl(backToUrl));
SsoAdapter ssoAdapter = requestOwner.getSsoAdapter();
if (ssoAdapter != null) {
data.put("login_url", ssoAdapter.getLoginUrl(backToUrl));
data.put("logout_url", ssoAdapter.getLogoutUrl(backToUrl));
data.put("profile_url", ssoAdapter.getProfileUrl(backToUrl));
}
JSONObject map = new JSONObject();
map.put( "success", true);
map.put("data", data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,24 @@ public class RequestAgent {

private Map<String, Cookie> cookies;
private String requestUrl; // the request url
private String baseUrl; // the url up to the the app's path
private String baseUrl; // the url up to the app's path
private String hostUrl; // the url up to the host name including port
private String host;
private String remoteIP;
private String sessId;
private String contextPath;
private String servletPath;

public RequestAgent() {}

public RequestAgent(Map<String, Cookie> cookies, String hostUrl, String requestUrl, String baseUrl, String remoteIP, String sessId, String contextPath) {
public RequestAgent(Map<String, Cookie> cookies, String host, String requestUrl, String baseUrl, String remoteIP, String sessId, String contextPath) {
this.cookies = cookies;
this.requestUrl = requestUrl;
this.baseUrl = baseUrl;
this.remoteIP = remoteIP;
this.sessId = sessId;
this.contextPath = contextPath;
this.host = host;
}

public String getServletPath() {
Expand Down Expand Up @@ -84,6 +86,10 @@ void setSessId(String sessId) {

void setHostUrl(String hostUrl) { this.hostUrl = hostUrl;}

public String getHost() { return host;}

void setHost(String host) { this.host = host;}

public String getRequestUrl() {
return requestUrl;
}
Expand Down Expand Up @@ -199,6 +205,7 @@ public HTTP(HttpServletRequest request, HttpServletResponse response) {

setBaseUrl(baseUrl);
setHostUrl(hostUrl);
setHost(host);
setRequestUrl(requestUrl);
setContextPath(request.getContextPath());
setRemoteIP(remoteIP);
Expand Down
Loading