cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf-fediz git commit: Some logging fixes
Date Thu, 02 Mar 2017 11:18:12 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master 5ebe79ea6 -> fac4db415


Some logging fixes


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/fac4db41
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/fac4db41
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/fac4db41

Branch: refs/heads/master
Commit: fac4db41540001785cfb551cf41a3427ee47ded0
Parents: 5ebe79e
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Thu Mar 2 11:18:02 2017 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu Mar 2 11:18:02 2017 +0000

----------------------------------------------------------------------
 .../core/saml/FedizSignatureTrustValidator.java     | 10 ++++------
 .../cxf/fediz/core/saml/SAMLTokenValidator.java     |  4 +---
 .../cxf/plugin/FedizRedirectBindingFilter.java      | 16 +++++-----------
 .../was/mapper/FileBasedRoleToGroupMapper.java      |  4 +---
 .../fediz/service/idp/beans/STSClientAction.java    |  4 +---
 .../idp/kerberos/KerberosTokenValidator.java        | 12 ++++--------
 .../protocols/TrustedIdpSAMLProtocolHandler.java    |  9 ++-------
 .../protocols/TrustedIdpWSFedProtocolHandler.java   |  5 +----
 8 files changed, 19 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/fac4db41/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/FedizSignatureTrustValidator.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/FedizSignatureTrustValidator.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/FedizSignatureTrustValidator.java
index c27f34b..8cc61e3 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/FedizSignatureTrustValidator.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/FedizSignatureTrustValidator.java
@@ -180,12 +180,10 @@ public class FedizSignatureTrustValidator implements Validator {
         // certificate was really signed by the issuer stated in the certificate
         //
         crypto.verifyTrust(certificates, enableRevocation, null);
-        if (LOG.isDebugEnabled()) {
-            String subjectString = certificates[0].getSubjectX500Principal().getName();
-            LOG.debug(
-                "Certificate path has been verified for certificate with subject " + subjectString
-            );
-        }
+        String subjectString = certificates[0].getSubjectX500Principal().getName();
+        LOG.debug(
+            "Certificate path has been verified for certificate with subject {}", subjectString
+        );
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/fac4db41/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java
index a629d8a..7d2bc88 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java
@@ -328,9 +328,7 @@ public class SAMLTokenValidator implements TokenValidator {
             List<org.opensaml.saml.saml2.core.Attribute> attributes = statement
                     .getAttributes();
             for (org.opensaml.saml.saml2.core.Attribute attribute : attributes) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("parsing attribute: " + attribute.getName());
-                }
+                LOG.debug("parsing attribute: {}", attribute.getName());
                 Claim c = new Claim();
                 // Workaround for CXF-4484
                 // Value of Attribute Name not fully qualified

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/fac4db41/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/FedizRedirectBindingFilter.java
----------------------------------------------------------------------
diff --git a/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/FedizRedirectBindingFilter.java
b/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/FedizRedirectBindingFilter.java
index 948ce8e..3e4db0e 100644
--- a/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/FedizRedirectBindingFilter.java
+++ b/plugins/cxf/src/main/java/org/apache/cxf/fediz/cxf/plugin/FedizRedirectBindingFilter.java
@@ -126,16 +126,12 @@ public class FedizRedirectBindingFilter extends AbstractServiceProviderFilter
         String state = getState(fedConfig, params);
 
         if (responseToken == null) {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("SignIn request must contain a response token from the IdP");
-            }
+            LOG.debug("SignIn request must contain a response token from the IdP");
             throw ExceptionUtils.toBadRequestException(null, null);
         } else {
             // processSignInRequest
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Process SignIn request");
-                LOG.debug("token=\n" + responseToken);
-            }
+            LOG.debug("Process SignIn request");
+            LOG.debug("token=\n{}", responseToken);
 
             FedizResponse wfRes =
                 validateSignInRequest(fedConfig, params, responseToken, state);
@@ -394,10 +390,8 @@ public class FedizRedirectBindingFilter extends AbstractServiceProviderFilter
         }*/
 
         if (signoutCleanup) {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("SignOutCleanup request found");
-                LOG.debug("SignOutCleanup action...");
-            }
+            LOG.debug("SignOutCleanup request found");
+            LOG.debug("SignOutCleanup action...");
             cleanupContext(m);
 
             HttpServletResponse response = messageContext.getHttpServletResponse();

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/fac4db41/plugins/websphere/src/main/java/org/apache/cxf/fediz/was/mapper/FileBasedRoleToGroupMapper.java
----------------------------------------------------------------------
diff --git a/plugins/websphere/src/main/java/org/apache/cxf/fediz/was/mapper/FileBasedRoleToGroupMapper.java
b/plugins/websphere/src/main/java/org/apache/cxf/fediz/was/mapper/FileBasedRoleToGroupMapper.java
index 21edde5..cd47699 100644
--- a/plugins/websphere/src/main/java/org/apache/cxf/fediz/was/mapper/FileBasedRoleToGroupMapper.java
+++ b/plugins/websphere/src/main/java/org/apache/cxf/fediz/was/mapper/FileBasedRoleToGroupMapper.java
@@ -176,9 +176,7 @@ public class FileBasedRoleToGroupMapper implements RoleToGroupMapper {
             Iterator<SamlToJ2EE> i = localmappings.getSamlToJ2EE().iterator();
             while (i.hasNext()) {
                 SamlToJ2EE mapping = i.next();
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("{} mapped to {} entries", mapping.getClaim(), mapping.getGroups().getJ2EeGroup().size());
-                }
+                LOG.debug("{} mapped to {} entries", mapping.getClaim(), mapping.getGroups().getJ2EeGroup().size());
                 map.put(mapping.getClaim(), mapping.getGroups().getJ2EeGroup());
             }
         }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/fac4db41/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
