You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by co...@apache.org on 2017/08/01 20:27:51 UTC
[1/2] syncope git commit: Fixed WSS4J version on master + added a few
lambdas in the SAML SSO code
Repository: syncope
Updated Branches:
refs/heads/master f533b2f73 -> 2f182750b
Fixed WSS4J version on master + added a few lambdas in the SAML SSO code
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/2f182750
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/2f182750
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/2f182750
Branch: refs/heads/master
Commit: 2f182750bdef9e260c4e267f95e816c76a7fbccc
Parents: 508c8cc
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue Aug 1 17:27:20 2017 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Aug 1 21:27:45 2017 +0100
----------------------------------------------------------------------
.../core/rest/cxf/service/SAML2SPServiceImpl.java | 10 +---------
.../java/org/apache/syncope/fit/core/SAML2ITCase.java | 14 ++++++--------
pom.xml | 2 +-
3 files changed, 8 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/2f182750/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2SPServiceImpl.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2SPServiceImpl.java b/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2SPServiceImpl.java
index 94d14f1..4ec2074 100644
--- a/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2SPServiceImpl.java
+++ b/ext/saml2sp/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SAML2SPServiceImpl.java
@@ -18,9 +18,6 @@
*/
package org.apache.syncope.core.rest.cxf.service;
-import java.io.IOException;
-import java.io.OutputStream;
-
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@@ -42,13 +39,8 @@ public class SAML2SPServiceImpl extends AbstractServiceImpl implements SAML2SPSe
@Override
public Response getMetadata(final String spEntityID, final String urlContext) {
- StreamingOutput sout = new StreamingOutput() {
+ StreamingOutput sout = (os) -> logic.getMetadata(StringUtils.appendIfMissing(spEntityID, "/"), urlContext, os);
- @Override
- public void write(final OutputStream os) throws IOException {
- logic.getMetadata(StringUtils.appendIfMissing(spEntityID, "/"), urlContext, os);
- }
- };
return Response.ok(sout).
type(MediaType.APPLICATION_XML).
build();
http://git-wip-us.apache.org/repos/asf/syncope/blob/2f182750/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SAML2ITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SAML2ITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SAML2ITCase.java
index 948c426..2df4530 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SAML2ITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SAML2ITCase.java
@@ -28,11 +28,11 @@ import static org.junit.Assert.fail;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
+import java.util.Optional;
+
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.collections4.IterableUtils;
-import org.apache.commons.collections4.Predicate;
import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.cxf.staxutils.StaxUtils;
import org.apache.syncope.client.lib.AnonymousAuthenticationHandler;
@@ -135,13 +135,11 @@ public class SAML2ITCase extends AbstractITCase {
public void setIdPMapping() {
Assume.assumeTrue(SAML2SPDetector.isSAML2SPAvailable());
- SAML2IdPTO ssoCircle = IterableUtils.find(saml2IdPService.list(), new Predicate<SAML2IdPTO>() {
+ Optional<SAML2IdPTO> ssoCircleOpt =
+ saml2IdPService.list().stream().filter(o -> "https://idp.ssocircle.com".equals(o.getEntityID())).findFirst();
+ assertTrue(ssoCircleOpt.isPresent());
- @Override
- public boolean evaluate(final SAML2IdPTO object) {
- return "https://idp.ssocircle.com".equals(object.getEntityID());
- }
- });
+ SAML2IdPTO ssoCircle = ssoCircleOpt.get();
assertNotNull(ssoCircle);
assertFalse(ssoCircle.getMappingItems().isEmpty());
assertNotNull(ssoCircle.getConnObjectKeyItem());
http://git-wip-us.apache.org/repos/asf/syncope/blob/2f182750/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index cbd9120..39bae7d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -608,7 +608,7 @@ under the License.
<dependency>
<groupId>org.apache.wss4j</groupId>
<artifactId>wss4j-ws-security-dom</artifactId>
- <version>2.1.10</version>
+ <version>2.2.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.jasypt</groupId>
[2/2] syncope git commit: Some trivial grammatical changes
Posted by co...@apache.org.
Some trivial grammatical changes
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/508c8cc8
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/508c8cc8
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/508c8cc8
Branch: refs/heads/master
Commit: 508c8cc823118d2015aa12f323de7bf5afd77019
Parents: f533b2f
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue Aug 1 17:27:04 2017 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Aug 1 21:27:45 2017 +0100
----------------------------------------------------------------------
.../main/java/org/apache/syncope/core/logic/AccessTokenLogic.java | 2 +-
.../src/main/java/org/apache/syncope/core/logic/SAML2IdPLogic.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/508c8cc8/core/logic/src/main/java/org/apache/syncope/core/logic/AccessTokenLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/AccessTokenLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/AccessTokenLogic.java
index c495392..e6b0099 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/AccessTokenLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/AccessTokenLogic.java
@@ -54,7 +54,7 @@ public class AccessTokenLogic extends AbstractTransactionalLogic<AccessTokenTO>
@PreAuthorize("isAuthenticated()")
public Pair<String, Date> login() {
if (anonymousUser.equals(AuthContextUtils.getUsername())) {
- throw new IllegalArgumentException(anonymousUser + " cannot be granted for an access token");
+ throw new IllegalArgumentException(anonymousUser + " cannot be granted an access token");
}
return binder.create(AuthContextUtils.getUsername(), Collections.<String, Object>emptyMap(), false);
http://git-wip-us.apache.org/repos/asf/syncope/blob/508c8cc8/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/SAML2IdPLogic.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/SAML2IdPLogic.java b/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/SAML2IdPLogic.java
index f86b633..b432c04 100644
--- a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/SAML2IdPLogic.java
+++ b/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/SAML2IdPLogic.java
@@ -165,7 +165,7 @@ public class SAML2IdPLogic extends AbstractSAML2Logic<SAML2IdPTO> {
} else if (idp.getSSOLocation(SAML2BindingType.REDIRECT) != null) {
idpTO.setBindingType(SAML2BindingType.REDIRECT);
} else {
- throw new IllegalArgumentException("Not POST nor REDIRECT artifacts supported by " + idp.getId());
+ throw new IllegalArgumentException("Neither POST nor REDIRECT artifacts supported by " + idp.getId());
}
result.add(idpTO);