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 2016/01/20 23:18:32 UTC

[1/2] cxf-fediz git commit: Adding an IdP test

Repository: cxf-fediz
Updated Branches:
  refs/heads/1.2.x-fixes 4bea6a111 -> d514e7f41


Adding an IdP test


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

Branch: refs/heads/1.2.x-fixes
Commit: f3be2f7ded8e7a47633760870916c99e2192d8be
Parents: 4bea6a1
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed Jan 20 22:10:34 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Wed Jan 20 22:12:05 2016 +0000

----------------------------------------------------------------------
 .../apache/cxf/fediz/systests/idp/IdpTest.java  | 32 ++++++++++++++++++++
 1 file changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/f3be2f7d/systests/idp/src/test/java/org/apache/cxf/fediz/systests/idp/IdpTest.java
----------------------------------------------------------------------
diff --git a/systests/idp/src/test/java/org/apache/cxf/fediz/systests/idp/IdpTest.java b/systests/idp/src/test/java/org/apache/cxf/fediz/systests/idp/IdpTest.java
index 3a70ca9..38adc0d 100644
--- a/systests/idp/src/test/java/org/apache/cxf/fediz/systests/idp/IdpTest.java
+++ b/systests/idp/src/test/java/org/apache/cxf/fediz/systests/idp/IdpTest.java
@@ -456,4 +456,36 @@ public class IdpTest {
             Assert.assertEquals(ex.getStatusCode(), 400);
         }
     }
+    
+    // Send a bad wreply value
+    @org.junit.Test
+    public void testBadWReply() throws Exception {
+        String url = "https://localhost:" + getIdpHttpsPort() + "/fediz-idp/federation?";
+        url += "wa=wsignin1.0";
+        url += "&whr=urn:org:apache:cxf:fediz:idp:realm-A";
+        url += "&wtrealm=urn:org:apache:cxf:fediz:fedizhelloworld";
+        String wreply = "https://www.apache.org:" + getRpHttpsPort() + "/" 
+            + getServletContextName() + "/secure/fedservlet";
+        url += "&wreply=" + wreply;
+
+        String user = "alice";
+        String password = "ecila";
+
+        final WebClient webClient = new WebClient();
+        webClient.getOptions().setUseInsecureSSL(true);
+        webClient.getCredentialsProvider().setCredentials(
+            new AuthScope("localhost", Integer.parseInt(getIdpHttpsPort())),
+            new UsernamePasswordCredentials(user, password));
+
+        webClient.getOptions().setJavaScriptEnabled(false);
+        try {
+            webClient.getPage(url);
+            Assert.fail("Failure expected on a bad wreply value");
+        } catch (FailingHttpStatusCodeException ex) {
+            Assert.assertEquals(ex.getStatusCode(), 400);
+        }
+
+        webClient.close();
+    }
+    
 }


[2/2] cxf-fediz git commit: Fixing backmerge

Posted by co...@apache.org.
Fixing backmerge


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

Branch: refs/heads/1.2.x-fixes
Commit: d514e7f41372f141d22c76b7a7bdb5013017e52d
Parents: f3be2f7
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Wed Jan 20 22:18:23 2016 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Wed Jan 20 22:18:23 2016 +0000

----------------------------------------------------------------------
 .../src/test/java/org/apache/cxf/fediz/systests/idp/IdpTest.java   | 2 --
 systests/idp/src/test/resources/realma/entities-realma.xml         | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d514e7f4/systests/idp/src/test/java/org/apache/cxf/fediz/systests/idp/IdpTest.java
----------------------------------------------------------------------
diff --git a/systests/idp/src/test/java/org/apache/cxf/fediz/systests/idp/IdpTest.java b/systests/idp/src/test/java/org/apache/cxf/fediz/systests/idp/IdpTest.java
index 38adc0d..fa24e0c 100644
--- a/systests/idp/src/test/java/org/apache/cxf/fediz/systests/idp/IdpTest.java
+++ b/systests/idp/src/test/java/org/apache/cxf/fediz/systests/idp/IdpTest.java
@@ -484,8 +484,6 @@ public class IdpTest {
         } catch (FailingHttpStatusCodeException ex) {
             Assert.assertEquals(ex.getStatusCode(), 400);
         }
-
-        webClient.close();
     }
     
 }

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/d514e7f4/systests/idp/src/test/resources/realma/entities-realma.xml
----------------------------------------------------------------------
diff --git a/systests/idp/src/test/resources/realma/entities-realma.xml b/systests/idp/src/test/resources/realma/entities-realma.xml
index 88a3c67..4509f64 100644
--- a/systests/idp/src/test/resources/realma/entities-realma.xml
+++ b/systests/idp/src/test/resources/realma/entities-realma.xml
@@ -104,6 +104,7 @@
         <property name="role" value="ApplicationServiceType" />
         <property name="tokenType" value="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0" />
         <property name="lifeTime" value="3600" />
+        <property name="passiveRequestorEndpointConstraint" value="https://localhost:(\d)*/(\w)*helloworld(\w)*/secure/.*"/>
     </bean>
     
     <bean class="org.apache.cxf.fediz.service.idp.service.jpa.ApplicationClaimEntity">