[jboss-identity-commits] JBoss Identity SVN: r237 - in identity-federation/trunk/identity-bindings/src: main/java/org/jboss/identity/federation/bindings/config and 9 other directories.
jboss-identity-commits at lists.jboss.org
jboss-identity-commits at lists.jboss.org
Thu Jan 22 01:21:54 EST 2009
Author: anil.saldhana at jboss.com
Date: 2009-01-22 01:21:54 -0500 (Thu, 22 Jan 2009)
New Revision: 237
Added:
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthProperty.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDP.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProvider.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValue.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ObjectFactory.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Provider.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SP.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Trust.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/package-info.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/RoleGenerator.java
identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/TomcatRoleGenerator.java
identity-federation/trunk/identity-bindings/src/main/resources/schema/
identity-federation/trunk/identity-bindings/src/main/resources/schema/config/
identity-federation/trunk/identity-bindings/src/main/resources/schema/config/jboss-identity-fed.xsd
identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/config/
identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/config/ConfigUnitTestCase.java
identity-federation/trunk/identity-bindings/src/test/resources/config/
identity-federation/trunk/identity-bindings/src/test/resources/config/test-config-1.xml
identity-federation/trunk/identity-bindings/src/test/resources/config/test-config-2.xml
Log:
config and interfaces
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthProperty.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthProperty.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/AuthProperty.java 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,39 @@
+//
+// 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/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.01.22 at 12:05:50 AM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for AuthProperty complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="AuthProperty">
+ * <complexContent>
+ * <extension base="{urn:jboss:identity-federation:config:1.0}KeyValue">
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "AuthProperty")
+public class AuthProperty
+ extends KeyValue
+{
+
+
+}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDP.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDP.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/IDP.java 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,107 @@
+//
+// 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/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.01.22 at 12:05:50 AM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ *
+ * IDP Type defines the configuration for an Identity
+ * Provider.
+ *
+ *
+ * <p>Java class for IDP complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="IDP">
+ * <complexContent>
+ * <extension base="{urn:jboss:identity-federation:config:1.0}Provider">
+ * <attribute name="AssertionValidity" type="{http://www.w3.org/2001/XMLSchema}long" default="5000" />
+ * <attribute name="RoleGenerator" type="{http://www.w3.org/2001/XMLSchema}string" default="org.jboss.identity.federation.bindings.tomcat.TomcatRoleGenerator" />
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "IDP")
+public class IDP
+ extends Provider
+{
+
+ @XmlAttribute(name = "AssertionValidity")
+ protected Long assertionValidity;
+ @XmlAttribute(name = "RoleGenerator")
+ protected String roleGenerator;
+
+ /**
+ * Gets the value of the assertionValidity property.
+ *
+ * @return
+ * possible object is
+ * {@link Long }
+ *
+ */
+ public long getAssertionValidity() {
+ if (assertionValidity == null) {
+ return 5000L;
+ } else {
+ return assertionValidity;
+ }
+ }
+
+ /**
+ * Sets the value of the assertionValidity property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Long }
+ *
+ */
+ public void setAssertionValidity(Long value) {
+ this.assertionValidity = value;
+ }
+
+ /**
+ * Gets the value of the roleGenerator property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getRoleGenerator() {
+ if (roleGenerator == null) {
+ return "org.jboss.identity.federation.bindings.tomcat.TomcatRoleGenerator";
+ } else {
+ return roleGenerator;
+ }
+ }
+
+ /**
+ * Sets the value of the roleGenerator property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setRoleGenerator(String value) {
+ this.roleGenerator = value;
+ }
+
+}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProvider.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProvider.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyProvider.java 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,169 @@
+//
+// 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/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.01.22 at 12:05:50 AM CST
+//
+
+
+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;
+
+
+/**
+ *
+ * Source of the Signing and Validating Key
+ *
+ *
+ * <p>Java class for KeyProvider complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="KeyProvider">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Auth" type="{urn:jboss:identity-federation:config:1.0}AuthProperty" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="ValidatingAlias" type="{urn:jboss:identity-federation:config:1.0}KeyValue" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="SigningAlias" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="ClassName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "KeyProvider", propOrder = {
+ "auth",
+ "validatingAlias",
+ "signingAlias"
+})
+public class KeyProvider {
+
+ @XmlElement(name = "Auth")
+ protected List<AuthProperty> auth;
+ @XmlElement(name = "ValidatingAlias")
+ protected List<KeyValue> validatingAlias;
+ @XmlElement(name = "SigningAlias")
+ protected String signingAlias;
+ @XmlAttribute(name = "ClassName")
+ protected String className;
+
+ /**
+ * Gets the value of the auth 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 auth property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getAuth().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link AuthProperty }
+ *
+ *
+ */
+ public List<AuthProperty> getAuth() {
+ if (auth == null) {
+ auth = new ArrayList<AuthProperty>();
+ }
+ return this.auth;
+ }
+
+ /**
+ * Gets the value of the validatingAlias 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 validatingAlias property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getValidatingAlias().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link KeyValue }
+ *
+ *
+ */
+ public List<KeyValue> getValidatingAlias() {
+ if (validatingAlias == null) {
+ validatingAlias = new ArrayList<KeyValue>();
+ }
+ return this.validatingAlias;
+ }
+
+ /**
+ * Gets the value of the signingAlias property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSigningAlias() {
+ return signingAlias;
+ }
+
+ /**
+ * Sets the value of the signingAlias property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSigningAlias(String value) {
+ this.signingAlias = value;
+ }
+
+ /**
+ * 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;
+ }
+
+}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValue.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValue.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/KeyValue.java 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,96 @@
+//
+// 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/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.01.22 at 12:05:50 AM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for KeyValue complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="KeyValue">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <attribute name="Key" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * <attribute name="Value" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "KeyValue")
+ at XmlSeeAlso({
+ AuthProperty.class
+})
+public class KeyValue {
+
+ @XmlAttribute(name = "Key")
+ protected String key;
+ @XmlAttribute(name = "Value")
+ protected String value;
+
+ /**
+ * Gets the value of the key property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getKey() {
+ return key;
+ }
+
+ /**
+ * Sets the value of the key property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setKey(String value) {
+ this.key = value;
+ }
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ObjectFactory.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ObjectFactory.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/ObjectFactory.java 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,108 @@
+//
+// 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/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.01.22 at 12:05:50 AM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * 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
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+ at XmlRegistry
+public class ObjectFactory {
+
+ private final static QName _JBossIDP_QNAME = new QName("urn:jboss:identity-federation:config:1.0", "JBossIDP");
+
+ /**
+ * 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 SP }
+ *
+ */
+ public SP createSP() {
+ return new SP();
+ }
+
+ /**
+ * Create an instance of {@link KeyProvider }
+ *
+ */
+ public KeyProvider createKeyProvider() {
+ return new KeyProvider();
+ }
+
+ /**
+ * Create an instance of {@link AuthProperty }
+ *
+ */
+ public AuthProperty createAuthProperty() {
+ return new AuthProperty();
+ }
+
+ /**
+ * Create an instance of {@link Trust }
+ *
+ */
+ public Trust createTrust() {
+ return new Trust();
+ }
+
+ /**
+ * Create an instance of {@link Provider }
+ *
+ */
+ public Provider createProvider() {
+ return new Provider();
+ }
+
+ /**
+ * Create an instance of {@link KeyValue }
+ *
+ */
+ public KeyValue createKeyValue() {
+ return new KeyValue();
+ }
+
+ /**
+ * Create an instance of {@link IDP }
+ *
+ */
+ public IDP createIDP() {
+ return new IDP();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link IDP }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "urn:jboss:identity-federation:config:1.0", name = "JBossIDP")
+ public JAXBElement<IDP> createJBossIDP(IDP value) {
+ return new JAXBElement<IDP>(_JBossIDP_QNAME, IDP.class, null, value);
+ }
+
+}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Provider.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Provider.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Provider.java 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,132 @@
+//
+// 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/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.01.22 at 12:05:50 AM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Base Type for IDP and SP
+ *
+ * <p>Java class for Provider complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Provider">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="IdentityURL" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * <element name="Trust" type="{urn:jboss:identity-federation:config:1.0}Trust"/>
+ * <element name="KeyProvider" type="{urn:jboss:identity-federation:config:1.0}KeyProvider" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "Provider", propOrder = {
+ "identityURL",
+ "trust",
+ "keyProvider"
+})
+ at XmlSeeAlso({
+ IDP.class,
+ SP.class
+})
+public class Provider {
+
+ @XmlElement(name = "IdentityURL", required = true)
+ protected String identityURL;
+ @XmlElement(name = "Trust", required = true)
+ protected Trust trust;
+ @XmlElement(name = "KeyProvider")
+ protected KeyProvider keyProvider;
+
+ /**
+ * Gets the value of the identityURL property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getIdentityURL() {
+ return identityURL;
+ }
+
+ /**
+ * Sets the value of the identityURL property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setIdentityURL(String value) {
+ this.identityURL = value;
+ }
+
+ /**
+ * Gets the value of the trust property.
+ *
+ * @return
+ * possible object is
+ * {@link Trust }
+ *
+ */
+ public Trust getTrust() {
+ return trust;
+ }
+
+ /**
+ * Sets the value of the trust property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Trust }
+ *
+ */
+ public void setTrust(Trust value) {
+ this.trust = value;
+ }
+
+ /**
+ * Gets the value of the keyProvider property.
+ *
+ * @return
+ * possible object is
+ * {@link KeyProvider }
+ *
+ */
+ public KeyProvider getKeyProvider() {
+ return keyProvider;
+ }
+
+ /**
+ * Sets the value of the keyProvider property.
+ *
+ * @param value
+ * allowed object is
+ * {@link KeyProvider }
+ *
+ */
+ public void setKeyProvider(KeyProvider value) {
+ this.keyProvider = value;
+ }
+
+}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SP.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SP.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/SP.java 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,73 @@
+//
+// 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/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.01.22 at 12:05:50 AM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Service Provider Type
+ *
+ * <p>Java class for SP complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="SP">
+ * <complexContent>
+ * <extension base="{urn:jboss:identity-federation:config:1.0}Provider">
+ * <sequence>
+ * <element name="ServiceURL" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </extension>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "SP", propOrder = {
+ "serviceURL"
+})
+public class SP
+ extends Provider
+{
+
+ @XmlElement(name = "ServiceURL", required = true)
+ protected String serviceURL;
+
+ /**
+ * Gets the value of the serviceURL property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getServiceURL() {
+ return serviceURL;
+ }
+
+ /**
+ * Sets the value of the serviceURL property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setServiceURL(String value) {
+ this.serviceURL = value;
+ }
+
+}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Trust.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Trust.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/Trust.java 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,71 @@
+//
+// 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/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.01.22 at 12:05:50 AM CST
+//
+
+
+package org.jboss.identity.federation.bindings.config;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * Aspects involved in trust decisions such as the domains that the IDP or the Service Provider trusts.
+ *
+ * <p>Java class for Trust complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="Trust">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="Domains" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "Trust", propOrder = {
+ "domains"
+})
+public class Trust {
+
+ @XmlElement(name = "Domains", required = true)
+ protected String domains;
+
+ /**
+ * Gets the value of the domains property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getDomains() {
+ return domains;
+ }
+
+ /**
+ * Sets the value of the domains property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setDomains(String value) {
+ this.domains = value;
+ }
+
+}
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/package-info.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/package-info.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/config/package-info.java 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,9 @@
+//
+// 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/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.01.22 at 12:05:50 AM CST
+//
+
+ at javax.xml.bind.annotation.XmlSchema(namespace = "urn:jboss:identity-federation:config:1.0", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.jboss.identity.federation.bindings.config;
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/RoleGenerator.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/RoleGenerator.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/interfaces/RoleGenerator.java 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,40 @@
+/*
+ * 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.interfaces;
+
+import java.security.Principal;
+import java.util.List;
+
+/**
+ * Generate roles given a principal
+ * @author Anil.Saldhana at redhat.com
+ * @since Jan 21, 2009
+ */
+public interface RoleGenerator
+{
+ /**
+ * Generate roles given a principal
+ * @param principal
+ * @return
+ */
+ List<String> generateRoles(Principal principal);
+}
\ No newline at end of file
Added: identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/TomcatRoleGenerator.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/TomcatRoleGenerator.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/java/org/jboss/identity/federation/bindings/tomcat/TomcatRoleGenerator.java 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,75 @@
+/*
+ * 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.tomcat;
+
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.catalina.Role;
+import org.apache.catalina.User;
+import org.apache.catalina.realm.GenericPrincipal;
+import org.jboss.identity.federation.bindings.interfaces.RoleGenerator;
+
+/**
+ * Generate roles from Tomcat Principal
+ * @author Anil.Saldhana at redhat.com
+ * @since Jan 21, 2009
+ */
+public class TomcatRoleGenerator implements RoleGenerator
+{
+ /**
+ * @see RoleGenerator#generateRoles(Principal)
+ * @throws IllegalArgumentException if principal is not of type GenericPrincipal or User
+ */
+ public List<String> generateRoles(Principal principal)
+ {
+ String className = principal.getClass().getCanonicalName();
+
+ if(principal instanceof GenericPrincipal == false &&
+ principal instanceof User == false)
+ throw new IllegalArgumentException("principal is not tomcat principal:"+ className);
+ List<String> userRoles = new ArrayList<String>();
+
+ if(principal instanceof GenericPrincipal)
+ {
+ GenericPrincipal gp = (GenericPrincipal) principal;
+ String[] roles = gp.getRoles();
+ if(roles.length > 0)
+ userRoles.addAll(Arrays.asList(roles));
+ }
+ else
+ if(principal instanceof User)
+ {
+ User tomcatUser = (User) principal;
+ Iterator<?> iter = tomcatUser.getRoles();
+ while(iter.hasNext())
+ {
+ Role tomcatRole = (Role) iter.next();
+ userRoles.add(tomcatRole.getRolename());
+ }
+ }
+ return userRoles;
+ }
+}
\ No newline at end of file
Added: identity-federation/trunk/identity-bindings/src/main/resources/schema/config/jboss-identity-fed.xsd
===================================================================
--- identity-federation/trunk/identity-bindings/src/main/resources/schema/config/jboss-identity-fed.xsd (rev 0)
+++ identity-federation/trunk/identity-bindings/src/main/resources/schema/config/jboss-identity-fed.xsd 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:jboss:identity-federation:config:1.0"
+ xmlns:tns="urn:jboss:identity-federation:config:1.0"
+ elementFormDefault="qualified" version="1.0">
+ <complexType name="IDP">
+ <annotation>
+ <documentation>
+ IDP Type defines the configuration for an Identity
+ Provider.
+ </documentation>
+ </annotation>
+ <complexContent>
+ <extension base="tns:Provider">
+ <attribute name="AssertionValidity" type="long" use="optional" default="5000"></attribute>
+ <attribute name="RoleGenerator" type="string" use="optional" default="org.jboss.identity.federation.bindings.tomcat.TomcatRoleGenerator"></attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <element name="JBossIDP" type="tns:IDP">
+ <annotation>
+ <documentation>The root configuration for an Identity Provider(IDP) using JBoss Identity.</documentation>
+ </annotation>
+ </element>
+
+
+ <complexType name="Trust">
+ <annotation>
+ <documentation>Aspects involved in trust decisions such as the domains that the IDP or the Service Provider trusts.</documentation>
+ </annotation>
+ <sequence>
+ <element name="Domains" type="string">
+ <annotation>
+ <documentation>Comma Separated domain names such as localhost,jboss.com,jboss.org</documentation>
+ </annotation>
+ </element>
+ </sequence>
+ </complexType>
+
+ <complexType name="KeyProvider">
+ <annotation>
+ <documentation>
+ Source of the Signing and Validating Key
+ </documentation>
+ </annotation>
+ <sequence>
+ <element name="Auth" type="tns:AuthProperty"
+ maxOccurs="unbounded" minOccurs="0">
+ <annotation>
+ <documentation>
+ Key Value Pairs Needed to authenticate into the
+ provider.
+ </documentation>
+ </annotation>
+ </element>
+ <element name="ValidatingAlias" type="tns:KeyValue"
+ maxOccurs="unbounded" minOccurs="0">
+ <annotation>
+ <documentation>
+ Key Value pairs identifying domains against the
+ alias for validating key
+ </documentation>
+ </annotation>
+ </element>
+ <element name="SigningAlias" type="string" maxOccurs="1"
+ minOccurs="0">
+ <annotation>
+ <documentation>
+ An alias that identifies the signing key
+ </documentation>
+ </annotation>
+ </element>
+ </sequence>
+ <attribute name="ClassName" type="string"></attribute>
+ </complexType>
+
+ <complexType name="KeyValue">
+ <attribute name="Key" type="string"></attribute>
+ <attribute name="Value" type="string"></attribute>
+ </complexType>
+
+ <complexType name="Provider">
+ <annotation>
+ <documentation>Base Type for IDP and SP</documentation>
+ </annotation>
+ <sequence>
+ <element name="IdentityURL" type="string" maxOccurs="1"
+ minOccurs="1">
+ </element>
+ <element name="Trust" type="tns:Trust" maxOccurs="1"
+ minOccurs="1">
+ </element>
+ <element name="KeyProvider" type="tns:KeyProvider"
+ maxOccurs="1" minOccurs="0">
+ </element>
+ </sequence>
+ </complexType>
+
+ <complexType name="SP">
+ <annotation>
+ <documentation>Service Provider Type</documentation>
+ </annotation>
+ <complexContent>
+ <extension base="tns:Provider">
+ <sequence>
+ <element name="ServiceURL" type="string"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="AuthProperty">
+ <complexContent>
+ <extension base="tns:KeyValue"></extension>
+ </complexContent>
+ </complexType>
+</schema>
\ No newline at end of file
Added: identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/config/ConfigUnitTestCase.java
===================================================================
--- identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/config/ConfigUnitTestCase.java (rev 0)
+++ identity-federation/trunk/identity-bindings/src/test/java/org/jboss/test/identity/federation/bindings/config/ConfigUnitTestCase.java 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,111 @@
+/*
+ * 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.AuthProperty;
+import org.jboss.identity.federation.bindings.config.IDP;
+import org.jboss.identity.federation.bindings.config.KeyProvider;
+import org.jboss.identity.federation.bindings.config.KeyValue;
+import org.jboss.identity.federation.bindings.config.Trust;
+import org.jboss.identity.federation.core.saml.v2.factories.JBossSAMLBaseFactory;
+
+/**
+ * Unit Test the various config
+ * @author Anil.Saldhana at redhat.com
+ * @since Jan 21, 2009
+ */
+public class ConfigUnitTestCase extends TestCase
+{
+ String config = "config/test-config-";
+
+ public void test01() throws Exception
+ {
+ IDP idp = this.getIDP(config + "1.xml");
+ assertEquals("5000",5000L,idp.getAssertionValidity());
+ assertEquals("org.jboss.identity.federation.bindings.tomcat.TomcatRoleGenerator",idp.getRoleGenerator());
+
+ Trust 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);
+ }
+
+ public void test02() throws Exception
+ {
+ IDP idp = this.getIDP(config + "2.xml");
+
+ assertEquals("20000",20000L,idp.getAssertionValidity());
+ assertEquals("somefqn",idp.getRoleGenerator());
+ KeyProvider kp = idp.getKeyProvider();
+ assertNotNull("KeyProvider is not null", kp);
+ assertEquals("SomeClass", "SomeClass", kp.getClassName());
+ List<AuthProperty> authProps = kp.getAuth();
+ AuthProperty authProp = authProps.get(0);
+ assertEquals("SomeKey", "SomeKey", authProp.getKey());
+ assertEquals("SomeValue", "SomeValue", authProp.getValue());
+
+ authProp = authProps.get(1);
+ assertEquals("DBURL", "DBURL", authProp.getKey());
+ assertEquals("SomeDBURL", "SomeDBURL", authProp.getValue());
+
+ List<KeyValue> validatingAliases = kp.getValidatingAlias();
+ assertEquals("Validating Alias length is 2", 2, validatingAliases.size());
+
+ KeyValue kv = validatingAliases.get(0);
+ assertEquals("localhost", kv.getKey());
+ assertEquals("localhostalias", kv.getValue());
+
+ kv = validatingAliases.get(1);
+ assertEquals("jboss.com", kv.getKey());
+ assertEquals("jbossalias", kv.getValue());
+
+ Trust 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);
+ }
+
+ @SuppressWarnings("unchecked")
+ private IDP getIDP(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);
+ JAXBElement<IDP> jaxbIdp = (JAXBElement<IDP>) un.unmarshal(is);
+ assertNotNull("IDP is not null", jaxbIdp);
+ return jaxbIdp.getValue();
+ }
+}
\ No newline at end of file
Added: identity-federation/trunk/identity-bindings/src/test/resources/config/test-config-1.xml
===================================================================
--- identity-federation/trunk/identity-bindings/src/test/resources/config/test-config-1.xml (rev 0)
+++ identity-federation/trunk/identity-bindings/src/test/resources/config/test-config-1.xml 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,6 @@
+<JBossIDP xmlns="urn:jboss:identity-federation:config:1.0">
+<IdentityURL>http://localhost:8080/idp</IdentityURL>
+<Trust>
+ <Domains>localhost,jboss.com,jboss.org</Domains>
+</Trust>
+</JBossIDP>
\ No newline at end of file
Added: identity-federation/trunk/identity-bindings/src/test/resources/config/test-config-2.xml
===================================================================
--- identity-federation/trunk/identity-bindings/src/test/resources/config/test-config-2.xml (rev 0)
+++ identity-federation/trunk/identity-bindings/src/test/resources/config/test-config-2.xml 2009-01-22 06:21:54 UTC (rev 237)
@@ -0,0 +1,14 @@
+<JBossIDP xmlns="urn:jboss:identity-federation:config:1.0"
+ AssertionValidity="20000"
+ RoleGenerator="somefqn">
+<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>
+</JBossIDP>
\ No newline at end of file
More information about the jboss-identity-commits
mailing list