Skip to content

Commit ffb3a11

Browse files
committed
Merge tag 'v3.2.4' into develop
3.2.4
2 parents cfb588b + 29438a4 commit ffb3a11

9 files changed

Lines changed: 48 additions & 31 deletions

File tree

owasp-suppression.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,10 @@
138138
<!-- Disputed by developers, not relevant for ShinyProxy -->
139139
<cve>CVE-2023-35116</cve>
140140
</suppress>
141+
142+
<!-- Fixed in kotlin-stdlib 1.4.21, ShinyProxy uses a newer version-->
143+
<suppress>
144+
<cve>CVE-2020-29582</cve>
145+
</suppress>
146+
141147
</suppressions>

pom.xml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>eu.openanalytics</groupId>
77
<artifactId>shinyproxy</artifactId>
8-
<version>3.3.0-SNAPSHOT</version>
8+
<version>3.2.4</version>
99
<packaging>jar</packaging>
1010
<inceptionYear>2016</inceptionYear>
1111

@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>org.springframework.boot</groupId>
2222
<artifactId>spring-boot-starter-parent</artifactId>
23-
<version>3.4.13</version>
23+
<version>3.5.14</version>
2424
<relativePath/>
2525
</parent>
2626

@@ -32,12 +32,12 @@
3232
<resource.delimiter>&amp;</resource.delimiter>
3333
<!-- Dependency versions -->
3434
<containerproxy.version>1.3.0-SNAPSHOT</containerproxy.version>
35-
<spring-boot.version>3.4.13</spring-boot.version>
35+
<spring-boot.version>3.5.14</spring-boot.version>
3636
<datatables.version>2.3.4</datatables.version>
3737
<datatables-plugins.version>2.3.6</datatables-plugins.version>
3838
<datatables-buttons.version>3.1.2</datatables-buttons.version>
3939
<datatables-responsive.version>2.4.0</datatables-responsive.version>
40-
<handlebars.version>4.7.7</handlebars.version>
40+
<handlebars.version>4.7.9</handlebars.version>
4141
<sqlite-jdbc.version>3.50.3.0</sqlite-jdbc.version>
4242
<commons-lang.version>3.18.0</commons-lang.version>
4343
<!-- Plugin versions -->
@@ -147,7 +147,7 @@
147147
</exclusions>
148148
</dependency>
149149
<dependency>
150-
<groupId>org.webjars</groupId>
150+
<groupId>org.webjars.npm</groupId>
151151
<artifactId>handlebars</artifactId>
152152
<version>${handlebars.version}</version>
153153
</dependency>
@@ -189,24 +189,14 @@
189189

190190
<!-- Transitive dependencies updated for security -->
191191
<dependency>
192-
<groupId>io.undertow</groupId>
193-
<artifactId>undertow-core</artifactId>
194-
<version>2.3.21.Final</version>
195-
</dependency>
196-
<dependency>
197-
<groupId>io.undertow</groupId>
198-
<artifactId>undertow-servlet</artifactId>
199-
<version>2.3.21.Final</version>
200-
</dependency>
201-
<dependency>
202-
<groupId>io.undertow</groupId>
203-
<artifactId>undertow-websockets-jsr</artifactId>
204-
<version>2.3.21.Final</version>
192+
<groupId>org.webjars</groupId>
193+
<artifactId>swagger-ui</artifactId>
194+
<version>5.32.5</version>
205195
</dependency>
206196
<dependency>
207197
<groupId>org.apache.logging.log4j</groupId>
208198
<artifactId>log4j-api</artifactId>
209-
<version>2.25.3</version>
199+
<version>2.25.4</version>
210200
</dependency>
211201
</dependencies>
212202

