cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf git commit: Improve STS logging a bit
Date Thu, 09 Apr 2015 15:35:35 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 380c20077 -> 3c1a37d7a


Improve STS logging a bit


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

Branch: refs/heads/master
Commit: 3c1a37d7a5de74feecb10b9c219d28a65ecf9953
Parents: 380c200
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Thu Apr 9 16:35:12 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu Apr 9 16:35:12 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/cxf/sts/operation/AbstractOperation.java | 8 ++++++++
 .../org/apache/cxf/sts/token/canceller/SCTCanceller.java     | 1 +
 .../cxf/sts/token/delegation/SAMLDelegationHandler.java      | 4 ++++
 .../org/apache/cxf/sts/token/provider/SAMLTokenProvider.java | 1 +
 .../java/org/apache/cxf/sts/token/provider/SCTProvider.java  | 1 +
 .../org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java   | 2 +-
 .../apache/cxf/sts/token/validator/SAMLTokenValidator.java   | 1 +
 .../org/apache/cxf/sts/token/validator/SCTValidator.java     | 1 +
 .../cxf/sts/token/validator/UsernameTokenValidator.java      | 1 +
 .../apache/cxf/sts/token/validator/X509TokenValidator.java   | 1 +
 10 files changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/3c1a37d7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
index 5837b71..6ed5ba7 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/AbstractOperation.java
@@ -601,6 +601,10 @@ public abstract class AbstractOperation {
         validatorParameters.setTokenRequirements(validateRequirements);
         validatorParameters.setToken(token);
 
+        if (tokenValidators.isEmpty()) {
+            LOG.fine("No token validators have been configured to validate the received token");
+        }
+        
         TokenValidatorResponse tokenResponse = null;
         for (TokenValidator tokenValidator : tokenValidators) {
             boolean canHandle = false;
@@ -624,6 +628,10 @@ public abstract class AbstractOperation {
                 break;
             }
         }
+        
+        if (tokenResponse == null) {
+            LOG.fine("No token validator has been configured to validate the received token");
+        }
         return tokenResponse;
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/3c1a37d7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java
index e8685db..8660d1a 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/canceller/SCTCanceller.java
@@ -115,6 +115,7 @@ public class SCTCanceller implements TokenCanceller {
                 }
                 tokenParameters.getTokenStore().remove(token.getId());
                 cancelTarget.setState(STATE.CANCELLED);
+                LOG.fine("SecurityContextToken successfully cancelled");
             } catch (WSSecurityException ex) {
                 LOG.log(Level.WARNING, "", ex);
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/3c1a37d7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/delegation/SAMLDelegationHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/delegation/SAMLDelegationHandler.java
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/delegation/SAMLDelegationHandler.java
index 5a59c91..c7ef7e7 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/delegation/SAMLDelegationHandler.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/delegation/SAMLDelegationHandler.java
@@ -67,11 +67,15 @@ public class SAMLDelegationHandler implements TokenDelegationHandler {
         response.setToken(delegateTarget);
         
         if (delegateTarget.getState() != STATE.VALID || !delegateTarget.isDOMElement()) {
+            LOG.fine("Delegation token is not valid");
             return response;
         }
         
         if (isDelegationAllowed(delegateTarget, tokenParameters.getAppliesToAddress())) {
+            LOG.fine("Delegation is allowed for principal " + tokenParameters.getPrincipal());
             response.setDelegationAllowed(true);
+        } else {
+            LOG.fine("Delegation is not allowed for principal " + tokenParameters.getPrincipal());
         }
         
         return response;

http://git-wip-us.apache.org/repos/asf/cxf/blob/3c1a37d7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
index 4a16a75..388f3a7 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SAMLTokenProvider.java
@@ -161,6 +161,7 @@ public class SAMLTokenProvider extends AbstractSAMLTokenProvider implements
Toke
             }
             response.setComputedKey(computedKey);
             
+            LOG.fine("SAML Token successfully created");
             return response;
         } catch (Exception e) {
             LOG.log(Level.WARNING, "", e);

http://git-wip-us.apache.org/repos/asf/cxf/blob/3c1a37d7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java
index 0d80a63..51780f0 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/provider/SCTProvider.java
@@ -185,6 +185,7 @@ public class SCTProvider implements TokenProvider {
             unAttachedReference.setWsseValueType(tokenRequirements.getTokenType());
             response.setUnattachedReference(unAttachedReference);
             
+            LOG.fine("SecurityContextToken successfully created");
             return response;
         } catch (Exception e) {
             LOG.log(Level.WARNING, "", e);

http://git-wip-us.apache.org/repos/asf/cxf/blob/3c1a37d7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
index 7325520..82d650a 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
@@ -228,8 +228,8 @@ public class SAMLTokenRenewer extends AbstractSAMLTokenProvider implements
Token
             response.setCreated(validFrom.toDate());
             response.setExpires(validTill.toDate());
 
+            LOG.fine("SAML Token successfully renewed");
             return response;
-            
         } catch (Exception ex) {
             LOG.log(Level.WARNING, "", ex);
             throw new STSException("Can't renew SAML assertion", ex, STSException.REQUEST_FAILED);

http://git-wip-us.apache.org/repos/asf/cxf/blob/3c1a37d7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
index 87562e4..8896c4a 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SAMLTokenValidator.java
@@ -262,6 +262,7 @@ public class SAMLTokenValidator implements TokenValidator {
             response.setPrincipal(principal);
             
             validateTarget.setState(STATE.VALID);
+            LOG.fine("SAML Token successfully validated");
         } catch (WSSecurityException ex) {
             LOG.log(Level.WARNING, "", ex);
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/3c1a37d7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java
index 605416a..fb7029c 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/SCTValidator.java
@@ -118,6 +118,7 @@ public class SCTValidator implements TokenValidator {
                     response.setTokenRealm(realm);
                 }
                 validateTarget.setState(STATE.VALID);
+                LOG.fine("SecurityContextToken successfully validated");
             } catch (WSSecurityException ex) {
                 LOG.log(Level.WARNING, "", ex);
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/3c1a37d7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java
index 04fc346..cc9907c 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/UsernameTokenValidator.java
@@ -235,6 +235,7 @@ public class UsernameTokenValidator implements TokenValidator {
             response.setPrincipal(principal);
             response.setTokenRealm(tokenRealm);
             validateTarget.setState(STATE.VALID);
+            LOG.fine("Username Token successfully validated");
         } catch (WSSecurityException ex) {
             LOG.log(Level.WARNING, "", ex);
         } catch (Base64DecodingException ex) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/3c1a37d7/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/X509TokenValidator.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/X509TokenValidator.java
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/X509TokenValidator.java
index d07b109..f9f1ee7 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/X509TokenValidator.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/validator/X509TokenValidator.java
@@ -186,6 +186,7 @@ public class X509TokenValidator implements TokenValidator {
             }
             response.setPrincipal(principal);
             validateTarget.setState(STATE.VALID);
+            LOG.fine("X.509 Token successfully validated");
         } catch (WSSecurityException ex) {
             LOG.log(Level.WARNING, "", ex);
         }


Mime
View raw message