Skip to content

Commit ceb9337

Browse files
bug fixes and csp updates
1 parent 20f8eef commit ceb9337

File tree

7 files changed

+17
-18
lines changed

7 files changed

+17
-18
lines changed

server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@
322322
<dependency>
323323
<groupId>com.github.ziplet</groupId>
324324
<artifactId>ziplet</artifactId>
325-
<version>2.3.0</version>
325+
<version>2.4.1</version>
326326
<exclusions>
327327
<exclusion>
328328
<groupId>com.google.googlejavaformat</groupId>

server/src/main/java/password/pwm/config/stored/StoredConfigurationImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,13 @@ public void writeConfigProperty(
246246
// remove existing element
247247
{
248248
final XmlElement propertyElement = xmlHelper.xpathForConfigProperty( propertyName );
249-
propertyElement.detach();
249+
if ( propertyElement != null )
250+
{
251+
propertyElement.detach();
252+
}
250253
}
251254

252255
// add new property
253-
{
254-
255-
}
256256
final XmlElement propertyElement = xmlHelper.getXmlFactory().newElement( XML_ELEMENT_PROPERTY );
257257
propertyElement.setAttribute( XML_ATTRIBUTE_KEY, propertyName.getKey() );
258258
propertyElement.addText( value );

server/src/main/resources/password/pwm/config/PwmSetting.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,8 +1627,7 @@
16271627
</setting>
16281628
<setting hidden="false" key="security.cspHeader" level="2">
16291629
<default>
1630-
<!--<value><![CDATA[]]></value>-->
1631-
<value><![CDATA[default-src 'self'; object-src 'none'; img-src 'self' data:; style-src 'self'; script-src https://www.google.com/recaptcha/ https://www.gstatic.com/recaptcha/ 'self' 'nonce-%NONCE%' ; frame-src https://www.google.com/recaptcha/ https://www.gstatic.com/recaptcha/; report-uri /sspr/public/command/cspReport]]></value>
1630+
<value><![CDATA[default-src 'self'; object-src 'none'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; script-src https://www.google.com/recaptcha/ https://www.gstatic.com/recaptcha/ 'self' 'unsafe-eval' 'nonce-%NONCE%'; frame-src https://www.google.com/recaptcha/ https://www.gstatic.com/recaptcha/; report-uri /sspr/public/command/cspReport]]></value>
16321631
</default>
16331632
</setting>
16341633
<setting hidden="false" key="email.adminAlert.toAddress" level="1">

webapp/src/main/webapp/WEB-INF/jsp/fragment/footer.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
</pwm:if>
6969
<pwm:script>
7070
<script type="text/javascript">
71-
var dojoConfig = { has: { "csp-restrictions":false }, async:true }
71+
var dojoConfig = { has: { "csp-restrictions":true }, async:true}
7272
</script>
7373
</pwm:script>
7474
<pwm:if test="<%=PwmIfTest.hasCustomJavascript%>">

webapp/src/main/webapp/WEB-INF/jsp/fragment/ldap-selector.jsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
</select>
6666
</div>
6767
<% } %>
68-
<div style="display: <%=showContextSelector?"inherit":"none"%>" id="contextSelectorWrapper">
68+
<div <%=showContextSelector?"":"class=\"display-none\" "%>" id="contextSelectorWrapper">
6969
<h2 class="loginFieldLabel"><label for="<%=PwmConstants.PARAM_CONTEXT%>"><pwm:display key="Field_Location"/></label></h2>
7070
<div class="formFieldWrapper">
7171
<select name="<%=PwmConstants.PARAM_CONTEXT%>" id="<%=PwmConstants.PARAM_CONTEXT%>" class="selectfield" title="<pwm:display key="Field_Location"/>">

webapp/src/main/webapp/WEB-INF/jsp/fragment/message.jsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<span id="errorCode" style="display: none"><%=requestError.getError().getErrorCode()%></span>
3636
<span id="errorName" style="display: none"><%=requestError.getError().toString()%></span>
3737
<% } else { %>
38-
<span style="display:none" id="message" class="message">&nbsp;</span>
38+
<span id="message" class="message display-none">&nbsp;</span>
3939
<% } %>
40-
<div id="capslockwarning" style="display:none;"><pwm:display key="Display_CapsLockIsOn"/></div>
40+
<div id="capslockwarning" class="display-none"><pwm:display key="Display_CapsLockIsOn"/></div>
4141
</div>

webapp/src/main/webapp/public/resources/js/main.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -474,27 +474,27 @@ PWM_MAIN.checkForCapsLock = function(e) {
474474

475475
if(dojo.isIE){
476476
if (capsLockKeyDetected) {
477-
capsLockWarningElement.style.display = 'block';
477+
PWM_MAIN.removeCssClass('capslockwarning','display-none');
478478
PWM_GLOBAL['lastCapsLockErrorTime'] = (new Date().getTime());
479479
setTimeout(function(){
480480
if ((new Date().getTime() - PWM_GLOBAL['lastCapsLockErrorTime'] > displayDuration)) {
481-
capsLockWarningElement.style.display = 'none';
481+
PWM_MAIN.addCssClass('capslockwarning','display-none');
482482
}
483483
},displayDuration + 500);
484484
} else {
485-
capsLockWarningElement.style.display = 'none';
485+
PWM_MAIN.addCssClass('capslockwarning','display-none');
486486
}
487487
} else {
488488
if (capsLockKeyDetected) {
489-
capsLockWarningElement.style.display = null;
489+
PWM_MAIN.removeCssClass('capslockwarning','display-none');
490490
fx.fadeIn(fadeInArgs).play();
491491
PWM_GLOBAL['lastCapsLockErrorTime'] = (new Date().getTime());
492492
setTimeout(function(){
493493
if ((new Date().getTime() - PWM_GLOBAL['lastCapsLockErrorTime'] > displayDuration)) {
494494
dojo.fadeOut(fadeOutArgs).play();
495495
setTimeout(function(){
496496
if ((new Date().getTime() - PWM_GLOBAL['lastCapsLockErrorTime'] > displayDuration)) {
497-
capsLockWarningElement.style.display = 'none';
497+
PWM_MAIN.addCssClass('capslockwarning','display-none');
498498
}
499499
},5 * 1000);
500500
}
@@ -1392,10 +1392,10 @@ PWM_MAIN.updateLoginContexts = function() {
13921392
var selectedProfile = ldapProfileElement.options[ldapProfileElement.selectedIndex].value;
13931393
var contextList = PWM_GLOBAL['ldapProfiles'][selectedProfile];
13941394
if (PWM_MAIN.JSLibrary.isEmpty(contextList)) {
1395-
PWM_MAIN.getObject('contextSelectorWrapper').style.display = 'none';
1395+
PWM_MAIN.addCssClass( 'contentSelectorWrapper', 'display-none' );
13961396
} else {
13971397
contextElement.innerHTML = '';
1398-
PWM_MAIN.getObject('contextSelectorWrapper').style.display = 'inherit';
1398+
PWM_MAIN.removeCssClass( 'contentSelectorWrapper', 'display-none' );
13991399
for (var iter in contextList) {
14001400
(function (key) {
14011401
var display = contextList[key];

0 commit comments

Comments
 (0)