Skip to content

Commit

Permalink
Sonar fix (#2954)
Browse files Browse the repository at this point in the history
  • Loading branch information
strehle committed Jul 19, 2024
1 parent 92044ec commit 0a28b5c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ public void debug(String message) {
}
}

public void debug(String message, Object... params) {
if (fallback.isDebugEnabled()) {
fallback.debug(LogSanitizerUtil.sanitize(message), params);
}
}

public void debug(String message, Throwable t) {
if (fallback.isDebugEnabled()) {
fallback.debug(LogSanitizerUtil.sanitize(message), t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.cloudfoundry.identity.uaa.client.UaaClientDetails;
import org.cloudfoundry.identity.uaa.constants.OriginKeys;
import org.cloudfoundry.identity.uaa.error.UaaException;
import org.cloudfoundry.identity.uaa.logging.SanitizedLogFactory;
import org.cloudfoundry.identity.uaa.provider.ClientAlreadyExistsException;
import org.cloudfoundry.identity.uaa.provider.IdentityProvider;
import org.cloudfoundry.identity.uaa.provider.IdentityProviderProvisioning;
Expand All @@ -14,8 +15,6 @@
import org.cloudfoundry.identity.uaa.scim.ScimGroup;
import org.cloudfoundry.identity.uaa.scim.ScimGroupProvisioning;
import org.cloudfoundry.identity.uaa.util.UaaStringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
Expand Down Expand Up @@ -64,7 +63,7 @@
@RequestMapping("/identity-zones")
public class IdentityZoneEndpoints implements ApplicationEventPublisherAware {

private static final Logger logger = LoggerFactory.getLogger(IdentityZoneEndpoints.class);
private static final SanitizedLogFactory.SanitizedLog logger = SanitizedLogFactory.getLog(IdentityZoneEndpoints.class);
private static final String ID_SUBDOMAIN_LOGGING = "[{}] subdomain [{}]";

private final IdentityZoneProvisioning zoneDao;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public void testSanitizeDebug() {
when(mockLog.isDebugEnabled()).thenReturn(true);
log.debug(dirtyMessage);
verify(mockLog).debug(sanitizedMsg);
log.debug(dirtyMessage, true);
verify(mockLog).debug(sanitizedMsg);
log.debug(dirtyMessage, ex);
verify(mockLog).debug(sanitizedMsg, ex);
}
Expand Down

0 comments on commit 0a28b5c

Please sign in to comment.