You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2020/07/10 12:54:12 UTC
[cxf-fediz] branch master updated (349a7bf -> 06f6146)
This is an automated email from the ASF dual-hosted git repository.
buhhunyx pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/cxf-fediz.git.
from 349a7bf Update to hsqldb 2.5.1
new a237418 fediz-idp: avoid PMD ignore
new 3d11806 fediz-idp-core: cleanup FedizEntryPoint
new 06f6146 Update to maven-pmd-plugin 3.13.0
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
pom.xml | 3 +-
.../cxf/fediz/service/idp/FedizEntryPoint.java | 38 ++++++++--------------
.../idp/kerberos/KerberosServiceRequestToken.java | 5 +--
3 files changed, 15 insertions(+), 31 deletions(-)
[cxf-fediz] 03/03: Update to maven-pmd-plugin 3.13.0
Posted by bu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
buhhunyx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf-fediz.git
commit 06f614625c4946cf81b9454023e3f1281eb084d5
Author: Alexey Markevich <bu...@gmail.com>
AuthorDate: Fri Jul 10 15:53:01 2020 +0300
Update to maven-pmd-plugin 3.13.0
---
pom.xml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index ede24b5..2681c3c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -491,7 +491,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
- <version>3.12.0</version>
+ <version>3.13.0</version>
<dependencies>
<dependency>
<groupId>org.apache.cxf.build-utils</groupId>
@@ -504,7 +504,6 @@
<ruleset>${fediz.resources.base.path}cxf-pmd-ruleset.xml</ruleset>
<ruleset>${fediz.resources.base.path}cxf-pmd-custom.xml</ruleset>
</rulesets>
- <sourceEncoding>UTF-8</sourceEncoding>
<targetJdk>${jdk.version}</targetJdk>
<failOnViolation>true</failOnViolation>
<linkXRef>false</linkXRef>
[cxf-fediz] 01/03: fediz-idp: avoid PMD ignore
Posted by bu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
buhhunyx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf-fediz.git
commit a237418acbd296edd10358d926e3f0a2cb4c19fc
Author: Alexey Markevich <bu...@gmail.com>
AuthorDate: Fri Jul 10 15:49:52 2020 +0300
fediz-idp: avoid PMD ignore
---
.../cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java
index 824b175..d16320e 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/kerberos/KerberosServiceRequestToken.java
@@ -120,10 +120,7 @@ public class KerberosServiceRequestToken extends AbstractAuthenticationToken {
return false;
}
KerberosServiceRequestToken other = (KerberosServiceRequestToken) obj;
- if (!Arrays.equals(token, other.token)) { //NOPMD
- return false;
- }
- return true;
+ return Arrays.equals(token, other.token);
}
/* (non-Javadoc)
[cxf-fediz] 02/03: fediz-idp-core: cleanup FedizEntryPoint
Posted by bu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
buhhunyx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf-fediz.git
commit 3d11806473580b32cd8d2333689477c5076f05f6
Author: Alexey Markevich <bu...@gmail.com>
AuthorDate: Fri Jul 10 15:52:09 2020 +0300
fediz-idp-core: cleanup FedizEntryPoint
---
.../cxf/fediz/service/idp/FedizEntryPoint.java | 38 ++++++++--------------
1 file changed, 13 insertions(+), 25 deletions(-)
diff --git a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/FedizEntryPoint.java b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/FedizEntryPoint.java
index 06810de..9445ea3 100644
--- a/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/FedizEntryPoint.java
+++ b/services/idp-core/src/main/java/org/apache/cxf/fediz/service/idp/FedizEntryPoint.java
@@ -23,7 +23,7 @@ import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
-import java.util.Enumeration;
+import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -35,8 +35,6 @@ import org.apache.cxf.fediz.service.idp.service.ConfigService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.util.Assert;
@@ -49,11 +47,10 @@ import org.springframework.util.Assert;
*
*/
public class FedizEntryPoint implements AuthenticationEntryPoint,
- InitializingBean, ApplicationContextAware {
+ InitializingBean {
private static final Logger LOG = LoggerFactory.getLogger(FedizEntryPoint.class);
- private ApplicationContext appContext;
private ConfigService configService;
private String realm;
private Idp idpConfig;
@@ -75,7 +72,6 @@ public class FedizEntryPoint implements AuthenticationEntryPoint,
}
public void afterPropertiesSet() throws Exception {
- Assert.notNull(this.appContext, "ApplicationContext cannot be null.");
Assert.notNull(this.configService, "ConfigService cannot be null.");
Assert.notNull(this.realm, "realm cannot be null.");
}
@@ -99,18 +95,15 @@ public class FedizEntryPoint implements AuthenticationEntryPoint,
}
StringBuilder builder = new StringBuilder(extractFullContextPath(servletRequest))
- .append(loginUri).append("?");
+ .append(loginUri).append('?');
// Add the query parameters - URL encoding them for safety
- @SuppressWarnings("unchecked")
- Enumeration<String> names = servletRequest.getParameterNames();
- while (names.hasMoreElements()) {
- String name = names.nextElement();
- String[] values = servletRequest.getParameterValues(name);
+ for (Map.Entry<String, String[]> parameter : servletRequest.getParameterMap().entrySet()) {
+ String[] values = parameter.getValue();
if (values != null && values.length > 0) {
- builder.append(name).append('=');
- builder.append(URLEncoder.encode(values[0], "UTF-8"));
- builder.append('&');
+ builder.append(parameter.getKey()).append('=')
+ .append(URLEncoder.encode(values[0], "UTF-8"))
+ .append('&');
}
}
// Remove trailing ampersand
@@ -137,30 +130,25 @@ public class FedizEntryPoint implements AuthenticationEntryPoint,
}
- @Override
- public void setApplicationContext(ApplicationContext applicationContext) {
- this.appContext = applicationContext;
- }
-
protected String extractFullContextPath(HttpServletRequest request) throws MalformedURLException {
- String result = null;
+ String result;
String contextPath = request.getContextPath();
String requestUrl = request.getRequestURL().toString();
String requestPath = new URL(requestUrl).getPath();
// Cut request path of request url and add context path if not ROOT
- if (requestPath != null && requestPath.length() > 0) {
+ if (requestPath != null && !requestPath.isEmpty()) {
int lastIndex = requestUrl.lastIndexOf(requestPath);
result = requestUrl.substring(0, lastIndex);
} else {
result = requestUrl;
}
- if (contextPath != null && contextPath.length() > 0) {
+ if (contextPath != null && !contextPath.isEmpty()) {
// contextPath contains starting slash
- result = result + contextPath;
+ result += contextPath;
}
if (result.charAt(result.length() - 1) != '/') {
- result = result + "/";
+ result += '/';
}
return result;
}