Skip to content

Commit

Permalink
fix spurious log messages in captcha and mbeans classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jrivard committed Aug 3, 2019
1 parent 21569ae commit db14079
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions server/src/main/java/password/pwm/PwmConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ public abstract class PwmConstants
"Your password must be scanned by the TSA to ensure the safety of your fellow travelers. Please take off your password's shoes to continue.",
"That password really tied the room together dude.",
"Bite my shiny metal password!",
"ben makes password software go woooo",

//nick helm
"I needed a password eight characters long so I picked Snow White and the Seven Dwarves.",
Expand Down
21 changes: 12 additions & 9 deletions server/src/main/java/password/pwm/util/CaptchaUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -338,16 +338,19 @@ private static boolean checkIfCaptchaParamPresent( final PwmRequest pwmRequest )
final String configValue = pwmRequest.getConfig().readSettingAsString( PwmSetting.CAPTCHA_SKIP_PARAM );
if ( !StringUtil.isEmpty( configValue ) )
{
final String skipCaptcha = pwmRequest.readParameterAsString( PwmConstants.PARAM_SKIP_CAPTCHA );
if ( StringUtil.nullSafeEquals( configValue, skipCaptcha ) )
final String requestValue = pwmRequest.readParameterAsString( PwmConstants.PARAM_SKIP_CAPTCHA );
if ( !StringUtil.isEmpty( requestValue ) )
{
LOGGER.trace( pwmRequest, () -> "valid skipCaptcha value in request, skipping captcha check for this session" );
pwmRequest.getPwmSession().getSessionStateBean().setCaptchaBypassedViaParameter( true );
return true;
}
else
{
LOGGER.error( pwmRequest, "skipCaptcha value is in request, however value '" + skipCaptcha + "' does not match configured value" );
if ( StringUtil.nullSafeEquals( configValue, requestValue ) )
{
LOGGER.trace( pwmRequest, () -> "valid skipCaptcha value in request, skipping captcha check for this session" );
pwmRequest.getPwmSession().getSessionStateBean().setCaptchaBypassedViaParameter( true );
return true;
}
else
{
LOGGER.error( pwmRequest, "skipCaptcha value is in request, however value '" + requestValue + "' does not match configured value" );
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions server/src/main/java/password/pwm/util/MBeanUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static void registerMBean( final PwmApplication pwmApplication )
}
catch ( Exception e )
{
LOGGER.error( "error registering mbean: " + e.getMessage() );
LOGGER.debug( () -> "error registering mbean: " + e.getMessage() );
}
}

Expand All @@ -77,7 +77,7 @@ public static void unregisterMBean( final PwmApplication pwmApplication )
}
catch ( Exception e )
{
LOGGER.error( "error unregistering mbean: " + e.getMessage() );
LOGGER.debug( () -> "error unregistering mbean: " + e.getMessage() );
}
}

Expand Down

0 comments on commit db14079

Please sign in to comment.