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

Develop #176

Merged
merged 24 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4b8d9d1
UI - Persistent states (#151)
wcgunter Jun 13, 2023
5f9e8fc
UI - Allow appropriate buttons to open in a new tab (#152)
wcgunter Jun 14, 2023
f5f1a04
installation validation LDAP
voxparcxls Jun 21, 2023
516d347
revert commit
voxparcxls Jun 21, 2023
9f4f682
revert commit 2
voxparcxls Jun 21, 2023
194427e
UI - Add and implement data tables (#153)
wcgunter Jun 26, 2023
d3a0b72
UI - Update Processes with new selection features (#154)
wcgunter Jun 29, 2023
93192d8
UI - Display custom input variables (#156)
wcgunter Jul 6, 2023
48b7b7f
UI - Update history page for clarity and interactability (#157)
wcgunter Jul 6, 2023
07ce03d
Update to DataTables tables on workers page (#158)
wcgunter Jul 6, 2023
9f04832
IDS-9940: LDAP User Attributes Validation (#149)
voxparcxls Jul 6, 2023
5b6cc4b
UI - Bug Fixes #1 & Restoring Server Side Filtering (Processes) (#160)
wcgunter Jul 13, 2023
969d9bc
Add worker tags table and insert/update rest API (#159)
jamesfwood Jul 13, 2023
1231077
UI - Add custom output display to Processes & History pages (#162)
wcgunter Jul 20, 2023
35d7958
Feature/ids9941 301 return v2 (#155)
brentjk Jul 20, 2023
86198c4
UI worker tags (#163)
wcgunter Jul 21, 2023
8b5978c
UI - Update logs to use DataTables (#164)
wcgunter Jul 31, 2023
edf5658
UI - Initiators, Deployments, Processes, Logs (#167)
wcgunter Aug 2, 2023
fa8eef4
IDS-9532: LDAP server validation (#165)
voxparcxls Aug 2, 2023
648e4f6
Feature/ids9941 301 return v3 (#166)
brentjk Aug 2, 2023
6c175c7
UI - Fixes #2 (#168)
wcgunter Aug 3, 2023
791b504
UI - Fixes & Improvements from M20 Demo (#170)
wcgunter Aug 8, 2023
bb39410
UI - Misc Fixes 4 (#171)
wcgunter Aug 9, 2023
adbfa3b
UI - Misc Fixes 5 (#172)
wcgunter Aug 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3,109 changes: 1,596 additions & 1,513 deletions cws-core/src/main/java/jpl/cws/core/db/SchedulerDbService.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public void doFilter(

log.trace("doFilter path " + req.getContextPath());



if (log.isTraceEnabled()) {
log.trace("PATH = " + path);
Enumeration<String> reqHeaderNames = req.getHeaderNames();
Expand All @@ -91,6 +93,8 @@ public void doFilter(
}
}



// If skipping resource...
//
if (isSecurityExemptResource(path)) {
Expand All @@ -108,6 +112,7 @@ public void doFilter(
// FIXME: add similar logic as above to redirect Camunda login pages..

chain.doFilter(request, resp); // continue onwards with chain
statusOverride(resp, req);
return;
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public void doFilter(
return;
}



// If skipping resource...
//
if (isSecurityExemptResource(path)) {
Expand All @@ -75,6 +77,7 @@ public void doFilter(
// FIXME: add similar logic as above to redirect Camunda login pages..

chain.doFilter(request, resp); // continue onwards with chain
statusOverride(resp, req);
return;
}
else {
Expand Down
26 changes: 23 additions & 3 deletions cws-core/src/main/java/jpl/cws/core/web/CwsSecurityFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public abstract class CwsSecurityFilter implements javax.servlet.Filter {
private static final Logger log = LoggerFactory.getLogger(CwsSecurityFilter.class);

public static final String CWS_TOKEN_COOKIE_NAME = "cwsToken";
public static final String CWS_USERNAME_COOKIE_NAME = "cwsUsername";

static final String COOKIES_HEADER = "Set-Cookie";

Expand All @@ -51,11 +52,19 @@ public abstract class CwsSecurityFilter implements javax.servlet.Filter {
protected AuthorizationService authorizationService;

protected String cwsSecurityScheme;


private String cwsWebPort;
private String cwsSSLPort;

public void init(FilterConfig filterConfig) {
try {
cwsSecurityScheme = filterConfig.getInitParameter("identityPluginType");
cwsWebPort = filterConfig.getInitParameter("cwsWebPort");
cwsSSLPort = filterConfig.getInitParameter("cwsSSLPort");
log.debug("CWS Security scheme is: " + cwsSecurityScheme);
log.debug("CWS cwsWebPort is: " + cwsWebPort);
log.debug("CWS cwsSSLPort is: " + cwsSSLPort);


this.contextPath = filterConfig.getServletContext().getContextPath();

Expand Down Expand Up @@ -303,8 +312,18 @@ else if (path.toLowerCase().endsWith("/logout")) {

return false; // DON'T skip
}



// Simple override of http return for redirect code when http request is valid
protected void statusOverride(HttpServletResponse resp, HttpServletRequest req){
if (resp.getStatus() == 200){
resp.setStatus(301);
String newURL = getBaseUrl(req);
newURL = newURL.replaceFirst("http:", "https:");
newURL = newURL.replaceFirst(cwsWebPort, cwsSSLPort);
resp.setHeader("Location", newURL);
}
}

protected void logRequestInfo(HttpServletRequest req) {
// Log all of the headers
Enumeration<String> reqHeaderNames = req.getHeaderNames();
Expand Down Expand Up @@ -546,6 +565,7 @@ else if (resourceId.startsWith("process/")) {
protected void setCwsTokenCookie(HttpServletRequest req, HttpServletResponse resp) {
String cwsToken = req.getSession().getId();
WebUtils.addCookie(CWS_TOKEN_COOKIE_NAME, cwsToken, null, "/", resp);
WebUtils.addUnsecureCookie(CWS_USERNAME_COOKIE_NAME, getUsernameFromReq(req), null, "/", resp);
cwsSecurityService.addNewCwsTokenToDb(cwsToken, getUsernameFromReq(req));
//addCwsSessionId(getUsernameFromReq(req), req.getSession().getId());
}
Expand Down
5 changes: 4 additions & 1 deletion cws-core/src/main/java/jpl/cws/core/web/JsonResponse.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jpl.cws.core.web;

import com.google.gson.GsonBuilder;
import org.apache.commons.lang.StringEscapeUtils;

public class JsonResponse {
public enum Status {
Expand All @@ -25,6 +26,8 @@ public String getMessage() {
}

public String toString() {
return new GsonBuilder().setPrettyPrinting().create().toJson(this);
String json = new GsonBuilder().setPrettyPrinting().create().toJson(this);

return StringEscapeUtils.unescapeJava(json);
}
}
11 changes: 10 additions & 1 deletion cws-core/src/main/java/jpl/cws/core/web/WebUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static RestCallResult restCall(String urlString, String method, String da
*
*/
public static RestCallResult restCall(String urlString, String method, String data, String cookie, String acceptType, String contentType, Boolean allowInsecureRequests, String username, String password) throws Exception {
log.trace("urlString = " + urlString);
log.debug("urlString = " + urlString);
HttpURLConnection connection = null;
try {

Expand Down Expand Up @@ -212,6 +212,15 @@ public static void addCookie(String name, String value, String domain, String pa
Cookie cookie = constructCookie(name, value, domain, path);
resp.addCookie(cookie);
}

public static void addUnsecureCookie(String name, String value, String domain, String path, HttpServletResponse resp) {
if (!isValidCookieString(name) || !isValidCookieString(value)) {
throw new IllegalArgumentException("Cookie name and/or value is invalid (contains unacceptable characters)!");
}
Cookie cookie = constructCookie(name, value, domain, path);
cookie.setHttpOnly(false);
resp.addCookie(cookie);
}



Expand Down
Loading
Loading