Author: anil.saldhana(a)jboss.com
Date: 2009-04-22 21:59:52 -0400 (Wed, 22 Apr 2009)
New Revision: 452
Added:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/MetadataProviderType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/AbstractMetadataProvider.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/FileBasedEntitiesMetadataProvider.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/FileBasedEntityMetadataProvider.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/IMetadataProvider.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/SecurityActions.java
identity-federation/trunk/jboss-identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/config/MetadataConfigUnitTestCase.java
identity-federation/trunk/jboss-identity-bindings/src/test/resources/config/test-metadata-config-1.xml
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthPropertyType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncAlgoType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncryptionType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDPType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProviderType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValueType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ObjectFactory.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ProviderType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SPType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/STSType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ServiceProviderType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ServiceProvidersType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TokenProviderType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TokenProvidersType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TrustType.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/package-info.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SOAPSAMLXACMLServlet.java
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SecurityActions.java
identity-federation/trunk/jboss-identity-bindings/src/main/resources/schema/config/jboss-identity-fed.xsd
identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/metadata/MetaDataBuilder.java
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/constants/JBossSAMLConstants.java
Log:
JBID-42: samlv2 metadata
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthPropertyType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthPropertyType.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthPropertyType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncAlgoType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncAlgoType.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncAlgoType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncryptionType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncryptionType.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/EncryptionType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDPType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDPType.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDPType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProviderType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProviderType.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProviderType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValueType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValueType.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValueType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
Added:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/MetadataProviderType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/MetadataProviderType.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/MetadataProviderType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -0,0 +1,104 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
+// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.04.22 at 01:16:08 PM CDT
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for MetadataProviderType complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within
this class.
+ *
+ * <pre>
+ * <complexType name="MetadataProviderType">
+ * <complexContent>
+ * <restriction
base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Option"
type="{urn:jboss:identity-federation:config:1.0}KeyValueType"
maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="ClassName"
type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "MetadataProviderType", propOrder = {
+ "option"
+})
+public class MetadataProviderType {
+
+ @XmlElement(name = "Option")
+ protected List<KeyValueType> option;
+ @XmlAttribute(name = "ClassName")
+ protected String className;
+
+ /**
+ * Gets the value of the option property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the option
property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getOption().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link KeyValueType }
+ *
+ *
+ */
+ public List<KeyValueType> getOption() {
+ if (option == null) {
+ option = new ArrayList<KeyValueType>();
+ }
+ return this.option;
+ }
+
+ /**
+ * Gets the value of the className property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getClassName() {
+ return className;
+ }
+
+ /**
+ * Sets the value of the className property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setClassName(String value) {
+ this.className = value;
+ }
+
+}
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ObjectFactory.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ObjectFactory.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ObjectFactory.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
@@ -17,7 +17,7 @@
/**
* This object contains factory methods for each
* Java content interface and Java element interface
- * generated in the jboss.identity_federation.config._1 package.
+ * generated in the org.jboss.identity.federation.bindings.config package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
@@ -31,47 +31,47 @@
@XmlRegistry
public class ObjectFactory {
+ private final static QName _JBossSTS_QNAME = new
QName("urn:jboss:identity-federation:config:1.0", "JBossSTS");
private final static QName _JBossIDP_QNAME = new
QName("urn:jboss:identity-federation:config:1.0", "JBossIDP");
- private final static QName _JBossSTS_QNAME = new
QName("urn:jboss:identity-federation:config:1.0", "JBossSTS");
private final static QName _JBossSP_QNAME = new
QName("urn:jboss:identity-federation:config:1.0", "JBossSP");
/**
- * Create a new ObjectFactory that can be used to create new instances of schema
derived classes for package: jboss.identity_federation.config._1
+ * Create a new ObjectFactory that can be used to create new instances of schema
derived classes for package: org.jboss.identity.federation.bindings.config
*
*/
public ObjectFactory() {
}
/**
- * Create an instance of {@link ServiceProviderType }
+ * Create an instance of {@link STSType }
*
*/
- public ServiceProviderType createServiceProviderType() {
- return new ServiceProviderType();
+ public STSType createSTSType() {
+ return new STSType();
}
/**
- * Create an instance of {@link STSType }
+ * Create an instance of {@link KeyValueType }
*
*/
- public STSType createSTSType() {
- return new STSType();
+ public KeyValueType createKeyValueType() {
+ return new KeyValueType();
}
/**
- * Create an instance of {@link SPType }
+ * Create an instance of {@link ServiceProviderType }
*
*/
- public SPType createSPType() {
- return new SPType();
+ public ServiceProviderType createServiceProviderType() {
+ return new ServiceProviderType();
}
/**
- * Create an instance of {@link TrustType }
+ * Create an instance of {@link KeyProviderType }
*
*/
- public TrustType createTrustType() {
- return new TrustType();
+ public KeyProviderType createKeyProviderType() {
+ return new KeyProviderType();
}
/**
@@ -83,76 +83,75 @@
}
/**
- * Create an instance of {@link ProviderType }
+ * Create an instance of {@link TokenProviderType }
*
*/
- public ProviderType createProviderType() {
- return new ProviderType();
+ public TokenProviderType createTokenProviderType() {
+ return new TokenProviderType();
}
/**
- * Create an instance of {@link AuthPropertyType }
+ * Create an instance of {@link IDPType }
*
*/
- public AuthPropertyType createAuthPropertyType() {
- return new AuthPropertyType();
+ public IDPType createIDPType() {
+ return new IDPType();
}
/**
- * Create an instance of {@link TokenProviderType }
+ * Create an instance of {@link ServiceProvidersType }
*
*/
- public TokenProviderType createTokenProviderType() {
- return new TokenProviderType();
+ public ServiceProvidersType createServiceProvidersType() {
+ return new ServiceProvidersType();
}
/**
- * Create an instance of {@link IDPType }
+ * Create an instance of {@link MetadataProviderType }
*
*/
- public IDPType createIDPType() {
- return new IDPType();
+ public MetadataProviderType createMetadataProviderType() {
+ return new MetadataProviderType();
}
/**
- * Create an instance of {@link EncryptionType }
+ * Create an instance of {@link ProviderType }
*
*/
- public EncryptionType createEncryptionType() {
- return new EncryptionType();
+ public ProviderType createProviderType() {
+ return new ProviderType();
}
/**
- * Create an instance of {@link ServiceProvidersType }
+ * Create an instance of {@link AuthPropertyType }
*
*/
- public ServiceProvidersType createServiceProvidersType() {
- return new ServiceProvidersType();
+ public AuthPropertyType createAuthPropertyType() {
+ return new AuthPropertyType();
}
/**
- * Create an instance of {@link KeyValueType }
+ * Create an instance of {@link TrustType }
*
*/
- public KeyValueType createKeyValueType() {
- return new KeyValueType();
+ public TrustType createTrustType() {
+ return new TrustType();
}
/**
- * Create an instance of {@link KeyProviderType }
+ * Create an instance of {@link SPType }
*
*/
- public KeyProviderType createKeyProviderType() {
- return new KeyProviderType();
+ public SPType createSPType() {
+ return new SPType();
}
/**
- * Create an instance of {@link JAXBElement }{@code <}{@link IDPType }{@code
>}}
+ * Create an instance of {@link EncryptionType }
*
*/
- @XmlElementDecl(namespace = "urn:jboss:identity-federation:config:1.0",
name = "JBossIDP")
- public JAXBElement<IDPType> createJBossIDP(IDPType value) {
- return new JAXBElement<IDPType>(_JBossIDP_QNAME, IDPType.class, null,
value);
+ public EncryptionType createEncryptionType() {
+ return new EncryptionType();
}
/**
@@ -165,6 +164,15 @@
}
/**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IDPType }{@code
>}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:jboss:identity-federation:config:1.0",
name = "JBossIDP")
+ public JAXBElement<IDPType> createJBossIDP(IDPType value) {
+ return new JAXBElement<IDPType>(_JBossIDP_QNAME, IDPType.class, null,
value);
+ }
+
+ /**
* Create an instance of {@link JAXBElement }{@code <}{@link SPType }{@code
>}}
*
*/
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ProviderType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ProviderType.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ProviderType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
@@ -31,6 +31,7 @@
* <element name="IdentityURL"
type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="Trust"
type="{urn:jboss:identity-federation:config:1.0}TrustType"
minOccurs="0"/>
* <element name="KeyProvider"
type="{urn:jboss:identity-federation:config:1.0}KeyProviderType"
minOccurs="0"/>
+ * <element name="MetaDataProvider"
type="{urn:jboss:identity-federation:config:1.0}MetadataProviderType"
minOccurs="0"/>
* </sequence>
* <attribute name="ServerEnvironment"
default="JBOSS">
* <simpleType>
@@ -51,11 +52,12 @@
@XmlType(name = "ProviderType", propOrder = {
"identityURL",
"trust",
- "keyProvider"
+ "keyProvider",
+ "metaDataProvider"
})
@XmlSeeAlso({
- SPType.class,
- IDPType.class
+ IDPType.class,
+ SPType.class
})
public class ProviderType {
@@ -65,6 +67,8 @@
protected TrustType trust;
@XmlElement(name = "KeyProvider")
protected KeyProviderType keyProvider;
+ @XmlElement(name = "MetaDataProvider")
+ protected MetadataProviderType metaDataProvider;
@XmlAttribute(name = "ServerEnvironment")
protected String serverEnvironment;
@@ -141,6 +145,30 @@
}
/**
+ * Gets the value of the metaDataProvider property.
+ *
+ * @return
+ * possible object is
+ * {@link MetadataProviderType }
+ *
+ */
+ public MetadataProviderType getMetaDataProvider() {
+ return metaDataProvider;
+ }
+
+ /**
+ * Sets the value of the metaDataProvider property.
+ *
+ * @param value
+ * allowed object is
+ * {@link MetadataProviderType }
+ *
+ */
+ public void setMetaDataProvider(MetadataProviderType value) {
+ this.metaDataProvider = value;
+ }
+
+ /**
* Gets the value of the serverEnvironment property.
*
* @return
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SPType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SPType.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SPType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/STSType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/STSType.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/STSType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ServiceProviderType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ServiceProviderType.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ServiceProviderType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ServiceProvidersType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ServiceProvidersType.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ServiceProvidersType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TokenProviderType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TokenProviderType.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TokenProviderType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TokenProvidersType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TokenProvidersType.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TokenProvidersType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TrustType.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TrustType.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/TrustType.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/package-info.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/package-info.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/package-info.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -1,8 +1,8 @@
//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vJAXB 2.1.3 in JDK 1.6
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
Implementation, vhudson-jaxb-ri-2.1-661
// See <a
href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/...
// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2009.04.06 at 05:23:23 PM GMT-03:00
+// Generated on: 2009.04.21 at 04:51:39 PM CDT
//
@javax.xml.bind.annotation.XmlSchema(namespace =
"urn:jboss:identity-federation:config:1.0", elementFormDefault =
javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
Added:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/AbstractMetadataProvider.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/AbstractMetadataProvider.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/AbstractMetadataProvider.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -0,0 +1,43 @@
+/*
+ * 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.jboss.identity.federation.bindings.providers;
+
+import java.util.Map;
+
+/**
+ * Abstract Metadata provider
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Apr 21, 2009
+ */
+public abstract class AbstractMetadataProvider
+{
+ protected Map<String, String> options;
+
+ /**
+ * @see IMetadataProvider#init(Map)
+ * @param options
+ */
+ public void init(Map<String,String> options)
+ {
+ this.options = options;
+ }
+}
\ No newline at end of file
Added:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/FileBasedEntitiesMetadataProvider.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/FileBasedEntitiesMetadataProvider.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/FileBasedEntitiesMetadataProvider.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -0,0 +1,62 @@
+/*
+ * 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.jboss.identity.federation.bindings.providers;
+
+import java.io.InputStream;
+import java.security.PublicKey;
+
+import org.jboss.identity.federation.saml.v2.metadata.EntitiesDescriptorType;
+
+/**
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Apr 21, 2009
+ */
+public class FileBasedEntitiesMetadataProvider extends AbstractMetadataProvider
+implements IMetadataProvider<EntitiesDescriptorType>
+{
+ public EntitiesDescriptorType getMetaData()
+ {
+ throw new RuntimeException();
+ }
+
+ public boolean isMultiple()
+ {
+ return true;
+ }
+
+ public void injectEncryptionKey(PublicKey publicKey)
+ {
+ }
+
+ public void injectFileStream(InputStream fileStream)
+ {
+ }
+
+ public void injectSigningKey(PublicKey publicKey)
+ {
+ }
+
+ public String requireFileInjection()
+ {
+ return null;
+ }
+}
\ No newline at end of file
Added:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/FileBasedEntityMetadataProvider.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/FileBasedEntityMetadataProvider.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/FileBasedEntityMetadataProvider.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -0,0 +1,109 @@
+/*
+ * 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.jboss.identity.federation.bindings.providers;
+
+import java.io.InputStream;
+import java.security.PublicKey;
+import java.util.Map;
+
+import javax.xml.bind.JAXBElement;
+
+import org.jboss.identity.federation.api.saml.v2.metadata.MetaDataBuilder;
+import org.jboss.identity.federation.saml.v2.metadata.EntityDescriptorType;
+
+/**
+ * A file based metadata provider that
+ * just looks for the passed in file name
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Apr 21, 2009
+ */
+public class FileBasedEntityMetadataProvider extends AbstractMetadataProvider
+implements IMetadataProvider<EntityDescriptorType>
+{
+
+ private static final String FILENAME_KEY = "FileName";
+ private String fileName;
+ private InputStream metadataFileStream;
+ private PublicKey encryptionKey;
+ private PublicKey signingKey;
+
+ @Override
+ public void init(Map<String, String> options)
+ {
+ super.init(options);
+ fileName = options.get(FILENAME_KEY);
+ if(fileName == null)
+ throw new IllegalStateException("FileName option not set");
+ }
+
+ /**
+ * @see IMetadataProvider#getMetaData()
+ */
+ @SuppressWarnings("unchecked")
+ public EntityDescriptorType getMetaData()
+ {
+ EntityDescriptorType edt = null;
+
+ if(this.metadataFileStream == null)
+ throw new RuntimeException("Metadata file is not injected");
+
+ try
+ {
+ JAXBElement<EntityDescriptorType> j =
+ (JAXBElement<EntityDescriptorType>)
MetaDataBuilder.getUnmarshaller().unmarshal(metadataFileStream);
+ edt = j.getValue();
+ }
+ catch(Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ return edt;
+ }
+
+ /**
+ * @see IMetadataProvider#isMultiple()
+ */
+ public boolean isMultiple()
+ {
+ return false;
+ }
+
+ public void injectEncryptionKey(PublicKey publicKey)
+ {
+ this.encryptionKey = publicKey;
+ }
+
+ public void injectFileStream(InputStream fileStream)
+ {
+ this.metadataFileStream = fileStream;
+ }
+
+ public void injectSigningKey(PublicKey publicKey)
+ {
+ this.signingKey = publicKey;
+ }
+
+ public String requireFileInjection()
+ {
+ return this.fileName;
+ }
+}
\ No newline at end of file
Added:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/IMetadataProvider.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/IMetadataProvider.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/IMetadataProvider.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -0,0 +1,79 @@
+/*
+ * 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.jboss.identity.federation.bindings.providers;
+
+import java.io.File;
+import java.io.InputStream;
+import java.security.PublicKey;
+import java.util.Map;
+
+/**
+ * MetadataProvider
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Apr 21, 2009
+ */
+public interface IMetadataProvider<T>
+{
+ /**
+ * Initialize the provider with options
+ * @param options
+ */
+ void init(Map<String,String> options);
+
+ /**
+ * Is multiple descriptors attached?
+ * @return
+ */
+ boolean isMultiple();
+
+ /**
+ * Get the Metadata descriptors
+ * @return
+ */
+ T getMetaData();
+
+ /**
+ * Provider indicates that it requires
+ * an injection of File instance
+ * @return File Name (need injection) or null
+ */
+ String requireFileInjection();
+
+ /**
+ * Inject a File instance depending on
+ * @see #requireFileInjection() method
+ * @param fileStream
+ */
+ void injectFileStream(InputStream fileStream);
+
+ /**
+ * Inject a public key used for signing
+ * @param publicKey
+ */
+ void injectSigningKey(PublicKey publicKey);
+
+ /**
+ * Inject a public key used for encryption
+ * @param publicKey
+ */
+ void injectEncryptionKey(PublicKey publicKey);
+}
\ No newline at end of file
Added:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/SecurityActions.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/SecurityActions.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/providers/SecurityActions.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -0,0 +1,59 @@
+/*
+ * 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.jboss.identity.federation.bindings.providers;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+/**
+ * Privileged Blocks
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Mar 17, 2009
+ */
+class SecurityActions
+{
+ static void setSystemProperty( final String key, final String value)
+ {
+ AccessController.doPrivileged(new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ System.setProperty(key, value);
+ return null;
+ }
+ });
+ }
+
+ static ClassLoader getContextClassLoader() throws PrivilegedActionException
+ {
+ return AccessController.doPrivileged(new
PrivilegedExceptionAction<ClassLoader>()
+ {
+ public ClassLoader run() throws Exception
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+
+}
\ No newline at end of file
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SOAPSAMLXACMLServlet.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SOAPSAMLXACMLServlet.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SOAPSAMLXACMLServlet.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -24,9 +24,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.security.AccessController;
import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
@@ -242,13 +240,7 @@
private PolicyDecisionPoint getPDP() throws PrivilegedActionException
{
- ClassLoader tcl = AccessController.doPrivileged(new
PrivilegedExceptionAction<ClassLoader>()
- {
- public ClassLoader run() throws Exception
- {
- return Thread.currentThread().getContextClassLoader();
- }
- });
+ ClassLoader tcl = SecurityActions.getContextClassLoader();
InputStream is = tcl.getResourceAsStream(this.policyConfigFileName);
if(is == null)
throw new IllegalStateException(policyConfigFileName + " could not be
located");
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SecurityActions.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SecurityActions.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/java/org/jboss/identity/federation/bindings/servlets/SecurityActions.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -23,6 +23,8 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
/**
* Privileged Blocks
@@ -42,5 +44,16 @@
}
});
}
+
+ static ClassLoader getContextClassLoader() throws PrivilegedActionException
+ {
+ return AccessController.doPrivileged(new
PrivilegedExceptionAction<ClassLoader>()
+ {
+ public ClassLoader run() throws Exception
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
}
\ No newline at end of file
Modified:
identity-federation/trunk/jboss-identity-bindings/src/main/resources/schema/config/jboss-identity-fed.xsd
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/main/resources/schema/config/jboss-identity-fed.xsd 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-bindings/src/main/resources/schema/config/jboss-identity-fed.xsd 2009-04-23
01:59:52 UTC (rev 452)
@@ -106,6 +106,7 @@
<element name="KeyProvider" type="tns:KeyProviderType"
maxOccurs="1" minOccurs="0">
</element>
+ <element name="MetaDataProvider"
type="tns:MetadataProviderType" maxOccurs="1"
minOccurs="0"></element>
</sequence>
<!-- Specify what is the server environment where the IDP or SP exists -->
<attribute name="ServerEnvironment" use="optional"
default="JBOSS">
@@ -214,4 +215,11 @@
<element name="JBossSTS" type="tns:STSType"/>
+
+ <complexType name="MetadataProviderType">
+ <sequence>
+ <element name="Option" type="tns:KeyValueType"
maxOccurs="unbounded" minOccurs="0"></element>
+ </sequence>
+ <attribute name="ClassName"
type="string"></attribute>
+ </complexType>
</schema>
\ No newline at end of file
Added:
identity-federation/trunk/jboss-identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/config/MetadataConfigUnitTestCase.java
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/config/MetadataConfigUnitTestCase.java
(rev 0)
+++
identity-federation/trunk/jboss-identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/config/MetadataConfigUnitTestCase.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -0,0 +1,88 @@
+/*
+ * 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.jboss.test.identity.federation.bindings.config;
+
+import java.io.InputStream;
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Unmarshaller;
+
+import junit.framework.TestCase;
+
+import org.jboss.identity.federation.bindings.config.IDPType;
+import org.jboss.identity.federation.bindings.config.KeyValueType;
+import org.jboss.identity.federation.bindings.config.MetadataProviderType;
+import org.jboss.identity.federation.bindings.config.TrustType;
+import org.jboss.identity.federation.core.saml.v2.factories.JBossSAMLBaseFactory;
+
+
+/**
+ * Config for the SAMLv2 Metadata Profile
+ * @author Anil.Saldhana(a)redhat.com
+ * @since Apr 22, 2009
+ */
+public class MetadataConfigUnitTestCase extends TestCase
+{
+ String config = "config/test-metadata-config-";
+
+ @SuppressWarnings("unchecked")
+ public void testMetadata() throws Exception
+ {
+ Object object = this.unmarshall(config + "1.xml");
+ assertNotNull("IDP is not null", object);
+ assertTrue(object instanceof JAXBElement);
+ IDPType idp = ((JAXBElement<IDPType>) object).getValue();
+ assertEquals("20000", 20000L, idp.getAssertionValidity());
+ assertEquals("somefqn", idp.getRoleGenerator());
+
+ TrustType trust = idp.getTrust();
+ assertNotNull("Trust is not null", trust);
+ String domains = trust.getDomains();
+ assertTrue("localhost trusted", domains.indexOf("localhost")
> -1);
+
assertTrue("jboss.com trusted", domains.indexOf("jboss.com")
> -1);
+
+ MetadataProviderType metaDataProvider = idp.getMetaDataProvider();
+ assertNotNull("MetadataProvider is not null", metaDataProvider);
+ assertEquals("org.jboss.test.somefqn", metaDataProvider.getClassName());
+
+ List<KeyValueType> keyValues = metaDataProvider.getOption();
+ assertTrue(1 == keyValues.size());
+ KeyValueType kvt = keyValues.get(0);
+ assertEquals("FileName", kvt.getKey());
+ assertEquals("myfile", kvt.getValue());
+ }
+
+ private Object unmarshall(String configFile) throws Exception
+ {
+ String schema = "schema/config/jboss-identity-fed.xsd";
+
+ ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+ InputStream is = tcl.getResourceAsStream(configFile);
+ assertNotNull("Inputstream not null", is);
+
+ Unmarshaller un =
+
JBossSAMLBaseFactory.getValidatingUnmarshaller("org.jboss.identity.federation.bindings.config",
+ schema);
+ return un.unmarshal(is);
+ }
+}
\ No newline at end of file
Added:
identity-federation/trunk/jboss-identity-bindings/src/test/resources/config/test-metadata-config-1.xml
===================================================================
---
identity-federation/trunk/jboss-identity-bindings/src/test/resources/config/test-metadata-config-1.xml
(rev 0)
+++
identity-federation/trunk/jboss-identity-bindings/src/test/resources/config/test-metadata-config-1.xml 2009-04-23
01:59:52 UTC (rev 452)
@@ -0,0 +1,18 @@
+<JBossIDP xmlns="urn:jboss:identity-federation:config:1.0"
+ AssertionValidity="20000"
+ RoleGenerator="somefqn"
+ Encrypt="true">
+<IdentityURL>http://localhost:8080/idp</IdentityURL>
+<Trust>
+ <Domains>localhost,jboss.com,jboss.org</Domains>
+</Trust>
+<KeyProvider ClassName="SomeClass">
+ <Auth Key="SomeKey" Value="SomeValue" />
+ <Auth Key="DBURL" Value="SomeDBURL" />
+ <ValidatingAlias Key="localhost" Value="localhostalias"/>
+ <ValidatingAlias Key="jboss.com" Value="jbossalias"/>
+</KeyProvider>
+<MetaDataProvider ClassName="org.jboss.test.somefqn">
+ <Option Key="FileName" Value="myfile"/>
+</MetaDataProvider>
+</JBossIDP>
\ No newline at end of file
Modified:
identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/metadata/MetaDataBuilder.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/metadata/MetaDataBuilder.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-fed-api/src/main/java/org/jboss/identity/federation/api/saml/v2/metadata/MetaDataBuilder.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -23,7 +23,11 @@
import java.util.List;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+
import org.jboss.identity.federation.core.saml.v2.constants.JBossSAMLConstants;
+import org.jboss.identity.federation.core.saml.v2.factories.JBossSAMLBaseFactory;
import org.jboss.identity.federation.saml.v2.assertion.AttributeType;
import org.jboss.identity.federation.saml.v2.metadata.EndpointType;
import org.jboss.identity.federation.saml.v2.metadata.EntityDescriptorType;
@@ -45,6 +49,7 @@
{
private static ObjectFactory oFact = new ObjectFactory();
+ private static String pkgName =
"org.jboss.identity.federation.saml.v2.metadata";
/**
* Create an Endpoint (SingleSignOnEndpoint or SingleLogoutEndpoint)
* @param binding
@@ -167,7 +172,22 @@
return sp;
}
+ public static Marshaller getMarshaller() throws Exception
+ {
+ return JBossSAMLBaseFactory.getMarshaller(pkgName);
+ }
+
/**
+ * Get the Unmarshaller
+ * @return
+ * @throws Exception
+ */
+ public static Unmarshaller getUnmarshaller() throws Exception
+ {
+ return JBossSAMLBaseFactory.getUnmarshaller(pkgName);
+ }
+
+ /**
* Get the ObjectFactory for method chaining
* @return
*/
Modified:
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/constants/JBossSAMLConstants.java
===================================================================
---
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/constants/JBossSAMLConstants.java 2009-04-22
21:46:11 UTC (rev 451)
+++
identity-federation/trunk/jboss-identity-fed-core/src/main/java/org/jboss/identity/federation/core/saml/v2/constants/JBossSAMLConstants.java 2009-04-23
01:59:52 UTC (rev 452)
@@ -29,6 +29,7 @@
public enum JBossSAMLConstants
{
LANG_EN("en"),
+ METADATA_MIME("application/samlmetadata+xml"),
SIGNATURE_SHA1_WITH_DSA("SHA1withDSA"),
SIGNATURE_SHA1_WITH_RSA("SHA1withRSA"),
VERSION_2_0("2.0");