cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [6/6] git commit: More build fixing
Date Thu, 11 Sep 2014 22:38:33 GMT
More build fixing


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

Branch: refs/heads/2.7.x-fixes
Commit: bbbe73ea4f924a360f5a47f2c2111df5f3d648ff
Parents: 65ca46e
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Thu Sep 11 23:38:17 2014 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu Sep 11 23:38:17 2014 +0100

----------------------------------------------------------------------
 .../saml/sso/SAMLResponseValidatorTest.java     | 62 --------------------
 .../jaxrs/security/oauth2/JAXRSOAuth2Test.java  |  1 +
 .../security/oauth2/SamlCallbackHandler2.java   | 30 +---------
 3 files changed, 3 insertions(+), 90 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/bbbe73ea/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java
b/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java
index 9b854b4..d3d9107 100644
--- a/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java
+++ b/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java
@@ -254,68 +254,6 @@ public class SAMLResponseValidatorTest extends org.junit.Assert {
             marshalledResponse, issuerCrypto, new KeystorePasswordCallback()
         );
     }
-<<<<<<< HEAD
-=======
-    
-    @org.junit.Test
-    public void testSignedResponseNoKeyInfo() throws Exception {
-        DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
-        docBuilderFactory.setNamespaceAware(true);
-        DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
-        Document doc = docBuilder.newDocument();
-        
-        Status status = 
-            SAML2PResponseComponentBuilder.createStatus(
-                SAMLProtocolResponseValidator.SAML2_STATUSCODE_SUCCESS, null
-            );
-        Response response = 
-            SAML2PResponseComponentBuilder.createSAMLResponse(
-                "http://cxf.apache.org/saml", "http://cxf.apache.org/issuer", status
-            );
-        
-        // Create an AuthenticationAssertion
-        SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
-        callbackHandler.setStatement(SAML2CallbackHandler.Statement.AUTHN);
-        callbackHandler.setIssuer("http://cxf.apache.org/issuer");
-        callbackHandler.setConfirmationMethod(SAML2Constants.CONF_SENDER_VOUCHES);
-        
-        SAMLCallback samlCallback = new SAMLCallback();
-        SAMLUtil.doSAMLCallback(callbackHandler, samlCallback);
-        SamlAssertionWrapper assertion = new SamlAssertionWrapper(samlCallback);
-        
-        Crypto issuerCrypto = new Merlin();
-        KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
-        ClassLoader loader = Loader.getClassLoader(SAMLResponseValidatorTest.class);
-        InputStream input = Merlin.loadInputStream(loader, "alice.jks");
-        keyStore.load(input, "password".toCharArray());
-        ((Merlin)issuerCrypto).setKeyStore(keyStore);
-        
-        response.getAssertions().add(assertion.getSaml2());
-        signResponse(response, "alice", "password", issuerCrypto, false);
-        
-        Element policyElement = OpenSAMLUtil.toDom(response, doc);
-        doc.appendChild(policyElement);
-        assertNotNull(policyElement);
-        
-        Response marshalledResponse = (Response)OpenSAMLUtil.fromDom(policyElement);
-        
-        // Validate the Response
-        SAMLProtocolResponseValidator validator = new SAMLProtocolResponseValidator();
-        validator.setKeyInfoMustBeAvailable(false);
-        try {
-            validator.validateSamlResponse(marshalledResponse, null, new KeystorePasswordCallback());
-            fail("Expected failure on no Signature Crypto");
-        } catch (WSSecurityException ex) {
-            // expected
-        }
-        
-        // Validate the Response
-        validator.validateSamlResponse(
-            marshalledResponse, issuerCrypto, new KeystorePasswordCallback()
-        );
-    }
->>>>>>> e7cf4fe... Fixing jax-rs SAML failures
-
     
     /**
      * Sign a SAML Response

http://git-wip-us.apache.org/repos/asf/cxf/blob/bbbe73ea/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
index e16b552..000985a 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/JAXRSOAuth2Test.java
@@ -138,6 +138,7 @@ public class JAXRSOAuth2Test extends AbstractBusClientServerTestBase {
                        "org.apache.cxf.systest.jaxrs.security.saml.KeystorePasswordCallback");
         properties.put("ws-security.saml-callback-handler", 
                        "org.apache.cxf.systest.jaxrs.security.oauth2.SamlCallbackHandler2");
+        properties.put("ws-security.self-sign-saml-assertion", "true");
         properties.put("ws-security.signature.username", "alice");
         properties.put("ws-security.signature.properties", CRYPTO_RESOURCE_PROPERTIES);
         bean.setProperties(properties);

http://git-wip-us.apache.org/repos/asf/cxf/blob/bbbe73ea/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/SamlCallbackHandler2.java
----------------------------------------------------------------------
diff --git a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/SamlCallbackHandler2.java
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/SamlCallbackHandler2.java
index 7ab3f69..92f6e08 100644
--- a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/SamlCallbackHandler2.java
+++ b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/oauth2/SamlCallbackHandler2.java
@@ -31,7 +31,7 @@ import javax.security.auth.callback.UnsupportedCallbackException;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.PhaseInterceptorChain;
-<<<<<<< HEAD
+
 import org.apache.cxf.rs.security.saml.assertion.Claim;
 import org.apache.ws.security.saml.ext.SAMLCallback;
 import org.apache.ws.security.saml.ext.bean.ActionBean;
@@ -43,23 +43,7 @@ import org.apache.ws.security.saml.ext.bean.AuthenticationStatementBean;
 import org.apache.ws.security.saml.ext.bean.ConditionsBean;
 import org.apache.ws.security.saml.ext.bean.SubjectBean;
 import org.apache.ws.security.saml.ext.builder.SAML2Constants;
-=======
-import org.apache.cxf.rt.security.claims.SAMLClaim;
-import org.apache.wss4j.common.crypto.Crypto;
-import org.apache.wss4j.common.crypto.CryptoFactory;
-import org.apache.wss4j.common.ext.WSSecurityException;
-import org.apache.wss4j.common.saml.SAMLCallback;
-import org.apache.wss4j.common.saml.bean.ActionBean;
-import org.apache.wss4j.common.saml.bean.AttributeBean;
-import org.apache.wss4j.common.saml.bean.AttributeStatementBean;
-import org.apache.wss4j.common.saml.bean.AudienceRestrictionBean;
-import org.apache.wss4j.common.saml.bean.AuthDecisionStatementBean;
-import org.apache.wss4j.common.saml.bean.AuthDecisionStatementBean.Decision;
-import org.apache.wss4j.common.saml.bean.AuthenticationStatementBean;
-import org.apache.wss4j.common.saml.bean.ConditionsBean;
-import org.apache.wss4j.common.saml.bean.SubjectBean;
-import org.apache.wss4j.common.saml.builder.SAML2Constants;
->>>>>>> e7cf4fe... Fixing jax-rs SAML failures
+
 import org.joda.time.DateTime;
 import org.opensaml.common.SAMLVersion;
 
@@ -151,16 +135,6 @@ public class SamlCallbackHandler2 implements CallbackHandler {
                 attrBean.setSamlAttributes(claims);
                 callback.setAttributeStatementData(Collections.singletonList(attrBean));
                 
-                try {
-                    Crypto crypto = 
-                        CryptoFactory.getInstance("org/apache/cxf/systest/jaxrs/security/alice.properties");
-                    callback.setIssuerCrypto(crypto);
-                    callback.setIssuerKeyName("alice");
-                    callback.setIssuerKeyPassword("password");
-                    callback.setSignAssertion(true);
-                } catch (WSSecurityException e) {
-                    throw new IOException(e);
-                }
             }
         }
     }


Mime
View raw message