index 88e2e69..e0d324e 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/beans/STSClientAction.java
@@ -441,9 +441,7 @@ public class STSClientAction {
         } else {
             sts.setTtl(this.ttl);
             sts.setEnableLifetime(this.ttl > 0);
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Lifetime set to {} seconds for realm {}", this.ttl, wtrealm);
-            }
+            LOG.debug("Lifetime set to {} seconds for realm {}", this.ttl, wtrealm);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/fac4db41/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosTokenValidator.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosTokenValidator.java
b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosTokenValidator.java
index 6b25ac4..c318ef2 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosTokenValidator.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosTokenValidator.java
@@ -101,8 +101,8 @@ public class KerberosTokenValidator {
             try {
                 String jaasAuth = System.getProperty("java.security.auth.login.config");
                 String krbConf = System.getProperty("java.security.krb5.conf");
-                LOG.debug("KerberosTokenValidator - Using JAAS auth login file: " + jaasAuth);
-                LOG.debug("KerberosTokenValidator - Using KRB conf file: " + krbConf);
+                LOG.debug("KerberosTokenValidator - Using JAAS auth login file: {}", jaasAuth);
+                LOG.debug("KerberosTokenValidator - Using KRB conf file: {}", krbConf);
             } catch (SecurityException ex) {
                 LOG.debug(ex.getMessage(), ex);
             }
@@ -116,9 +116,7 @@ public class KerberosTokenValidator {
             loginContext = new LoginContext(getContextName());
         }
         loginContext.login();
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Successfully authenticated to the TGT");
-        }
+        LOG.debug("Successfully authenticated to the TGT");
 
         // Get the service name to use - fall back on the principal
         Subject subject = loginContext.getSubject();
@@ -138,9 +136,7 @@ public class KerberosTokenValidator {
                                                isUsernameServiceNameForm(), spnego);
         KerberosServiceContext krbServiceCtx = Subject.doAs(subject, action);
 
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Successfully validated a ticket");
-        }
+        LOG.debug("Successfully validated a ticket");
 
         return krbServiceCtx;
     }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/fac4db41/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpSAMLProtocolHandler.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpSAMLProtocolHandler.java
b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpSAMLProtocolHandler.java
index b256c3e..390ba96 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpSAMLProtocolHandler.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpSAMLProtocolHandler.java
@@ -205,10 +205,7 @@ public class TrustedIdpSAMLProtocolHandler extends AbstractTrustedIdpProtocolHan
                      id, validatorResponse.getResponseId(), whr);
             LOG.debug("Created date={}", validatorResponse.getCreated());
             LOG.debug("Expired date={}", validatorResponse.getSessionNotOnOrAfter());
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Validated: "
-                    + System.getProperty("line.separator") + validatorResponse.getAssertion());
-            }
+            LOG.debug("Validated: {}{}", System.getProperty("line.separator"), validatorResponse.getAssertion());
             return idpToken;
         } catch (BadRequestException ex) {
             throw ex;
@@ -221,9 +218,7 @@ public class TrustedIdpSAMLProtocolHandler extends AbstractTrustedIdpProtocolHan
     private String encodeAuthnRequest(Element authnRequest) throws IOException {
         String requestMessage = DOM2Writer.nodeToString(authnRequest);
 
-        if (LOG.isDebugEnabled()) {
-            LOG.debug(requestMessage);
-        }
+        LOG.debug(requestMessage);
 
         DeflateEncoderDecoder encoder = new DeflateEncoderDecoder();
         byte[] deflatedBytes = encoder.deflateToken(requestMessage.getBytes("UTF-8"));

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/fac4db41/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpWSFedProtocolHandler.java
----------------------------------------------------------------------
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpWSFedProtocolHandler.java
b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpWSFedProtocolHandler.java
index a3f5615..e531285 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpWSFedProtocolHandler.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/protocols/TrustedIdpWSFedProtocolHandler.java
@@ -154,10 +154,7 @@ public class TrustedIdpWSFedProtocolHandler extends AbstractTrustedIdpProtocolHa
                      id, wfResp.getUsername(), wfResp.getUniqueTokenId(), whr, wfResp.getIssuer());
             LOG.debug("Created date={}", wfResp.getTokenCreated());
             LOG.debug("Expired date={}", wfResp.getTokenExpires());
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Validated 'wresult' : "
-                    + System.getProperty("line.separator") + wresult);
-            }
+            LOG.debug("Validated 'wresult' : {}{}", System.getProperty("line.separator"),
wresult);
             return idpToken;
         } catch (IllegalStateException ex) {
             throw ex;


Mime
View raw message