You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2015/12/15 14:06:12 UTC
[1/2] cxf-fediz git commit: Fixing checkstyle issue
Repository: cxf-fediz
Updated Branches:
refs/heads/master 85eb8cc50 -> 6068e648c
Fixing checkstyle issue
Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/743930a0
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/743930a0
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/743930a0
Branch: refs/heads/master
Commit: 743930a0e62acadb426e6e1c9ba1d9db66b33c33
Parents: 85eb8cc
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue Dec 15 12:23:46 2015 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Dec 15 12:23:46 2015 +0000
----------------------------------------------------------------------
.../cxf/fediz/integrationtests/AbstractAttackTests.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/743930a0/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractAttackTests.java
----------------------------------------------------------------------
diff --git a/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractAttackTests.java b/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractAttackTests.java
index be8ca4d..7bec646 100644
--- a/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractAttackTests.java
+++ b/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractAttackTests.java
@@ -21,12 +21,6 @@ package org.apache.cxf.fediz.integrationtests;
import java.net.URLEncoder;
-import org.apache.http.auth.AuthScope;
-import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.wss4j.dom.engine.WSSConfig;
-import org.junit.Assert;
-import org.junit.Test;
-
import com.gargoylesoftware.htmlunit.CookieManager;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.WebClient;
@@ -36,6 +30,12 @@ import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.wss4j.dom.engine.WSSConfig;
+import org.junit.Assert;
+import org.junit.Test;
+
/**
* Some negative/attack tests for the IdP/RP
*/
[2/2] cxf-fediz git commit: Updating PMD
Posted by co...@apache.org.
Updating PMD
Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/6068e648
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/6068e648
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/6068e648
Branch: refs/heads/master
Commit: 6068e648cf5cf4416f179fff88f8b813809ae5d4
Parents: 743930a
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue Dec 15 13:04:09 2015 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Dec 15 13:04:09 2015 +0000
----------------------------------------------------------------------
.../apache/cxf/fediz/core/saml/SAMLTokenValidator.java | 12 +++---------
.../org/apache/cxf/fediz/core/util/CookieUtils.java | 6 +-----
.../org/apache/cxf/fediz/core/util/StringUtils.java | 5 +----
pom.xml | 7 +------
.../idp/kerberos/KerberosServiceRequestToken.java | 2 +-
.../jpa/ApplicationIdpProtocolSupportValidator.java | 6 +-----
.../service/jpa/TrustedIdpProtocolSupportValidator.java | 6 +-----
7 files changed, 9 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/6068e648/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 4e07e76..2344ecb 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
@@ -71,20 +71,14 @@ public class SAMLTokenValidator implements TokenValidator {
@Override
public boolean canHandleTokenType(String tokenType) {
- if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType) || WSConstants.SAML2_NS.equals(tokenType)
- || WSConstants.WSS_SAML_TOKEN_TYPE.equals(tokenType) || WSConstants.SAML_NS.equals(tokenType)) {
- return true;
- }
- return false;
+ return WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType) || WSConstants.SAML2_NS.equals(tokenType)
+ || WSConstants.WSS_SAML_TOKEN_TYPE.equals(tokenType) || WSConstants.SAML_NS.equals(tokenType);
}
@Override
public boolean canHandleToken(Element token) {
String ns = token.getNamespaceURI();
- if (WSConstants.SAML2_NS.equals(ns) || WSConstants.SAML_NS.equals(ns)) {
- return true;
- }
- return false;
+ return WSConstants.SAML2_NS.equals(ns) || WSConstants.SAML_NS.equals(ns);
}
public TokenValidatorResponse validateAndProcessToken(TokenValidatorRequest request,
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/6068e648/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CookieUtils.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CookieUtils.java b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CookieUtils.java
index d99a9c2..232514d 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CookieUtils.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/CookieUtils.java
@@ -80,11 +80,7 @@ public final class CookieUtils {
return true;
}
- if (detectExpiredTokens && expiresAt > 0 && currentTime.after(new Date(expiresAt))) {
- return true;
- }
-
- return false;
+ return detectExpiredTokens && expiresAt > 0 && currentTime.after(new Date(expiresAt));
}
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/6068e648/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/StringUtils.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/StringUtils.java b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/StringUtils.java
index 9ece30b..04f2112 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/StringUtils.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/util/StringUtils.java
@@ -89,10 +89,7 @@ public final class StringUtils {
if (list == null || list.size() == 0) {
return true;
}
- if (list.size() == 1 && isEmpty(list.get(0))) {
- return true;
- }
- return false;
+ return list.size() == 1 && isEmpty(list.get(0));
}
public static boolean isEqualUri(String uri1, String uri2) {
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/6068e648/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c47ceb8..8a86875 100644
--- a/pom.xml
+++ b/pom.xml
@@ -516,18 +516,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
- <version>3.1</version>
+ <version>3.5</version>
<dependencies>
<dependency>
<groupId>org.apache.cxf.build-utils</groupId>
<artifactId>cxf-buildtools</artifactId>
<version>${cxf.build-utils.version}</version>
</dependency>
- <dependency>
- <groupId>net.sourceforge.pmd</groupId>
- <artifactId>pmd</artifactId>
- <version>5.0.4</version>
- </dependency>
</dependencies>
<configuration>
<rulesets>
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/6068e648/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java
index ecee024..40308e4 100644
--- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java
+++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java
@@ -111,7 +111,7 @@ public class KerberosServiceRequestToken extends AbstractAuthenticationToken {
return false;
}
KerberosServiceRequestToken other = (KerberosServiceRequestToken) obj;
- if (!Arrays.equals(token, other.token)) {
+ if (!Arrays.equals(token, other.token)) { //NOPMD
return false;
}
return true;
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/6068e648/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java
index edeafe5..5a999e9 100644
--- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java
+++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ApplicationIdpProtocolSupportValidator.java
@@ -44,11 +44,7 @@ public class ApplicationIdpProtocolSupportValidator
public boolean isValid(String object, ConstraintValidatorContext constraintContext) {
List<String> protocols = applicationProtocolHandlers.getProtocols();
- if (protocols.contains(object)) {
- return true;
- }
-
- return false;
+ return protocols.contains(object);
}
@Override
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/6068e648/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java
index 98d4cd2..75ac2ec 100644
--- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java
+++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/TrustedIdpProtocolSupportValidator.java
@@ -44,11 +44,7 @@ public class TrustedIdpProtocolSupportValidator implements ConstraintValidator<T
public boolean isValid(String object, ConstraintValidatorContext constraintContext) {
List<String> protocols = trustedIdpProtocolHandlers.getProtocols();
- if (protocols.contains(object)) {
- return true;
- }
-
- return false;
+ return protocols.contains(object);
}
@Override