src/main/java/eu/openanalytics/shinyproxy/controllers/AppController.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import eu.openanalytics.containerproxy.model.runtime.runtimevalues.PortMappingsKey;
3737
import eu.openanalytics.containerproxy.model.runtime.runtimevalues.PublicPathKey;
3838
import eu.openanalytics.containerproxy.model.runtime.runtimevalues.RuntimeValue;
39+
import eu.openanalytics.containerproxy.model.spec.ParameterDefinition;
3940
import eu.openanalytics.containerproxy.model.spec.ProxySpec;
4041
import eu.openanalytics.containerproxy.service.AsyncProxyService;
4142
import eu.openanalytics.containerproxy.service.InvalidParametersException;
@@ -80,6 +81,7 @@
8081
import javax.annotation.PostConstruct;
8182
import javax.inject.Inject;
8283
import java.io.IOException;
84+
import java.util.HashMap;
8385
import java.util.List;
8486
import java.util.Map;
8587
import java.util.Optional;
@@ -169,6 +171,11 @@ private ModelAndView app(ModelMap map, HttpServletRequest request, HttpServletRe
169171
map.put("parameterValues", allowedParametersForUser.getValues());
170172
map.put("parameterDefaults", allowedParametersForUser.getDefaultValue());
171173
map.put("parameterDefinitions", spec.getParameters().getDefinitions());
174+
Map<ParameterDefinition, String> cleanedAppParameterDescriptions = new HashMap<>();
175+
for (ParameterDefinition parameterDefinition : spec.getParameters().getDefinitions()) {
176+
cleanedAppParameterDescriptions.put(parameterDefinition, thymeleaf.cleanHtml(parameterDefinition.getDescription()));
177+
}
178+
map.put("cleanedAppParameterDescriptions", cleanedAppParameterDescriptions);
172179
map.put("parameterIds", spec.getParameters().getIds());
173180

174181
if (spec.getParameters().getTemplate() != null) {

src/main/java/eu/openanalytics/shinyproxy/controllers/BaseController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public abstract class BaseController {
116116
@Inject
117117
private IContainerBackend backend;
118118
@Inject
119-
private Thymeleaf thymeleaf;
119+
protected Thymeleaf thymeleaf;
120120
@Inject
121121
protected SpecExpressionResolver expressionResolver;
122122
@Inject
@@ -176,7 +176,7 @@ protected void prepareMap(ModelMap map, HttpServletRequest request, HttpServletR
176176
map.put("bootstrapCss", "/css/bootstrap.css");
177177
map.put("bootstrapJs", "/js/bootstrap.js");
178178
map.put("jqueryJs", "/webjars/jquery/3.7.1/jquery.min.js");
179-
map.put("handlebars", "/webjars/handlebars/4.7.7/handlebars.runtime.min.js");
179+
map.put("handlebars", "/webjars/handlebars/4.7.9/dist/handlebars.runtime.min.js");
180180

181181
boolean isLoggedIn = authentication != null && !(authentication instanceof AnonymousAuthenticationToken) && authentication.isAuthenticated();
182182
map.put("isLoggedIn", isLoggedIn);
@@ -191,7 +191,7 @@ protected void prepareMap(ModelMap map, HttpServletRequest request, HttpServletR
191191
map.put("pauseSupported", backend.supportsPause());
192192
map.put("spInstance", identifierService.instanceId);
193193
map.put("allowTransferApp", allowTransferApp);
194-
map.put("notificationMessage", environment.getProperty("proxy.notification-message"));
194+
map.put("notificationMessage", thymeleaf.cleanHtml(environment.getProperty("proxy.notification-message")));
195195
map.put("bodyClasses", bodyClasses);
196196
setLanguageConfig(map, request, response);
197197

src/main/java/eu/openanalytics/shinyproxy/controllers/IndexController.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232

3333
import javax.annotation.PostConstruct;
3434
import javax.inject.Inject;
35+
import java.util.HashMap;
3536
import java.util.List;
37+
import java.util.Map;
3638

3739
@Controller
3840
public class IndexController extends BaseController {
@@ -96,6 +98,18 @@ private Object index(ModelMap map, HttpServletRequest request, HttpServletRespon
9698

9799
prepareMap(map, request, response);
98100

101+
Map<ProxySpec, Boolean> openSwitchInstanceInsteadOfApp = new HashMap<>();
102+
Map<ProxySpec, String> appUrl = new HashMap<>();
103+
Map<ProxySpec, String> cleanDescription = new HashMap<>();
104+
for (ProxySpec app : apps) {
105+
openSwitchInstanceInsteadOfApp.put(app, thymeleaf.openSwitchInstanceInsteadOfApp(app));
106+
appUrl.put(app, thymeleaf.getAppUrl(app));
107+
cleanDescription.put(app, thymeleaf.cleanHtml(app.getDescription()));
108+
}
109+
map.put("openSwitchInstanceInsteadOfApp", openSwitchInstanceInsteadOfApp);
110+
map.put("appUrl", appUrl);
111+
map.put("cleanDescription", cleanDescription);
112+
99113
// navbar
100114
map.put("page", "index");
101115

src/main/resources/static/handlebars/generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ set -u
2626
set -o pipefail
2727

2828
if [ ! -f "./node_modules/.bin/handlebars" ]; then
29-
npm install handlebars@4.7.7 --save false
29+
npm install handlebars@4.7.9 --save false
3030
fi
3131

3232
rm precompiled.js

src/main/resources/static/handlebars/precompiled.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/templates/app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ <h2 th:text="#{app.choose_parameters}"></h2>
151151
th:text="${value}"></option>
152152
</select>
153153
<span class="help-block" th:if="${parameterDefinition.getDescription() != null}"
154-
th:utext="${@thymeleaf.cleanHtml(parameterDefinition.getDescription())}"></span>
154+
th:utext="${cleanedAppParameterDescriptions.get(parameterDefinition)}"></span>
155155
</div>
156156
</div>
157157

src/main/resources/templates/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@
5252
<th:block th:if="${app != null}">
5353
<div
5454
class="list-group-item"
55-
th:classappend="${@thymeleaf.openSwitchInstanceInsteadOfApp(app) ? 'app-link-switch' : 'app-link-open'}"
55+
th:classappend="${openSwitchInstanceInsteadOfApp.get(app) ? 'app-link-switch' : 'app-link-open'}"
5656
th:data-app-id="${app.id}"
57-
th:data-app-url="${@thymeleaf.openSwitchInstanceInsteadOfApp(app) ? '' : @thymeleaf.getAppUrl(app)}"
57+
th:data-app-url="${openSwitchInstanceInsteadOfApp.get(app) ? '#' : appUrl.get(app)}"
5858
>
59-
<a th:href="${@thymeleaf.openSwitchInstanceInsteadOfApp(app) ? '#' : @thymeleaf.getAppUrl(app)}"
60-
th:remove="${@thymeleaf.openSwitchInstanceInsteadOfApp(app)} ? tag : none">
59+
<a th:href="${openSwitchInstanceInsteadOfApp.get(app) ? '#' : appUrl.get(app)}"
60+
th:remove="${openSwitchInstanceInsteadOfApp.get(app)} ? tag : none">
6161
<span class="app-list-title app-list-title-before" th:text="${app.displayName == null} ? ${app.id} : ${app.displayName}"></span>
6262
<th:block th:if="${appLogos.get(app) != null}" th:with="logo=${appLogos.get(app)}">
6363
<img th:height="${logo.height}" th:src="${logo.src}" th:style="${logo.style}" th:width="${logo.width}">
6464
</th:block>
6565
<span class="app-list-title app-list-title-after" th:text="${app.displayName == null} ? ${app.id} : ${app.displayName}"></span>
6666
</a>
67-
<span class="app-list-description" th:if="${app.description != null}" th:utext="${@thymeleaf.cleanHtml(app.description)}"></span>
67+
<span class="app-list-description" th:if="${app.description != null}" th:utext="${cleanDescription.get(app)}"></span>
6868
</div>
6969
</th:block>
7070
</th:block>
@@ -76,7 +76,7 @@
7676
th:class="${myAppsMode == 'Inline' ? 'col-xs-12 col-md-4 col-md-offset-3 col-lg-5 col-lg-offset-3' : 'col-lg-6 col-lg-offset-3'}">
7777
<div class="alert alert-warning notification-message" role="alert" th:if="${notificationMessage != null}">
7878
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
79-
<p th:utext="${@thymeleaf.cleanHtml(notificationMessage)}"> </p>
79+
<p th:utext="${notificationMessage}"> </p>
8080
</div>
8181
<div class="alert alert-info" role="alert"
8282
th:if="${groupedApps.isEmpty() && ungroupedApps.isEmpty()}">

0 commit comments

Comments
 (0)