Author: anil.saldhana(a)jboss.com
Date: 2010-12-13 11:26:36 -0500 (Mon, 13 Dec 2010)
New Revision: 600
Removed:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/SAMLProtocolFactory.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/JAXBElementMappingUtil.java
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/SAML2ObjectUnitTestCase.java
Modified:
federation/trunk/picketlink-bindings-jboss/src/test/java/org/picketlink/test/identity/federation/bindings/jboss/auth/SAML20TokenProviderUnitTestCase.java
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostFormAuthenticator.java
federation/trunk/picketlink-bindings/src/test/java/org/picketlink/test/identity/federation/bindings/servlets/InteropEndpointDebugTestCase.java
federation/trunk/picketlink-bindings/src/test/java/org/picketlink/test/identity/federation/bindings/servlets/SOAPSAMLXACMLServletUnitTestCase.java
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/metadata/KeyDescriptorMetaDataBuilder.java
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/metadata/MetaDataBuilder.java
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/metadata/MetaDataExtractor.java
federation/trunk/picketlink-fed-api/src/test/java/org/picketlink/test/identity/federation/api/saml/v2/metadata/KeyDescriptorMetaDataBuilderUnitTestCase.java
federation/trunk/picketlink-fed-api/src/test/java/org/picketlink/test/identity/federation/api/saml/v2/metadata/MetaDataBuilderUnitTestCase.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/FileBasedEntitiesMetadataProvider.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/FileBasedEntityMetadataProvider.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/MetaDataBuilderDelegate.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/metadata/store/FileBasedMetadataConfigurationStore.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/metadata/store/IMetadataConfigurationStore.java
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/metadata/FileBasedMetadataConfigurationStoreUnitTestCase.java
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/util/SAMLXACMLUnitTestCase.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/RolesGenerationHandler.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AttributeHandler.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/process/ServiceProviderSAMLResponseProcessor.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/saml/CircleOfTrustServlet.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/saml/MetadataServlet.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/saml/SOAPSAMLXACMLServlet.java
federation/trunk/picketlink-webapps/seam-sp/src/main/java/org/picketlink/identity/seam/federation/Authenticator.java
Log:
use newer object model and comment out code to be fixed soon
Modified:
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostFormAuthenticator.java
===================================================================
---
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostFormAuthenticator.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/SPPostFormAuthenticator.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -47,8 +47,8 @@
import org.picketlink.identity.federation.core.saml.v2.holders.DestinationInfoHolder;
import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2Handler;
import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerResponse;
-import org.picketlink.identity.federation.core.saml.v2.util.DocumentUtil;
-import org.picketlink.identity.federation.saml.v2.protocol.ResponseType;
+import org.picketlink.identity.federation.core.saml.v2.util.DocumentUtil;
+import org.picketlink.identity.federation.newmodel.saml.v2.protocol.ResponseType;
import org.picketlink.identity.federation.web.constants.GeneralConstants;
import org.picketlink.identity.federation.web.core.HTTPContext;
import org.picketlink.identity.federation.web.process.ServiceProviderBaseProcessor;
Modified:
federation/trunk/picketlink-bindings/src/test/java/org/picketlink/test/identity/federation/bindings/servlets/InteropEndpointDebugTestCase.java
===================================================================
---
federation/trunk/picketlink-bindings/src/test/java/org/picketlink/test/identity/federation/bindings/servlets/InteropEndpointDebugTestCase.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-bindings/src/test/java/org/picketlink/test/identity/federation/bindings/servlets/InteropEndpointDebugTestCase.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -33,12 +33,12 @@
import org.picketlink.identity.federation.core.saml.v2.util.SOAPSAMLXACMLUtil;
import org.picketlink.identity.federation.core.util.JAXBUtil;
+import org.picketlink.identity.federation.newmodel.saml.v2.protocol.ResponseType;
import org.picketlink.identity.federation.org.xmlsoap.schemas.soap.envelope.Envelope;
import org.picketlink.identity.federation.org.xmlsoap.schemas.soap.envelope.Fault;
-import org.picketlink.identity.federation.saml.v2.assertion.AssertionType;
+//import org.picketlink.identity.federation.saml.v2.assertion.AssertionType;
import
org.picketlink.identity.federation.saml.v2.profiles.xacml.assertion.XACMLAuthzDecisionStatementType;
-import
org.picketlink.identity.federation.saml.v2.profiles.xacml.protocol.XACMLAuthzDecisionQueryType;
-import org.picketlink.identity.federation.saml.v2.protocol.ResponseType;
+import
org.picketlink.identity.federation.saml.v2.profiles.xacml.protocol.XACMLAuthzDecisionQueryType;
import org.jboss.security.xacml.core.model.context.DecisionType;
import org.jboss.security.xacml.core.model.context.RequestType;
import org.jboss.security.xacml.core.model.context.ResultType;
@@ -110,7 +110,9 @@
private void check(Envelope env, boolean permit)
{
- JAXBElement<?> samlResponse = (JAXBElement<?>)
env.getBody().getAny().get(0);
+ throw new RuntimeException();
+
+ /*JAXBElement<?> samlResponse = (JAXBElement<?>)
env.getBody().getAny().get(0);
Object response = samlResponse.getValue();
if(response instanceof Fault)
{
@@ -127,7 +129,7 @@
if(permit)
assertEquals(DecisionType.PERMIT, dt);
else
- assertEquals(DecisionType.DENY, dt);
+ assertEquals(DecisionType.DENY, dt);*/
}
private JAXBElement<?> getResponse(String fileName) throws Exception
Modified:
federation/trunk/picketlink-bindings/src/test/java/org/picketlink/test/identity/federation/bindings/servlets/SOAPSAMLXACMLServletUnitTestCase.java
===================================================================
---
federation/trunk/picketlink-bindings/src/test/java/org/picketlink/test/identity/federation/bindings/servlets/SOAPSAMLXACMLServletUnitTestCase.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-bindings/src/test/java/org/picketlink/test/identity/federation/bindings/servlets/SOAPSAMLXACMLServletUnitTestCase.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -39,9 +39,8 @@
import org.picketlink.identity.federation.core.util.JAXBUtil;
import org.picketlink.identity.federation.org.xmlsoap.schemas.soap.envelope.Envelope;
import org.picketlink.identity.federation.org.xmlsoap.schemas.soap.envelope.Fault;
-import org.picketlink.identity.federation.saml.v2.assertion.AssertionType;
-import
org.picketlink.identity.federation.saml.v2.profiles.xacml.assertion.XACMLAuthzDecisionStatementType;
-import org.picketlink.identity.federation.saml.v2.protocol.ResponseType;
+//import org.picketlink.identity.federation.saml.v2.assertion.AssertionType;
+import
org.picketlink.identity.federation.saml.v2.profiles.xacml.assertion.XACMLAuthzDecisionStatementType;
import org.jboss.security.xacml.core.model.context.DecisionType;
import org.jboss.security.xacml.core.model.context.ResultType;
import org.junit.Ignore;
@@ -99,7 +98,8 @@
@SuppressWarnings("unchecked")
private void validate(String requestFile, String value) throws Exception
{
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ throw new RuntimeException();
+ /*ByteArrayOutputStream baos = new ByteArrayOutputStream();
SOAPSAMLXACMLServlet servlet = new SOAPSAMLXACMLServlet();
servlet.init(new TestServletConfig(getServletContext()));
@@ -129,7 +129,7 @@
ResultType resultType = xacmlResponse.getResult().get(0);
DecisionType decision = resultType.getDecision();
assertNotNull("Decision is not null", decision);
- assertEquals(value, decision.value());
+ assertEquals(value, decision.value());*/
}
private ServletContext getServletContext()
Modified:
federation/trunk/picketlink-bindings-jboss/src/test/java/org/picketlink/test/identity/federation/bindings/jboss/auth/SAML20TokenProviderUnitTestCase.java
===================================================================
---
federation/trunk/picketlink-bindings-jboss/src/test/java/org/picketlink/test/identity/federation/bindings/jboss/auth/SAML20TokenProviderUnitTestCase.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-bindings-jboss/src/test/java/org/picketlink/test/identity/federation/bindings/jboss/auth/SAML20TokenProviderUnitTestCase.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -45,16 +45,17 @@
import org.picketlink.identity.federation.core.wstrust.WSTrustUtil;
import org.picketlink.identity.federation.core.wstrust.plugins.saml.SAML20TokenProvider;
import org.picketlink.identity.federation.core.wstrust.plugins.saml.SAMLUtil;
-import org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken;
-import org.picketlink.identity.federation.saml.v2.assertion.AssertionType;
-import org.picketlink.identity.federation.saml.v2.assertion.AttributeStatementType;
-import org.picketlink.identity.federation.saml.v2.assertion.AttributeType;
-import org.picketlink.identity.federation.saml.v2.assertion.AudienceRestrictionType;
-import org.picketlink.identity.federation.saml.v2.assertion.ConditionsType;
-import org.picketlink.identity.federation.saml.v2.assertion.NameIDType;
-import org.picketlink.identity.federation.saml.v2.assertion.StatementAbstractType;
-import org.picketlink.identity.federation.saml.v2.assertion.SubjectConfirmationType;
-import org.picketlink.identity.federation.saml.v2.assertion.SubjectType;
+import org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AssertionType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeStatementType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeStatementType.ASTChoiceType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.assertion.AudienceRestrictionType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.ConditionsType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.NameIDType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.assertion.StatementAbstractType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.assertion.SubjectConfirmationType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.SubjectType;
import org.w3c.dom.Element;
/**
@@ -132,12 +133,12 @@
assertNotNull("Unexpected null conditions", conditions);
assertNotNull("Unexpected null value for NotBefore attribute",
conditions.getNotBefore());
assertNotNull("Unexpected null value for NotOnOrAfter attribute",
conditions.getNotOnOrAfter());
- assertEquals("Unexpected number of conditions", 1,
conditions.getConditionOrAudienceRestrictionOrOneTimeUse()
+ assertEquals("Unexpected number of conditions", 1,
conditions.getConditions()
.size());
assertTrue("Unexpected condition type",
- conditions.getConditionOrAudienceRestrictionOrOneTimeUse().get(0) instanceof
AudienceRestrictionType);
+ conditions.getConditions().get(0) instanceof AudienceRestrictionType);
AudienceRestrictionType restrictionType = (AudienceRestrictionType) conditions
- .getConditionOrAudienceRestrictionOrOneTimeUse().get(0);
+ .getConditions().get(0);
assertNotNull("Unexpected null audience list",
restrictionType.getAudience());
assertEquals("Unexpected number of audience elements", 1,
restrictionType.getAudience().size());
assertEquals("Unexpected audience value",
"http://services.testcorp.org/provider2", restrictionType.getAudience()
@@ -146,22 +147,18 @@
// check the contents of the assertion subject.
SubjectType subject = assertion.getSubject();
assertNotNull("Unexpected null subject", subject);
- assertEquals("Unexpected subject content size", 2,
subject.getContent().size());
- JAXBElement<?> content = subject.getContent().get(0);
- assertEquals("Unexpected content type", NameIDType.class,
content.getDeclaredType());
- NameIDType nameID = (NameIDType) content.getValue();
+
+ NameIDType nameID = (NameIDType) subject.getSubType().getBaseID();
assertEquals("Unexpected name id qualifier",
"urn:picketlink:identity-federation", nameID.getNameQualifier());
assertEquals("Unexpected name id", "bmozaffa",
nameID.getValue());
- content = subject.getContent().get(1);
- assertEquals("Unexpected content type", SubjectConfirmationType.class,
content.getDeclaredType());
- SubjectConfirmationType confirmation = (SubjectConfirmationType)
content.getValue();
+ SubjectConfirmationType confirmation = (SubjectConfirmationType)
subject.getConfirmation().get(0);
assertEquals("Unexpected confirmation method", SAMLUtil.SAML2_BEARER_URI,
confirmation.getMethod());
- StatementAbstractType statementAbstractType =
assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().get(0);
+ StatementAbstractType statementAbstractType =
assertion.getStatements().iterator().next() ;
assertNotNull("Unexpected null StatementAbstractType",
statementAbstractType);
assertTrue("Unexpected type instead of AttributeStatement: " +
statementAbstractType.getClass().getSimpleName(), statementAbstractType instanceof
AttributeStatementType);
AttributeStatementType attributeStatement =
(AttributeStatementType)statementAbstractType;
- List<Object> attributes =
attributeStatement.getAttributeOrEncryptedAttribute();
+ List<ASTChoiceType> attributes = attributeStatement.getAttributes();
assertFalse("Unexpected empty list of attributes",
attributes.isEmpty());
assertEquals("Unexpected number of attributes", 1, attributes.size());
Object attributeObject = attributes.iterator().next();
Modified:
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/metadata/KeyDescriptorMetaDataBuilder.java
===================================================================
---
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/metadata/KeyDescriptorMetaDataBuilder.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/metadata/KeyDescriptorMetaDataBuilder.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -21,16 +21,15 @@
*/
package org.picketlink.identity.federation.api.saml.v2.metadata;
+import static org.picketlink.identity.federation.core.util.StringUtil.isNotNull;
+
import java.math.BigInteger;
-import org.picketlink.identity.federation.saml.v2.metadata.KeyDescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.KeyTypes;
-import org.picketlink.identity.federation.saml.v2.metadata.ObjectFactory;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.KeyDescriptorType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.KeyTypes;
import org.picketlink.identity.xmlsec.w3.xmldsig.KeyInfoType;
import org.picketlink.identity.xmlsec.w3.xmlenc.EncryptionMethodType;
-import static org.picketlink.identity.federation.core.util.StringUtil.isNotNull;
-
/**
* MetaDataBuilder for the KeyDescriptor
* @author Anil.Saldhana(a)redhat.com
@@ -53,7 +52,7 @@
throw new IllegalArgumentException("Only one of isSigningKey " +
"and isEncryptionKey should be true");
- KeyDescriptorType keyDescriptor = getObjectFactory().createKeyDescriptorType();
+ KeyDescriptorType keyDescriptor = new KeyDescriptorType();
if(isNotNull(algorithm))
{
@@ -74,13 +73,4 @@
return keyDescriptor;
}
-
- /**
- * Return the metadata object factory
- * @return
- */
- public static ObjectFactory getObjectFactory()
- {
- return MetaDataBuilder.getObjectFactory();
- }
}
\ No newline at end of file
Modified:
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/metadata/MetaDataBuilder.java
===================================================================
---
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/metadata/MetaDataBuilder.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/metadata/MetaDataBuilder.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -28,16 +28,11 @@
import javax.xml.bind.Unmarshaller;
import
org.picketlink.identity.federation.core.saml.md.providers.MetaDataBuilderDelegate;
-import org.picketlink.identity.federation.saml.v2.assertion.AttributeType;
-import org.picketlink.identity.federation.saml.v2.metadata.EndpointType;
-import org.picketlink.identity.federation.saml.v2.metadata.EntityDescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.IDPSSODescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.KeyDescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.ObjectFactory;
-import org.picketlink.identity.federation.saml.v2.metadata.OrganizationType;
-import org.picketlink.identity.federation.saml.v2.metadata.SPSSODescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.SSODescriptorType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.*;
+import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.IDPSSODescriptorType;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeType;
+
/**
* SAML2 Metadata Builder API
* @author Anil.Saldhana(a)redhat.com
@@ -121,34 +116,5 @@
{
return MetaDataBuilderDelegate.createSPSSODescriptor(requestsSigned,
keyDescriptorType,
sloEndPoint, attributes, org);
- }
-
- /**
- * Get the marshaller
- * @return
- * @throws JAXBException
- */
- public static Marshaller getMarshaller() throws JAXBException
- {
- return MetaDataBuilderDelegate.getMarshaller();
- }
-
- /**
- * Get the Unmarshaller
- * @return
- * @throws JAXBException
- */
- public static Unmarshaller getUnmarshaller() throws JAXBException
- {
- return MetaDataBuilderDelegate.getUnmarshaller();
- }
-
- /**
- * Get the ObjectFactory for method chaining
- * @return
- */
- public static ObjectFactory getObjectFactory()
- {
- return MetaDataBuilderDelegate.getObjectFactory();
- }
+ }
}
\ No newline at end of file
Modified:
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/metadata/MetaDataExtractor.java
===================================================================
---
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/metadata/MetaDataExtractor.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-api/src/main/java/org/picketlink/identity/federation/api/saml/v2/metadata/MetaDataExtractor.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -23,13 +23,14 @@
import java.util.List;
-import org.picketlink.identity.federation.saml.v2.metadata.EndpointType;
-import org.picketlink.identity.federation.saml.v2.metadata.EntityDescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.IDPSSODescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.IndexedEndpointType;
-import org.picketlink.identity.federation.saml.v2.metadata.RoleDescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.SPSSODescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.SSODescriptorType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EndpointType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.IDPSSODescriptorType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.IndexedEndpointType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.RoleDescriptorType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.SPSSODescriptorType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.SSODescriptorType;
+
/**
* Extract useful information out of metadata
@@ -49,7 +50,8 @@
public static String toString(EntityDescriptorType edt)
{
StringBuilder builder = new StringBuilder();
- List<RoleDescriptorType> rolesD =
edt.getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor();
+ throw new RuntimeException();
+ /* List<RoleDescriptorType> rolesD =
edt.getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor();
for(RoleDescriptorType rdt: rolesD)
{
@@ -68,7 +70,7 @@
}
}
- return builder.toString();
+ return builder.toString();*/
}
/**
Modified:
federation/trunk/picketlink-fed-api/src/test/java/org/picketlink/test/identity/federation/api/saml/v2/metadata/KeyDescriptorMetaDataBuilderUnitTestCase.java
===================================================================
---
federation/trunk/picketlink-fed-api/src/test/java/org/picketlink/test/identity/federation/api/saml/v2/metadata/KeyDescriptorMetaDataBuilderUnitTestCase.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-api/src/test/java/org/picketlink/test/identity/federation/api/saml/v2/metadata/KeyDescriptorMetaDataBuilderUnitTestCase.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -24,8 +24,8 @@
import static org.junit.Assert.assertNotNull;
import
org.picketlink.identity.federation.api.saml.v2.metadata.KeyDescriptorMetaDataBuilder;
-import org.picketlink.identity.federation.api.w3.xmldsig.KeyInfoBuilder;
-import org.picketlink.identity.federation.saml.v2.metadata.KeyDescriptorType;
+import org.picketlink.identity.federation.api.w3.xmldsig.KeyInfoBuilder;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.KeyDescriptorType;
import org.picketlink.identity.xmlsec.w3.xmldsig.KeyInfoType;
import org.junit.Test;
Modified:
federation/trunk/picketlink-fed-api/src/test/java/org/picketlink/test/identity/federation/api/saml/v2/metadata/MetaDataBuilderUnitTestCase.java
===================================================================
---
federation/trunk/picketlink-fed-api/src/test/java/org/picketlink/test/identity/federation/api/saml/v2/metadata/MetaDataBuilderUnitTestCase.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-api/src/test/java/org/picketlink/test/identity/federation/api/saml/v2/metadata/MetaDataBuilderUnitTestCase.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -31,13 +31,8 @@
import org.picketlink.identity.federation.api.saml.v2.metadata.MetaDataBuilder;
import org.picketlink.identity.federation.api.w3.xmldsig.KeyInfoBuilder;
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLURIConstants;
-import org.picketlink.identity.federation.saml.v2.assertion.AttributeType;
-import org.picketlink.identity.federation.saml.v2.metadata.EndpointType;
-import org.picketlink.identity.federation.saml.v2.metadata.EntityDescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.IDPSSODescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.KeyDescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.OrganizationType;
-import org.picketlink.identity.federation.saml.v2.metadata.SPSSODescriptorType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.*;
+//import org.picketlink.identity.federation.saml.v2.assertion.AttributeType;
import org.picketlink.identity.xmlsec.w3.xmldsig.KeyInfoType;
import org.junit.Test;
@@ -110,7 +105,8 @@
KeyDescriptorMetaDataBuilder.createKeyDescriptor(keyInfo,
algorithm, 0, true, false);
- List<AttributeType> attributes = new ArrayList<AttributeType>();
+ throw new RuntimeException();
+ /*List<AttributeType> attributes = new ArrayList<AttributeType>();
EndpointType sloEndPoint = MetaDataBuilder.createEndpoint(
JBossSAMLURIConstants.METADATA_HTTP_REDIRECT_BINDING.get(),
@@ -122,7 +118,7 @@
sloEndPoint,
attributes,
createJBossOrganization(lang));
- return sp;
+ return sp;*/
}
private OrganizationType createJBossOrganization(String language)
@@ -146,7 +142,9 @@
KeyDescriptorMetaDataBuilder.createKeyDescriptor(keyInfo,
algorithm, 0, true, false);
- List<AttributeType> attributes = new ArrayList<AttributeType>();
+ throw new RuntimeException();
+
+ /*List<AttributeType> attributes = new ArrayList<AttributeType>();
EndpointType ssoEndPoint = MetaDataBuilder.createEndpoint(
JBossSAMLURIConstants.METADATA_HTTP_REDIRECT_BINDING.get(),
@@ -163,7 +161,7 @@
ssoEndPoint,
sloEndPoint,
attributes,
- createJBossOrganization(lang));
+ createJBossOrganization(lang));*/
}
}
\ No newline at end of file
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/FileBasedEntitiesMetadataProvider.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/FileBasedEntitiesMetadataProvider.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/FileBasedEntitiesMetadataProvider.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -24,8 +24,8 @@
import java.io.InputStream;
import java.security.PublicKey;
-import org.picketlink.identity.federation.core.interfaces.IMetadataProvider;
-import org.picketlink.identity.federation.saml.v2.metadata.EntitiesDescriptorType;
+import org.picketlink.identity.federation.core.interfaces.IMetadataProvider;
+import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntitiesDescriptorType;
/**
* File based provider that handles multiple entities
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/FileBasedEntityMetadataProvider.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/FileBasedEntityMetadataProvider.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/FileBasedEntityMetadataProvider.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -27,8 +27,8 @@
import javax.xml.bind.JAXBElement;
-import org.picketlink.identity.federation.core.interfaces.IMetadataProvider;
-import org.picketlink.identity.federation.saml.v2.metadata.EntityDescriptorType;
+import org.picketlink.identity.federation.core.interfaces.IMetadataProvider;
+import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType;
/**
* A file based metadata provider that
@@ -70,11 +70,12 @@
try
{
+ new RuntimeException();/*
JAXBElement<EntityDescriptorType> j =
(JAXBElement<EntityDescriptorType>)
MetaDataBuilderDelegate.getUnmarshaller().unmarshal(metadataFileStream);
edt = j.getValue();
//TODO: use the signing and enc key data
- }
+*/ }
catch(Exception e)
{
throw new RuntimeException(e);
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/MetaDataBuilderDelegate.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/MetaDataBuilderDelegate.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/md/providers/MetaDataBuilderDelegate.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -21,25 +21,23 @@
*/
package org.picketlink.identity.federation.core.saml.md.providers;
+import java.util.ArrayList;
import java.util.List;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
-
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
-import org.picketlink.identity.federation.core.util.JAXBUtil;
-import org.picketlink.identity.federation.saml.v2.assertion.AttributeType;
-import org.picketlink.identity.federation.saml.v2.metadata.EndpointType;
-import org.picketlink.identity.federation.saml.v2.metadata.EntityDescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.IDPSSODescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.KeyDescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.LocalizedNameType;
-import org.picketlink.identity.federation.saml.v2.metadata.LocalizedURIType;
-import org.picketlink.identity.federation.saml.v2.metadata.ObjectFactory;
-import org.picketlink.identity.federation.saml.v2.metadata.OrganizationType;
-import org.picketlink.identity.federation.saml.v2.metadata.SPSSODescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.SSODescriptorType;
+import org.picketlink.identity.federation.core.util.NetworkUtil;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.EndpointType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType.EDTChoiceType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType.EDTDescriptorChoiceType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.IDPSSODescriptorType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.KeyDescriptorType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.LocalizedNameType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.LocalizedURIType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.OrganizationType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.SPSSODescriptorType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.SSODescriptorType;
/**
* SAML2 Metadata Builder API
@@ -47,10 +45,7 @@
* @since Apr 19, 2009
*/
public class MetaDataBuilderDelegate
-{
- private static ObjectFactory oFact = new ObjectFactory();
-
- private static String pkgName =
"org.picketlink.identity.federation.saml.v2.metadata";
+{
/**
* Create an Endpoint (SingleSignOnEndpoint or SingleLogoutEndpoint)
* @param binding
@@ -61,10 +56,9 @@
public static EndpointType createEndpoint(String binding, String location,
String responseLocation)
{
- EndpointType endpoint = oFact.createEndpointType();
- endpoint.setBinding(binding);
- endpoint.setLocation(location);
- endpoint.setResponseLocation(responseLocation);
+ EndpointType endpoint = new EndpointType( NetworkUtil.createURI(binding),
+ NetworkUtil.createURI(location));
+ endpoint.setResponseLocation( NetworkUtil.createURI( responseLocation ));
return endpoint;
}
@@ -89,24 +83,21 @@
lang = JBossSAMLConstants.LANG_EN.get();
//orgName
- LocalizedNameType orgName = oFact.createLocalizedNameType();
- orgName.setValue(organizationName);
- orgName.setLang(lang);
+ LocalizedNameType orgName = new LocalizedNameType( lang );
+ orgName.setValue(organizationName);
//orgDisplayName
- LocalizedNameType orgDisplayName = oFact.createLocalizedNameType();
- orgDisplayName.setValue(organizationDisplayName);
- orgDisplayName.setLang(lang);
+ LocalizedNameType orgDisplayName = new LocalizedNameType( lang );
+ orgDisplayName.setValue(organizationDisplayName);
//orgURL
- LocalizedURIType orgURL = oFact.createLocalizedURIType();
- orgURL.setValue(organizationURL);
- orgURL.setLang(lang);
+ LocalizedURIType orgURL = new LocalizedURIType( lang );
+ orgURL.setValue( NetworkUtil.createURI( organizationURL ));
- OrganizationType orgType = oFact.createOrganizationType();
- orgType.getOrganizationName().add(orgName);
- orgType.getOrganizationDisplayName().add(orgDisplayName);
- orgType.getOrganizationURL().add(orgURL);
+ OrganizationType orgType = new OrganizationType();
+ orgType.addOrganizationName( orgName );
+ orgType.addOrganizationDisplayName( orgDisplayName );
+ orgType.addOrganizationURL( orgURL );
return orgType;
}
@@ -115,10 +106,17 @@
* @param idpOrSPDescriptor a descriptor for either the IDP or SSO
* @return
*/
- public static EntityDescriptorType createEntityDescriptor(SSODescriptorType
idpOrSPDescriptor)
+ public static EntityDescriptorType createEntityDescriptor( SSODescriptorType
idpOrSPDescriptor)
{
- EntityDescriptorType entity = oFact.createEntityDescriptorType();
-
entity.getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor().add(idpOrSPDescriptor);
+ EDTDescriptorChoiceType edtDescriptorChoiceType = new EDTDescriptorChoiceType(
idpOrSPDescriptor );
+
+ List<EDTDescriptorChoiceType> edtList = new
ArrayList<EntityDescriptorType.EDTDescriptorChoiceType>();
+ edtList.add(edtDescriptorChoiceType);
+
+ EDTChoiceType choiceType = new EDTChoiceType(edtList);
+
+ EntityDescriptorType entity = new EntityDescriptorType();
+ entity.setChoiceType(choiceType);
return entity;
}
@@ -139,11 +137,15 @@
List<AttributeType> attributes,
OrganizationType org)
{
- IDPSSODescriptorType idp = oFact.createIDPSSODescriptorType();
- idp.getSingleSignOnService().add(ssoEndPoint);
- idp.getSingleLogoutService().add(sloEndPoint);
- idp.getAttribute().addAll(attributes);
- idp.getKeyDescriptor().add(keyDescriptorType);
+ IDPSSODescriptorType idp = new IDPSSODescriptorType();
+ idp.addSingleSignOnService( ssoEndPoint );
+ idp.addSingleLogoutService( sloEndPoint );
+
+ for( AttributeType attr: attributes )
+ {
+ idp.addAttribute(attr);
+ }
+ idp.addKeyDescriptor( keyDescriptorType);
idp.setWantAuthnRequestsSigned(requestsSigned);
idp.setOrganization(org);
return idp;
@@ -165,40 +167,11 @@
List<AttributeType> attributes,
OrganizationType org)
{
- SPSSODescriptorType sp = oFact.createSPSSODescriptorType();
- sp.getSingleLogoutService().add(sloEndPoint);
- sp.getKeyDescriptor().add(keyDescriptorType);
+ SPSSODescriptorType sp = new SPSSODescriptorType();
+ sp.addSingleLogoutService( sloEndPoint );
+ sp.addKeyDescriptor( keyDescriptorType );
sp.setAuthnRequestsSigned(requestsSigned);
sp.setOrganization(org);
return sp;
}
-
- /**
- * Get the marshaller
- * @return
- * @throws JAXBException
- */
- public static Marshaller getMarshaller() throws JAXBException
- {
- return JAXBUtil.getMarshaller(pkgName);
- }
-
- /**
- * Get the Unmarshaller
- * @return
- * @throws JAXBException
- */
- public static Unmarshaller getUnmarshaller() throws JAXBException
- {
- return JAXBUtil.getUnmarshaller(pkgName);
- }
-
- /**
- * Get the ObjectFactory for method chaining
- * @return
- */
- public static ObjectFactory getObjectFactory()
- {
- return oFact;
- }
}
\ No newline at end of file
Deleted:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/SAMLProtocolFactory.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/SAMLProtocolFactory.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/factories/SAMLProtocolFactory.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.picketlink.identity.federation.core.saml.v2.factories;
-
-import org.picketlink.identity.federation.saml.v2.protocol.ObjectFactory;
-
-/**
- * Provides an handle to the ObjectFactory
- * for creating SAML Protocol objects
- * @author Anil.Saldhana(a)redhat.com
- * @since Jan 28, 2009
- */
-public class SAMLProtocolFactory
-{
- private static ObjectFactory factory = new ObjectFactory();
-
- public static ObjectFactory getObjectFactory()
- {
- return factory;
- }
-}
\ No newline at end of file
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/metadata/store/FileBasedMetadataConfigurationStore.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/metadata/store/FileBasedMetadataConfigurationStore.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/metadata/store/FileBasedMetadataConfigurationStore.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -42,12 +42,8 @@
import org.apache.log4j.Logger;
import org.picketlink.identity.federation.core.constants.PicketLinkFederationConstants;
-import org.picketlink.identity.federation.core.util.JAXBUtil;
-import org.picketlink.identity.federation.saml.v2.metadata.EntityDescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.IDPSSODescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.ObjectFactory;
-import org.picketlink.identity.federation.saml.v2.metadata.RoleDescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.SPSSODescriptorType;
+import org.picketlink.identity.federation.core.util.JAXBUtil;
+import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType;
/**
* File based metadata store that uses
@@ -196,7 +192,7 @@
*/
public void persist(EntityDescriptorType entity, String id) throws IOException
{
- boolean isIDP = false;
+ /*boolean isIDP = false;
boolean isSP = false;
File persistedFile = validateIdAndReturnMDFile(id);
@@ -242,8 +238,9 @@
else if( isIDP )
{
addIdentityProvider( id);
- }
-
+ }*/
+
+ throw new RuntimeException();
}
/**
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/metadata/store/IMetadataConfigurationStore.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/metadata/store/IMetadataConfigurationStore.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/metadata/store/IMetadataConfigurationStore.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -25,7 +25,7 @@
import java.util.Map;
import java.util.Set;
-import org.picketlink.identity.federation.saml.v2.metadata.EntityDescriptorType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType;
/**
* Configuration Store for the metadata
Deleted:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/JAXBElementMappingUtil.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/JAXBElementMappingUtil.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/JAXBElementMappingUtil.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -1,150 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.picketlink.identity.federation.core.saml.v2.util;
-
-import javax.xml.bind.JAXBElement;
-
-import org.picketlink.identity.federation.core.factories.SOAPFactory;
-import org.picketlink.identity.federation.core.saml.v2.factories.SAMLAssertionFactory;
-import org.picketlink.identity.federation.core.saml.v2.factories.SAMLProtocolFactory;
-import org.picketlink.identity.federation.core.saml.v2.factories.XACMLStatementFactory;
-import org.picketlink.identity.federation.org.xmlsoap.schemas.soap.envelope.Envelope;
-import org.picketlink.identity.federation.saml.v2.assertion.EncryptedElementType;
-import
org.picketlink.identity.federation.saml.v2.profiles.xacml.assertion.XACMLAuthzDecisionStatementType;
-import org.picketlink.identity.federation.saml.v2.protocol.ArtifactResolveType;
-import org.picketlink.identity.federation.saml.v2.protocol.ArtifactResponseType;
-import org.picketlink.identity.federation.saml.v2.protocol.AssertionIDRequestType;
-import org.picketlink.identity.federation.saml.v2.protocol.AuthnRequestType;
-import org.picketlink.identity.federation.saml.v2.protocol.LogoutRequestType;
-import org.picketlink.identity.federation.saml.v2.protocol.ManageNameIDRequestType;
-import org.picketlink.identity.federation.saml.v2.protocol.NameIDMappingRequestType;
-import org.picketlink.identity.federation.saml.v2.protocol.NameIDMappingResponseType;
-import org.picketlink.identity.federation.saml.v2.protocol.RequestAbstractType;
-import org.picketlink.identity.federation.saml.v2.protocol.ResponseType;
-import org.picketlink.identity.federation.saml.v2.protocol.StatusResponseType;
-
-/**
- * Maps various saml/xacml types to their corresponding JAXBElement
- * @author Anil.Saldhana(a)redhat.com
- * @since Jan 22, 2009
- */
-public class JAXBElementMappingUtil
-{
- /**
- * Get the JAXBElement for the request type
- * @param requestAbstractType
- * @return
- */
- public static JAXBElement<?> get(RequestAbstractType requestAbstractType)
- {
- if(requestAbstractType instanceof AuthnRequestType)
- {
- AuthnRequestType art = (AuthnRequestType) requestAbstractType;
- return SAMLProtocolFactory.getObjectFactory().createAuthnRequest(art);
- }
-
- if(requestAbstractType instanceof LogoutRequestType)
- {
- LogoutRequestType lrt = (LogoutRequestType) requestAbstractType;
- return SAMLProtocolFactory.getObjectFactory().createLogoutRequest(lrt);
- }
- if(requestAbstractType instanceof AssertionIDRequestType)
- {
- AssertionIDRequestType airt = (AssertionIDRequestType) requestAbstractType;
- return SAMLProtocolFactory.getObjectFactory().createAssertionIDRequest(airt);
- }
- if(requestAbstractType instanceof NameIDMappingRequestType)
- {
- NameIDMappingRequestType airt = (NameIDMappingRequestType) requestAbstractType;
- return SAMLProtocolFactory.getObjectFactory().createNameIDMappingRequest(airt);
- }
- if(requestAbstractType instanceof ArtifactResolveType)
- {
- ArtifactResolveType airt = (ArtifactResolveType) requestAbstractType;
- return SAMLProtocolFactory.getObjectFactory().createArtifactResolve(airt);
- }
- if(requestAbstractType instanceof ManageNameIDRequestType)
- {
- ManageNameIDRequestType airt = (ManageNameIDRequestType) requestAbstractType;
- return SAMLProtocolFactory.getObjectFactory().createManageNameIDRequest(airt);
- }
- throw new IllegalArgumentException("Unknown Type:"+requestAbstractType);
- }
-
- /**
- * Get the JAXBElement for an encrypted assertion
- * @param encryptedAssertion
- * @return
- */
- public static JAXBElement<?> get(EncryptedElementType encryptedAssertion)
- {
- throw new RuntimeException( "NYI" );
- //return
SAMLAssertionFactory.getObjectFactory().createEncryptedAssertion(encryptedAssertion);
- }
-
- /**
- * Get the JAXBElement for response
- * @param responseType
- * @return
- */
- public static JAXBElement<?> get(StatusResponseType statusResponseType)
- {
- if(statusResponseType instanceof ResponseType)
- {
- ResponseType responseType = (ResponseType) statusResponseType;
- return SAMLProtocolFactory.getObjectFactory().createResponse(responseType);
- }
- else if(statusResponseType instanceof NameIDMappingResponseType)
- {
- NameIDMappingResponseType nameIDResponseType = (NameIDMappingResponseType)
statusResponseType;
- return
SAMLProtocolFactory.getObjectFactory().createNameIDMappingResponse(nameIDResponseType);
- }
- else if(statusResponseType instanceof StatusResponseType)
- {
- StatusResponseType srt = (StatusResponseType) statusResponseType;
- return SAMLProtocolFactory.getObjectFactory().createLogoutResponse(srt);
- }
-
- ArtifactResponseType artifactResponse = (ArtifactResponseType) statusResponseType;
- return
SAMLProtocolFactory.getObjectFactory().createArtifactResponse(artifactResponse);
- }
-
- /**
- * Get the JAXBElement for a SOAP envelope
- * @param envelope
- * @return
- */
- public static JAXBElement<?> get(Envelope envelope)
- {
- return SOAPFactory.getObjectFactory().createEnvelope(envelope);
- }
-
- /**
- * Get the JAXBElement for an XACML authorization statement
- * @param xacmlStatement
- * @return
- */
- public static JAXBElement<?> get(XACMLAuthzDecisionStatementType
xacmlStatement)
- {
- return
XACMLStatementFactory.getObjectFactory().createXACMLAuthzDecisionStatement(xacmlStatement);
- }
-}
\ No newline at end of file
Deleted:
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/SAML2ObjectUnitTestCase.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/SAML2ObjectUnitTestCase.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/SAML2ObjectUnitTestCase.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.picketlink.test.identity.federation.core.saml.v2;
-
-import org.picketlink.identity.federation.saml.v2.SAML2Object;
-import org.picketlink.identity.federation.saml.v2.protocol.AuthnRequestType;
-import org.picketlink.identity.federation.saml.v2.protocol.LogoutRequestType;
-import org.picketlink.identity.federation.saml.v2.protocol.ObjectFactory;
-import org.picketlink.identity.federation.saml.v2.protocol.StatusResponseType;
-
-import junit.framework.TestCase;
-
-/**
- * Unit test the SAML2Object interface
- * @author Anil.Saldhana(a)redhat.com
- * @since Sep 17, 2009
- */
-public class SAML2ObjectUnitTestCase extends TestCase
-{
- public void testSAML2Object()
- {
- ObjectFactory factory = new ObjectFactory();
-
- //Request Types
- LogoutRequestType lo = factory.createLogoutRequestType();
- assertTrue("LogOutRequest is SAML2Object?", lo instanceof SAML2Object);
-
- AuthnRequestType ar = factory.createAuthnRequestType();
- assertTrue("AuthnRequest is SAML2Object?", ar instanceof SAML2Object);
-
- //Response Types
- StatusResponseType status = factory.createStatusResponseType();
- assertTrue("StatusResponseType is SAML2Object?", status instanceof
SAML2Object);
- }
-}
\ No newline at end of file
Modified:
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/metadata/FileBasedMetadataConfigurationStoreUnitTestCase.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/metadata/FileBasedMetadataConfigurationStoreUnitTestCase.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/saml/v2/metadata/FileBasedMetadataConfigurationStoreUnitTestCase.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -31,8 +31,7 @@
import junit.framework.TestCase;
import
org.picketlink.identity.federation.core.saml.v2.metadata.store.FileBasedMetadataConfigurationStore;
-import org.picketlink.identity.federation.core.util.JAXBUtil;
-import org.picketlink.identity.federation.saml.v2.metadata.EntityDescriptorType;
+import org.picketlink.identity.federation.core.util.JAXBUtil;
/**
@@ -48,7 +47,8 @@
@SuppressWarnings("unchecked")
public void testStore() throws Exception
{
- ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+ throw new RuntimeException();
+ /* ClassLoader tcl = Thread.currentThread().getContextClassLoader();
InputStream is =
tcl.getResourceAsStream("saml2/metadata/idp-entitydescriptor.xml");
assertNotNull("Inputstream not null", is);
@@ -73,7 +73,7 @@
catch(Exception t)
{
//pass
- }
+ }*/
}
public void testTrustedProviders() throws Exception
Modified:
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/util/SAMLXACMLUnitTestCase.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/util/SAMLXACMLUnitTestCase.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/util/SAMLXACMLUnitTestCase.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -29,8 +29,7 @@
import junit.framework.TestCase;
-import
org.picketlink.identity.federation.saml.v2.profiles.xacml.protocol.XACMLAuthzDecisionQueryType;
-import org.picketlink.identity.federation.saml.v2.protocol.RequestAbstractType;
+import
org.picketlink.identity.federation.saml.v2.profiles.xacml.protocol.XACMLAuthzDecisionQueryType;
import org.jboss.security.xacml.core.model.context.RequestType;
/**
@@ -46,7 +45,8 @@
*/
public void testSAML_XACML_Read() throws Exception
{
- String resourceName = "saml-xacml/saml-xacml-request.xml";
+ throw new RuntimeException();
+ /*String resourceName = "saml-xacml/saml-xacml-request.xml";
String samlPath = "org.picketlink.identity.federation.saml.v2.protocol";
String xacmlPath = "org.jboss.security.xacml.core.model.context";
String xsAssert =
"org.picketlink.identity.federation.saml.v2.profiles.xacml.assertion";
@@ -68,7 +68,7 @@
XACMLAuthzDecisionQueryType xadqt = (XACMLAuthzDecisionQueryType) req;
RequestType requestType = xadqt.getRequest();
- assertNotNull(requestType);
+ assertNotNull(requestType);*/
}
@SuppressWarnings("unchecked")
@@ -77,7 +77,9 @@
*/
public void testSAML_XACML_Read_2() throws Exception
{
- String resourceName = "saml-xacml/saml-xacml-request-2.xml";
+ throw new RuntimeException();
+
+ /*String resourceName = "saml-xacml/saml-xacml-request-2.xml";
String samlPath = "org.picketlink.identity.federation.saml.v2.protocol";
String xacmlPath = "org.jboss.security.xacml.core.model.context";
String xsAssert =
"org.picketlink.identity.federation.saml.v2.profiles.xacml.assertion";
@@ -99,6 +101,6 @@
XACMLAuthzDecisionQueryType xadqt = (XACMLAuthzDecisionQueryType) req;
RequestType requestType = xadqt.getRequest();
- assertNotNull(requestType);
+ assertNotNull(requestType);*/
}
}
\ No newline at end of file
Modified:
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/RolesGenerationHandler.java
===================================================================
---
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/RolesGenerationHandler.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/RolesGenerationHandler.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -35,8 +35,8 @@
import
org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerChainConfig;
import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerConfig;
import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerRequest;
-import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerResponse;
-import org.picketlink.identity.federation.saml.v2.protocol.LogoutRequestType;
+import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerResponse;
+import org.picketlink.identity.federation.newmodel.saml.v2.protocol.LogoutRequestType;
import org.picketlink.identity.federation.web.constants.GeneralConstants;
import org.picketlink.identity.federation.web.core.HTTPContext;
Modified:
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AttributeHandler.java
===================================================================
---
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AttributeHandler.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/handlers/saml2/SAML2AttributeHandler.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -38,8 +38,8 @@
import
org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerChainConfig;
import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerConfig;
import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerRequest;
-import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerResponse;
-import org.picketlink.identity.federation.saml.v2.protocol.LogoutRequestType;
+import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerResponse;
+import org.picketlink.identity.federation.newmodel.saml.v2.protocol.LogoutRequestType;
import org.picketlink.identity.federation.web.constants.GeneralConstants;
import org.picketlink.identity.federation.web.core.HTTPContext;
Modified:
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/process/ServiceProviderSAMLResponseProcessor.java
===================================================================
---
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/process/ServiceProviderSAMLResponseProcessor.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/process/ServiceProviderSAMLResponseProcessor.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -48,8 +48,8 @@
import org.picketlink.identity.federation.core.saml.v2.interfaces.SAML2HandlerResponse;
import org.picketlink.identity.federation.core.util.CoreConfigUtil;
import org.picketlink.identity.federation.core.util.XMLSignatureUtil;
-import org.picketlink.identity.federation.saml.v2.SAML2Object;
-import org.picketlink.identity.federation.saml.v2.protocol.ResponseType;
+import org.picketlink.identity.federation.newmodel.saml.v2.protocol.ResponseType;
+import org.picketlink.identity.federation.saml.v2.SAML2Object;
import org.picketlink.identity.federation.web.constants.GeneralConstants;
import org.picketlink.identity.federation.web.core.HTTPContext;
import org.picketlink.identity.federation.web.util.PostBindingUtil;
Modified:
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/saml/CircleOfTrustServlet.java
===================================================================
---
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/saml/CircleOfTrustServlet.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/saml/CircleOfTrustServlet.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -40,8 +40,8 @@
import org.picketlink.identity.federation.api.saml.v2.metadata.MetaDataBuilder;
import
org.picketlink.identity.federation.core.saml.v2.metadata.store.FileBasedMetadataConfigurationStore;
-import
org.picketlink.identity.federation.core.saml.v2.metadata.store.IMetadataConfigurationStore;
-import org.picketlink.identity.federation.saml.v2.metadata.EntityDescriptorType;
+import
org.picketlink.identity.federation.core.saml.v2.metadata.store.IMetadataConfigurationStore;
+import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType;
import static org.picketlink.identity.federation.core.util.StringUtil.isNotNull;
@@ -218,7 +218,9 @@
private EntityDescriptorType getMetaData(String metadataURL) throws JAXBException,
IOException
{
- InputStream is;
+ throw new RuntimeException();
+
+ /*InputStream is;
URL md = new URL(metadataURL);
HttpURLConnection http = (HttpURLConnection) md.openConnection();
http.setInstanceFollowRedirects(true);
@@ -230,7 +232,7 @@
if(obj instanceof EntityDescriptorType == false)
throw new RuntimeException("Unsupported type:"+ obj.getClass());
EntityDescriptorType edt = (EntityDescriptorType) obj;
- return edt;
+ return edt;*/
}
private void displayTrustedProvidersForIDP(HttpServletRequest request,
HttpServletResponse response)
Modified:
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/saml/MetadataServlet.java
===================================================================
---
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/saml/MetadataServlet.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/saml/MetadataServlet.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -21,6 +21,8 @@
*/
package org.picketlink.identity.federation.web.servlets.saml;
+import static org.picketlink.identity.federation.core.util.StringUtil.isNotNull;
+
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -35,12 +37,10 @@
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javax.xml.bind.JAXBElement;
import org.apache.log4j.Logger;
import
org.picketlink.identity.federation.api.saml.v2.metadata.KeyDescriptorMetaDataBuilder;
-import org.picketlink.identity.federation.api.saml.v2.metadata.MetaDataBuilder;
-import org.picketlink.identity.federation.api.util.KeyUtil;
+import org.picketlink.identity.federation.api.util.KeyUtil;
import org.picketlink.identity.federation.core.config.AuthPropertyType;
import org.picketlink.identity.federation.core.config.KeyProviderType;
import org.picketlink.identity.federation.core.config.KeyValueType;
@@ -51,16 +51,14 @@
import org.picketlink.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
import org.picketlink.identity.federation.core.util.CoreConfigUtil;
import org.picketlink.identity.federation.core.util.XMLEncryptionUtil;
-import org.picketlink.identity.federation.saml.v2.metadata.EntityDescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.KeyDescriptorType;
-import org.picketlink.identity.federation.saml.v2.metadata.RoleDescriptorType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType;
+import
org.picketlink.identity.federation.newmodel.saml.v2.metadata.EntityDescriptorType.EDTDescriptorChoiceType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.KeyDescriptorType;
+import org.picketlink.identity.federation.newmodel.saml.v2.metadata.RoleDescriptorType;
import org.picketlink.identity.federation.web.constants.GeneralConstants;
import org.picketlink.identity.federation.web.util.ConfigurationUtil;
import org.picketlink.identity.xmlsec.w3.xmldsig.KeyInfoType;
-
-import static org.picketlink.identity.federation.core.util.StringUtil.isNotNull;
-
/**
* Metadata servlet for the IDP/SP
* @author Anil.Saldhana(a)redhat.com
@@ -181,6 +179,7 @@
{
resp.setContentType(JBossSAMLConstants.METADATA_MIME.get());
OutputStream os = resp.getOutputStream();
+ throw new RuntimeException();/*
JAXBElement<?> jaxbEl =
MetaDataBuilder.getObjectFactory().createEntityDescriptor(metadata);
try
{
@@ -189,17 +188,18 @@
catch (Exception e)
{
throw new RuntimeException(e);
- }
+ }*/
}
private void updateKeyDescriptor(EntityDescriptorType entityD, KeyDescriptorType
keyD)
{
- List<RoleDescriptorType> objs =
entityD.getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor();
+ List<EDTDescriptorChoiceType> objs =
entityD.getChoiceType().getDescriptors();
if(objs != null)
{
- for(RoleDescriptorType roleD: objs)
+ for(EDTDescriptorChoiceType roleD: objs)
{
- roleD.getKeyDescriptor().add(keyD);
+ RoleDescriptorType roleDescriptor = roleD.getRoleDescriptor();
+ roleDescriptor.addKeyDescriptor( keyD );
}
}
}
Modified:
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/saml/SOAPSAMLXACMLServlet.java
===================================================================
---
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/saml/SOAPSAMLXACMLServlet.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/servlets/saml/SOAPSAMLXACMLServlet.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -46,8 +46,7 @@
import org.picketlink.identity.federation.core.saml.v2.common.IDGenerator;
import org.picketlink.identity.federation.core.saml.v2.factories.SAMLAssertionFactory;
import org.picketlink.identity.federation.core.saml.v2.holders.IssuerInfoHolder;
-import org.picketlink.identity.federation.core.saml.v2.util.DocumentUtil;
-import org.picketlink.identity.federation.core.saml.v2.util.JAXBElementMappingUtil;
+import org.picketlink.identity.federation.core.saml.v2.util.DocumentUtil;
import org.picketlink.identity.federation.core.saml.v2.util.SOAPSAMLXACMLUtil;
import org.picketlink.identity.federation.core.saml.v2.util.XMLTimeUtil;
import org.picketlink.identity.federation.core.util.JAXBUtil;
Modified:
federation/trunk/picketlink-webapps/seam-sp/src/main/java/org/picketlink/identity/seam/federation/Authenticator.java
===================================================================
---
federation/trunk/picketlink-webapps/seam-sp/src/main/java/org/picketlink/identity/seam/federation/Authenticator.java 2010-12-13
16:23:19 UTC (rev 599)
+++
federation/trunk/picketlink-webapps/seam-sp/src/main/java/org/picketlink/identity/seam/federation/Authenticator.java 2010-12-13
16:26:36 UTC (rev 600)
@@ -25,8 +25,8 @@
import java.util.List;
import org.jboss.seam.annotations.Name;
-import org.jboss.seam.security.Identity;
-import org.picketlink.identity.federation.saml.v2.assertion.AttributeType;
+import org.jboss.seam.security.Identity;
+import org.picketlink.identity.federation.newmodel.saml.v2.assertion.AttributeType;
/**
* @author Marcel Kolsteren
@@ -46,6 +46,7 @@
}
else
{
+ throw new RuntimeException();/*
for (AttributeType attribute : samlPrincipal.getAttributes())
{
if (attribute.getName().equals("role"))
@@ -56,9 +57,9 @@
roles.add((String) value.get(0));
}
}
- }
+ }*/
- return true;
+ //return true;
}
}
else