syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/2] syncope git commit: Fixed WSS4J version on master + added a few lambdas in the SAML SSO code
Date Tue, 01 Aug 2017 20:27:51 GMT
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 <coheigea@apache.org>
Authored: Tue Aug 1 17:27:20 2017 +0100
Committer: Colm O hEigeartaigh <coheigea@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>


Mime
View raw message