Picketlink SVN: r1439 - in federation/trunk: picketlink-fed-api and 2 other directories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2012-02-24 13:36:14 -0500 (Fri, 24 Feb 2012)
New Revision: 1439
Modified:
federation/trunk/parent/pom.xml
federation/trunk/picketlink-fed-api/pom.xml
federation/trunk/picketlink-fed-core/pom.xml
federation/trunk/picketlink-web/pom.xml
Log:
bump xmlsec version
Modified: federation/trunk/parent/pom.xml
===================================================================
--- federation/trunk/parent/pom.xml 2012-02-24 13:12:56 UTC (rev 1438)
+++ federation/trunk/parent/pom.xml 2012-02-24 18:36:14 UTC (rev 1439)
@@ -126,9 +126,9 @@
<optional>true</optional>
</dependency>
<dependency>
- <groupId>org.apache</groupId>
+ <groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
- <version>1.4.3</version>
+ <version>1.4.5</version>
<optional>true</optional>
</dependency>
<dependency>
Modified: federation/trunk/picketlink-fed-api/pom.xml
===================================================================
--- federation/trunk/picketlink-fed-api/pom.xml 2012-02-24 13:12:56 UTC (rev 1438)
+++ federation/trunk/picketlink-fed-api/pom.xml 2012-02-24 18:36:14 UTC (rev 1439)
@@ -65,7 +65,7 @@
<artifactId>log4j</artifactId>
</dependency>
<dependency>
- <groupId>org.apache</groupId>
+ <groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
</dependency>
<dependency>
Modified: federation/trunk/picketlink-fed-core/pom.xml
===================================================================
--- federation/trunk/picketlink-fed-core/pom.xml 2012-02-24 13:12:56 UTC (rev 1438)
+++ federation/trunk/picketlink-fed-core/pom.xml 2012-02-24 18:36:14 UTC (rev 1439)
@@ -56,7 +56,7 @@
<artifactId>log4j</artifactId>
</dependency>
<dependency>
- <groupId>org.apache</groupId>
+ <groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
</dependency>
<dependency>
Modified: federation/trunk/picketlink-web/pom.xml
===================================================================
--- federation/trunk/picketlink-web/pom.xml 2012-02-24 13:12:56 UTC (rev 1438)
+++ federation/trunk/picketlink-web/pom.xml 2012-02-24 18:36:14 UTC (rev 1439)
@@ -123,7 +123,7 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.apache</groupId>
+ <groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
</dependency>
<dependency>
12 years, 9 months
Picketlink SVN: r1438 - integration-tests/trunk/picketlink-sts-jbas7-cxf.
by picketlink-commits@lists.jboss.org
Author: pskopek(a)redhat.com
Date: 2012-02-24 08:12:56 -0500 (Fri, 24 Feb 2012)
New Revision: 1438
Modified:
integration-tests/trunk/picketlink-sts-jbas7-cxf/
integration-tests/trunk/picketlink-sts-jbas7-cxf/pom.xml
Log:
Shutdown command for jboss AS7 fixed.
Property changes on: integration-tests/trunk/picketlink-sts-jbas7-cxf
___________________________________________________________________
Added: svn:ignore
+ .settings
.classpath
.project
Modified: integration-tests/trunk/picketlink-sts-jbas7-cxf/pom.xml
===================================================================
--- integration-tests/trunk/picketlink-sts-jbas7-cxf/pom.xml 2012-02-24 13:06:07 UTC (rev 1437)
+++ integration-tests/trunk/picketlink-sts-jbas7-cxf/pom.xml 2012-02-24 13:12:56 UTC (rev 1438)
@@ -85,7 +85,7 @@
<phase>test</phase>
<configuration>
<tasks>
- <ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="stop-jboss6" />
+ <ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="stop-jboss7" />
</tasks>
</configuration>
<goals>
12 years, 9 months
Picketlink SVN: r1437 - federation/trunk/picketlink-webapps/as7/picketlink-sts/src/main/java/org/picketlink/identity/federation/app/sts.
by picketlink-commits@lists.jboss.org
Author: pskopek(a)redhat.com
Date: 2012-02-24 08:06:07 -0500 (Fri, 24 Feb 2012)
New Revision: 1437
Modified:
federation/trunk/picketlink-webapps/as7/picketlink-sts/src/main/java/org/picketlink/identity/federation/app/sts/PicketLinkSTService.java
Log:
Reorganized PicketLinkSTSService to fix problems with WebServiceContext injection on AS7.
Modified: federation/trunk/picketlink-webapps/as7/picketlink-sts/src/main/java/org/picketlink/identity/federation/app/sts/PicketLinkSTService.java
===================================================================
--- federation/trunk/picketlink-webapps/as7/picketlink-sts/src/main/java/org/picketlink/identity/federation/app/sts/PicketLinkSTService.java 2012-02-23 19:05:02 UTC (rev 1436)
+++ federation/trunk/picketlink-webapps/as7/picketlink-sts/src/main/java/org/picketlink/identity/federation/app/sts/PicketLinkSTService.java 2012-02-24 13:06:07 UTC (rev 1437)
@@ -24,6 +24,7 @@
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.WebServiceProvider;
+import org.apache.log4j.Logger;
import org.picketlink.identity.federation.core.wstrust.PicketLinkSTS;
/**
@@ -38,8 +39,12 @@
@ServiceMode(value = Service.Mode.MESSAGE)
public class PicketLinkSTService extends PicketLinkSTS
{
-
+ private static Logger log = Logger.getLogger(PicketLinkSTService.class);
+
@Resource
- protected WebServiceContext context;
+ public void setWSC(WebServiceContext wctx) {
+ log.debug("Setting WebServiceContext = " + wctx);
+ this.context = wctx;
+ }
}
\ No newline at end of file
12 years, 9 months
Picketlink SVN: r1436 - integration-tests/trunk/picketlink-sts-jbas7-cxf.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2012-02-23 14:05:02 -0500 (Thu, 23 Feb 2012)
New Revision: 1436
Modified:
integration-tests/trunk/picketlink-sts-jbas7-cxf/pom.xml
Log:
add additional classpath
Modified: integration-tests/trunk/picketlink-sts-jbas7-cxf/pom.xml
===================================================================
--- integration-tests/trunk/picketlink-sts-jbas7-cxf/pom.xml 2012-02-23 16:54:33 UTC (rev 1435)
+++ integration-tests/trunk/picketlink-sts-jbas7-cxf/pom.xml 2012-02-23 19:05:02 UTC (rev 1436)
@@ -21,6 +21,11 @@
<name>JBoss Inc.</name>
<url>http://www.jboss.org</url>
</organization>
+ <properties>
+ <jbas7>${basedir}/target/jboss-as-7.1.0.Final</jbas7>
+ <jbas7-modules>${jbas7}/modules</jbas7-modules>
+ </properties>
+
<build>
<plugins>
<plugin>
@@ -41,6 +46,17 @@
<trimStackTrace>false</trimStackTrace>
<reportsDirectory>${project.build.directory}/surefire-reports-native</reportsDirectory>
<reportNameSuffix>STS-JBAS7-CXF</reportNameSuffix>
+ <additionalClasspathElements>
+ <additionalClasspathElement>${jbas7}/jboss-modules.jar</additionalClasspathElement>
+ <additionalClasspathElement>${jbas7-modules}/org/jboss/logging/main/jboss-logging-3.1.0.GA.jar</additionalClasspathElement>
+ <additionalClasspathElement>${jbas7-modules}/org/jboss/as/controller/main/jboss-as-controller-7.1.0.Final.jar</additionalClasspathElement>
+ <additionalClasspathElement>${jbas7-modules}/org/jboss/as/controller-client/main/jboss-as-controller-client-7.1.0.Final.jar</additionalClasspathElement>
+ <additionalClasspathElement>${jbas7-modules}/org/jboss/as/server/main/jboss-as-server-7.1.0.Final.jar</additionalClasspathElement>
+ <additionalClasspathElement>${jbas7-modules}/org/jboss/as/protocol/main/jboss-as-protocol-7.1.0.Final.jar</additionalClasspathElement>
+ <additionalClasspathElement>${jbas7-modules}/org/jboss/dmr/main/jboss-dmr-1.1.1.Final.jar</additionalClasspathElement>
+ <additionalClasspathElement>${jbas7-modules}/org/jboss/marshalling/main/jboss-marshalling-1.3.9.GA.jar</additionalClasspathElement>
+ <additionalClasspathElement>${jbas7-modules}/org/picketbox/main/picketbox-4.0.6.final.jar</additionalClasspathElement>
+ </additionalClasspathElements>
</configuration>
</plugin>
<plugin>
12 years, 9 months
Picketlink SVN: r1435 - federation/trunk/picketlink-webapps/as7/picketlink-sts/src/main/webapp/WEB-INF.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2012-02-23 11:54:33 -0500 (Thu, 23 Feb 2012)
New Revision: 1435
Modified:
federation/trunk/picketlink-webapps/as7/picketlink-sts/src/main/webapp/WEB-INF/jboss-web.xml
Log:
change the security domain name
Modified: federation/trunk/picketlink-webapps/as7/picketlink-sts/src/main/webapp/WEB-INF/jboss-web.xml
===================================================================
--- federation/trunk/picketlink-webapps/as7/picketlink-sts/src/main/webapp/WEB-INF/jboss-web.xml 2012-02-23 16:54:11 UTC (rev 1434)
+++ federation/trunk/picketlink-webapps/as7/picketlink-sts/src/main/webapp/WEB-INF/jboss-web.xml 2012-02-23 16:54:33 UTC (rev 1435)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
- <security-domain>jmx-console</security-domain>
+ <security-domain>picketlink-sts</security-domain>
</jboss-web>
12 years, 9 months
Picketlink SVN: r1434 - federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2012-02-23 11:54:11 -0500 (Thu, 23 Feb 2012)
New Revision: 1434
Modified:
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTS.java
Log:
add null checks
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTS.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTS.java 2012-02-23 16:50:33 UTC (rev 1433)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/wstrust/PicketLinkSTS.java 2012-02-23 16:54:11 UTC (rev 1434)
@@ -217,6 +217,8 @@
*/
protected Source handleTokenRequest(RequestSecurityToken request)
{
+ if (context == null)
+ throw new IllegalStateException(ErrorCodes.NULL_VALUE + "WebServiceContext");
if (this.config == null)
try
{
@@ -230,6 +232,9 @@
}
WSTrustRequestHandler handler = this.config.getRequestHandler();
+ if (handler == null)
+ throw new IllegalStateException(ErrorCodes.NULL_VALUE + "WSTrustRequestHandler");
+
String requestType = request.getRequestType().toString();
if (logger.isDebugEnabled())
logger.debug("STS received request of type " + requestType);
12 years, 9 months
Picketlink SVN: r1433 - in integration-tests/trunk: ant-scripts and 3 other directories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2012-02-23 11:50:33 -0500 (Thu, 23 Feb 2012)
New Revision: 1433
Added:
integration-tests/trunk/picketlink-sts-jbas7-cxf/
integration-tests/trunk/picketlink-sts-jbas7-cxf/pom.xml
Modified:
integration-tests/trunk/ant-scripts/ant-build.xml
integration-tests/trunk/common-dist/files/standalone.xml
integration-tests/trunk/picketlink-saml-jbas7/pom.xml
Log:
module for PL sts tests on jbas71
Modified: integration-tests/trunk/ant-scripts/ant-build.xml
===================================================================
--- integration-tests/trunk/ant-scripts/ant-build.xml 2012-02-23 16:01:44 UTC (rev 1432)
+++ integration-tests/trunk/ant-scripts/ant-build.xml 2012-02-23 16:50:33 UTC (rev 1433)
@@ -145,6 +145,17 @@
<copy file="${basedir}/../picketlink-sts-tests/src/test/resources/sts-config.properties" todir="${JBAS6_DEPLOY}/../conf/"/>
</target>
+ <target name="copy-sts-props-jbas7">
+ <jar destfile="${JBAS7_DEPLOY}/picketlink/picketlink-sts-1.war">
+ <zipfileset src="${JBAS7_DEPLOY}/picketlink/picketlink-sts.war"/>
+ <zipfileset dir="${basedir}/../picketlink-sts-tests/src/test/resources/" includes="sts-config.properties" prefix="WEB-INF/classes/"/>
+ <zipfileset dir="${basedir}/../picketlink-trust-tests/src/test/resources/props/" includes="sts-users.properties" prefix="WEB-INF/classes/"/>
+ <zipfileset dir="${basedir}/../picketlink-trust-tests/src/test/resources/props/" includes="sts-roles.properties" prefix="WEB-INF/classes/"/>
+ </jar>
+ <delete file="${JBAS7_DEPLOY}/picketlink/picketlink-sts.war" failonerror="true" verbose="true"/>
+ <move file="${JBAS7_DEPLOY}/picketlink/picketlink-sts-1.war" tofile="${JBAS7_DEPLOY}/picketlink/picketlink-sts.war"/>
+ </target>
+
<target name="copy-trust-settings-jbas5">
<copy file="${basedir}/../picketlink-trust-tests/src/test/resources/domains/sts-jboss-beans.xml" todir="${JBAS5_DEPLOY}/picketlink" />
<copy file="${basedir}/../picketlink-trust-tests/target/picketlink-wstest-tests.jar" todir="${JBAS5_DEPLOY}/picketlink" />
@@ -172,9 +183,12 @@
osfamily="unix" spawn="true" />
<waitfor maxwait="1" maxwaitunit="minute"
checkevery="100" checkeveryunit="millisecond">
- <http url="http://localhost:8080/idp/" />
+ <http url="http://localhost:8080/idp-sig/" />
</waitfor>
<echo>:Local 8080 Started</echo>
+ <echo>Going to wait 5 seconds for server to fully start up</echo>
+ <sleep seconds="5"/>
+ <echo>Sleep of 5 seconds Done.</echo>
</target>
<target name="start-jboss5" depends="copy-picketlink-jbas5" >
@@ -189,15 +203,18 @@
</antcall>
</target>
- <target name="start-jboss7" depends="copy-picketlink-jbas7" >
+ <target name="start-jboss7">
<echo>Starting Local 8080 </echo>
<exec executable="${basedir}/target/jboss-as-7.1.0.Final/bin/standalone.sh"
osfamily="unix" spawn="true" />
<waitfor maxwait="1" maxwaitunit="minute"
checkevery="100" checkeveryunit="millisecond">
- <http url="http://localhost:8080/idp/" />
+ <http url="http://localhost:8080/idp-sig/" />
</waitfor>
<echo>:Local 8080 Started</echo>
+ <echo>Going to wait 5 seconds for server to fully start up</echo>
+ <sleep seconds="5"/>
+ <echo>Sleep of 5 seconds Done.</echo>
</target>
<target name="start-tomcat6" depends="copy-picketlink-tomcat6,stop-tomcat6" >
Modified: integration-tests/trunk/common-dist/files/standalone.xml
===================================================================
--- integration-tests/trunk/common-dist/files/standalone.xml 2012-02-23 16:01:44 UTC (rev 1432)
+++ integration-tests/trunk/common-dist/files/standalone.xml 2012-02-23 16:50:33 UTC (rev 1433)
@@ -255,11 +255,11 @@
</login-module>
</authentication>
</security-domain>
- <security-domain name="jmx-console" cache-type="default">
+ <security-domain name="picketlink-sts" cache-type="default">
<authentication>
<login-module code="UsersRoles" flag="required">
- <module-option name="usersProperties" value="users.properties"/>
- <module-option name="rolesProperties" value="roles.properties"/>
+ <module-option name="usersProperties" value="sts-users.properties"/>
+ <module-option name="rolesProperties" value="sts-roles.properties"/>
</login-module>
</authentication>
</security-domain>
Modified: integration-tests/trunk/picketlink-saml-jbas7/pom.xml
===================================================================
--- integration-tests/trunk/picketlink-saml-jbas7/pom.xml 2012-02-23 16:01:44 UTC (rev 1432)
+++ integration-tests/trunk/picketlink-saml-jbas7/pom.xml 2012-02-23 16:50:33 UTC (rev 1433)
@@ -63,6 +63,7 @@
<property name="version" value="${pl-version}"/>
<property name="localRepository" value="${user.home}/.m2/repository"/>
<ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="init-jboss7" />
+ <ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="copy-picketlink-jbas7" />
<ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="start-jboss7" />
</tasks>
</configuration>
Added: integration-tests/trunk/picketlink-sts-jbas7-cxf/pom.xml
===================================================================
--- integration-tests/trunk/picketlink-sts-jbas7-cxf/pom.xml (rev 0)
+++ integration-tests/trunk/picketlink-sts-jbas7-cxf/pom.xml 2012-02-23 16:50:33 UTC (rev 1433)
@@ -0,0 +1,185 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.picketlink</groupId>
+ <artifactId>picketlink-integration-tests-parent</artifactId>
+ <version>2.0.2-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>picketlink-integration-sts-jbas7-cxf</artifactId>
+ <packaging>jar</packaging>
+ <name>PicketLink Integration Tests for WS-Trust (STS) - JBoss AS 7 - CXF Stack</name>
+ <url>http://labs.jboss.org/portal/picketlink/</url>
+ <description>PicketLink Federation Tests to be run in a continous integration environment such as Hudson</description>
+ <licenses>
+ <license>
+ <name>lgpl</name>
+ <url>http://repository.jboss.com/licenses/lgpl.txt</url>
+ </license>
+ </licenses>
+ <organization>
+ <name>JBoss Inc.</name>
+ <url>http://www.jboss.org</url>
+ </organization>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <phase>test</phase>
+ <!-- <skipTests>true</skipTests> -->
+ <testClassesDirectory>${basedir}/../picketlink-sts-tests/target/test-classes</testClassesDirectory>
+ <testResourcesDirectory>${basedir}/../picketlink-sts-tests/target/test-classes</testResourcesDirectory>
+ <printSummary>true</printSummary>
+ <disableXmlReport>false</disableXmlReport>
+ <includes>
+ <include>**/**TestCase.java</include>
+ </includes>
+ <forkMode>pertest</forkMode>
+ <argLine>-Djava.endorsed.dirs=${basedir}/../picketlink-sts-tests/src/test/resources/endorsed</argLine>
+ <useFile>false</useFile>
+ <trimStackTrace>false</trimStackTrace>
+ <reportsDirectory>${project.build.directory}/surefire-reports-native</reportsDirectory>
+ <reportNameSuffix>STS-JBAS7-CXF</reportNameSuffix>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>phase-1</id>
+ <phase>compile</phase>
+ <configuration>
+ <tasks>
+ <property name="version" value="${pl-version}"/>
+ <property name="depclasspath" refid="maven.dependency.classpath"/>
+ <property name="localRepository" value="${user.home}/.m2/repository"/>
+ <ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="init-jboss7" />
+ <ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="copy-picketlink-jbas7" />
+ <ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="copy-sts-props-jbas7" />
+ <ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="start-jboss7" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>phase-2</id>
+ <phase>test</phase>
+ <configuration>
+ <tasks>
+ <ant antfile="${basedir}/../ant-scripts/ant-build.xml" target="stop-jboss6" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.picketlink</groupId>
+ <artifactId>picketlink-fed</artifactId>
+ <version>${pl-version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jbosssx-client</artifactId>
+ <version>2.0.4.SP6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.jbossas</groupId>
+ <artifactId>jboss-as-server</artifactId>
+ <classifier>jmx-invoker-adaptor-client</classifier>
+ <version>6.0.0.Final</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>trove</groupId>
+ <artifactId>trove</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>wutka-dtdparser</groupId>
+ <artifactId>dtdparser121</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>httpunit</groupId>
+ <artifactId>httpunit</artifactId>
+ <version>1.7</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>rhino</groupId>
+ <artifactId>js</artifactId>
+ <version>1.6R7</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>apache-log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+ <dependency>
+ <groupId>nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <version>1.9.12</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.9.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ant-contrib</groupId>
+ <artifactId>ant-contrib</artifactId>
+ <version>1.0b2</version>
+ </dependency>
+
+ </dependencies>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <doclet>org.jboss.apiviz.APIviz</doclet>
+ <docletArtifact>
+ <groupId>org.jboss.apiviz</groupId>
+ <artifactId>apiviz</artifactId>
+ <version>1.2.5.GA</version>
+ </docletArtifact>
+ <additionalparam>
+ -charset UTF-8
+ -docencoding UTF-8
+ -version
+ -author
+ -breakiterator
+ -windowtitle "${project.name} ${project.version} API Reference"
+ -doctitle "${project.name} ${project.version} API Reference"
+ -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved."
+ -link http://java.sun.com/javase/6/docs/api/
+ -sourceclasspath ${project.build.outputDirectory}
+ </additionalparam>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
12 years, 9 months
Picketlink SVN: r1432 - in federation/trunk/picketlink-webapps: idp-sig and 4 other directories.
by picketlink-commits@lists.jboss.org
Author: pskopek(a)redhat.com
Date: 2012-02-23 11:01:44 -0500 (Thu, 23 Feb 2012)
New Revision: 1432
Removed:
federation/trunk/picketlink-webapps/picketlink-sts/src/main/java/
Modified:
federation/trunk/picketlink-webapps/idp-sig-no-val/pom.xml
federation/trunk/picketlink-webapps/idp-sig/pom.xml
federation/trunk/picketlink-webapps/idp-standalone/pom.xml
federation/trunk/picketlink-webapps/idp/pom.xml
federation/trunk/picketlink-webapps/picketlink-sts/pom.xml
Log:
Excluding all deps from PL web apps' WEB-INF/lib.
They cause classloader issues on AS51.
Modified: federation/trunk/picketlink-webapps/idp/pom.xml
===================================================================
--- federation/trunk/picketlink-webapps/idp/pom.xml 2012-02-22 21:21:07 UTC (rev 1431)
+++ federation/trunk/picketlink-webapps/idp/pom.xml 2012-02-23 16:01:44 UTC (rev 1432)
@@ -27,10 +27,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
- <version>2.0.2</version>
+ <version>2.2</version>
<configuration>
<warName>idp</warName>
- <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
+ <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
</configuration>
</plugin>
</plugins>
Modified: federation/trunk/picketlink-webapps/idp-sig/pom.xml
===================================================================
--- federation/trunk/picketlink-webapps/idp-sig/pom.xml 2012-02-22 21:21:07 UTC (rev 1431)
+++ federation/trunk/picketlink-webapps/idp-sig/pom.xml 2012-02-23 16:01:44 UTC (rev 1432)
@@ -27,11 +27,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
- <version>2.0.2</version>
+ <version>2.2</version>
<configuration>
<warName>idp-sig</warName>
- <webappDirectory>${basedir}/src/main/webapp/</webappDirectory>
- <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
+ <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
</configuration>
</plugin>
</plugins>
Modified: federation/trunk/picketlink-webapps/idp-sig-no-val/pom.xml
===================================================================
--- federation/trunk/picketlink-webapps/idp-sig-no-val/pom.xml 2012-02-22 21:21:07 UTC (rev 1431)
+++ federation/trunk/picketlink-webapps/idp-sig-no-val/pom.xml 2012-02-23 16:01:44 UTC (rev 1432)
@@ -27,11 +27,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
- <version>2.0.2</version>
+ <version>2.2</version>
<configuration>
<warName>idp-sig-no-val</warName>
- <webappDirectory>${basedir}/src/main/webapp/</webappDirectory>
- <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
+ <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
</configuration>
</plugin>
</plugins>
Modified: federation/trunk/picketlink-webapps/idp-standalone/pom.xml
===================================================================
--- federation/trunk/picketlink-webapps/idp-standalone/pom.xml 2012-02-22 21:21:07 UTC (rev 1431)
+++ federation/trunk/picketlink-webapps/idp-standalone/pom.xml 2012-02-23 16:01:44 UTC (rev 1432)
@@ -27,11 +27,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
- <version>2.0.2</version>
+ <version>2.2</version>
<configuration>
<warName>idp-standalone</warName>
- <webappDirectory>${basedir}/src/main/webapp/</webappDirectory>
- <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes>
+ <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
</configuration>
</plugin>
</plugins>
Modified: federation/trunk/picketlink-webapps/picketlink-sts/pom.xml
===================================================================
--- federation/trunk/picketlink-webapps/picketlink-sts/pom.xml 2012-02-22 21:21:07 UTC (rev 1431)
+++ federation/trunk/picketlink-webapps/picketlink-sts/pom.xml 2012-02-23 16:01:44 UTC (rev 1432)
@@ -27,11 +27,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
- <version>2.0.2</version>
+ <version>2.2</version>
<configuration>
<warName>picketlink-sts</warName>
- <!--webappDirectory>${basedir}/resources/</webappDirectory>
- <warSourceExcludes>WEB-INF/lib/*.jar</warSourceExcludes-->
+ <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
</configuration>
</plugin>
</plugins>
12 years, 9 months
Picketlink SVN: r1431 - in federation/trunk: picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp and 5 other directories.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2012-02-22 16:21:07 -0500 (Wed, 22 Feb 2012)
New Revision: 1431
Added:
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/util/StringUtilTestCase.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/AbstractSAMLConfigurationProvider.java
Modified:
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/BaseFormAuthenticator.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/IDPType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/KeyValueType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ProviderType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/SPType.java
federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/StringUtil.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/IDPMetadataConfigurationProvider.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/SPPostMetadataConfigurationProvider.java
federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/SPRedirectMetadataConfigurationProvider.java
federation/trunk/picketlink-web/src/test/java/org/picketlink/test/identity/federation/web/saml/config/IDPMetadataConfigurationProviderUnitTestCase.java
federation/trunk/picketlink-web/src/test/java/org/picketlink/test/identity/federation/web/saml/config/SPPostMetadataConfigurationProviderUnitTestCase.java
Log:
PLFED-266: an abstract saml configuration provider that can additionally take in the configuration from picketlink-idfed.xml
Modified: federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java
===================================================================
--- federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java 2012-02-22 18:49:45 UTC (rev 1430)
+++ federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java 2012-02-22 21:21:07 UTC (rev 1431)
@@ -116,6 +116,7 @@
import org.picketlink.identity.federation.saml.v2.SAML2Object;
import org.picketlink.identity.federation.saml.v2.protocol.RequestAbstractType;
import org.picketlink.identity.federation.saml.v2.protocol.StatusResponseType;
+import org.picketlink.identity.federation.web.config.AbstractSAMLConfigurationProvider;
import org.picketlink.identity.federation.web.constants.GeneralConstants;
import org.picketlink.identity.federation.web.core.HTTPContext;
import org.picketlink.identity.federation.web.core.IdentityParticipantStack;
@@ -1053,27 +1054,36 @@
}
}
+ String configFile = GeneralConstants.CONFIG_FILE_LOCATION;
+ context = (Context) getContainer();
+
+ InputStream is = context.getServletContext().getResourceAsStream(configFile);
+
//Work on the IDP Configuration
if (configProvider != null)
{
try
{
idpConfiguration = configProvider.getIDPConfiguration();
+
+ //Additionally parse the config file
+ if (is != null && configProvider instanceof AbstractSAMLConfigurationProvider)
+ {
+ ((AbstractSAMLConfigurationProvider) configProvider).setConfigFile(is);
+ }
}
catch (ProcessingException e)
{
throw new RuntimeException(ErrorCodes.PROCESSING_EXCEPTION + e.getLocalizedMessage());
}
+ catch (ParsingException e)
+ {
+ throw new RuntimeException(ErrorCodes.PARSING_ERROR + e.getLocalizedMessage());
+ }
}
- String configFile = GeneralConstants.CONFIG_FILE_LOCATION;
-
- context = (Context) getContainer();
-
if (idpConfiguration == null)
{
-
- InputStream is = context.getServletContext().getResourceAsStream(configFile);
if (is == null)
throw new RuntimeException(ErrorCodes.IDP_WEBBROWSER_VALVE_CONF_FILE_MISSING + configFile);
Modified: federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/BaseFormAuthenticator.java
===================================================================
--- federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/BaseFormAuthenticator.java 2012-02-22 18:49:45 UTC (rev 1430)
+++ federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/sp/BaseFormAuthenticator.java 2012-02-22 21:21:07 UTC (rev 1431)
@@ -73,6 +73,7 @@
import org.picketlink.identity.federation.saml.v2.metadata.EntityDescriptorType;
import org.picketlink.identity.federation.saml.v2.metadata.IDPSSODescriptorType;
import org.picketlink.identity.federation.saml.v2.metadata.KeyDescriptorType;
+import org.picketlink.identity.federation.web.config.AbstractSAMLConfigurationProvider;
import org.picketlink.identity.federation.web.constants.GeneralConstants;
import org.picketlink.identity.federation.web.util.ConfigurationUtil;
import org.picketlink.identity.federation.web.util.SAMLConfigurationProvider;
@@ -396,6 +397,10 @@
if (configProvider != null)
{
spConfiguration = configProvider.getSPConfiguration();
+ if (configProvider instanceof AbstractSAMLConfigurationProvider)
+ {
+ ((AbstractSAMLConfigurationProvider) configProvider).setConfigFile(is);
+ }
}
else
{
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/IDPType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/IDPType.java 2012-02-22 18:49:45 UTC (rev 1430)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/IDPType.java 2012-02-22 21:21:07 UTC (rev 1431)
@@ -21,6 +21,8 @@
*/
package org.picketlink.identity.federation.core.config;
+import org.picketlink.identity.federation.core.util.StringUtil;
+
/**
*
* IDP Type defines the configuration for an Identity
@@ -220,4 +222,26 @@
this.encrypt = value;
}
-}
+ /**
+ * Import values from another {@link IDPType}
+ * @param other
+ */
+ public void importFrom(IDPType other)
+ {
+ super.importFrom(other);
+
+ String attributeManager = other.getAttributeManager();
+ if (StringUtil.isNotNull(attributeManager))
+ {
+ setAttributeManager(attributeManager);
+ }
+ assertionValidity = other.getAssertionValidity();
+
+ encrypt = other.isEncrypt();
+
+ if (StringUtil.isNotNull(other.getRoleGenerator()))
+ {
+ this.roleGenerator = other.getRoleGenerator();
+ }
+ }
+}
\ No newline at end of file
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/KeyValueType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/KeyValueType.java 2012-02-22 18:49:45 UTC (rev 1430)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/KeyValueType.java 2012-02-22 21:21:07 UTC (rev 1431)
@@ -98,4 +98,17 @@
this.value = value;
}
-}
+ /**
+ * Create a new instance
+ * @param key
+ * @param value
+ * @return
+ */
+ public static KeyValueType create(String key, String value)
+ {
+ KeyValueType keyValueType = new KeyValueType();
+ keyValueType.setKey(key);
+ keyValueType.setValue(value);
+ return keyValueType;
+ }
+}
\ No newline at end of file
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ProviderType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ProviderType.java 2012-02-22 18:49:45 UTC (rev 1430)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/ProviderType.java 2012-02-22 21:21:07 UTC (rev 1431)
@@ -26,6 +26,8 @@
import javax.xml.crypto.dsig.CanonicalizationMethod;
+import org.picketlink.identity.federation.core.util.StringUtil;
+
/**
* Base Type for IDP and SP
*
@@ -268,4 +270,27 @@
{
return additionalOptions.get(key);
}
+
+ /**
+ * Import values from another {@link IDPType}
+ * @param other
+ */
+ public void importFrom(ProviderType other)
+ {
+ KeyProviderType keyProvider = other.getKeyProvider();
+ if (keyProvider != null)
+ {
+ setKeyProvider(keyProvider);
+ }
+
+ String can = other.getCanonicalizationMethod();
+ if (StringUtil.isNotNull(can))
+ {
+ setCanonicalizationMethod(can);
+ }
+
+ trust = other.getTrust();
+
+ additionalOptions.putAll(other.additionalOptions);
+ }
}
\ No newline at end of file
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/SPType.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/SPType.java 2012-02-22 18:49:45 UTC (rev 1430)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/config/SPType.java 2012-02-22 21:21:07 UTC (rev 1431)
@@ -21,6 +21,7 @@
*/
package org.picketlink.identity.federation.core.config;
+
/**
* Service Provider Type
*
@@ -44,7 +45,6 @@
*/
public class SPType extends ProviderType
{
-
protected String serviceURL;
protected String idpMetadataFile;
Modified: federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/StringUtil.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/StringUtil.java 2012-02-22 18:49:45 UTC (rev 1430)
+++ federation/trunk/picketlink-fed-core/src/main/java/org/picketlink/identity/federation/core/util/StringUtil.java 2012-02-22 21:21:07 UTC (rev 1431)
@@ -22,7 +22,9 @@
package org.picketlink.identity.federation.core.util;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -139,8 +141,19 @@
*/
public static List<String> tokenize(String str)
{
+ return tokenize(str, ",");
+ }
+
+ /**
+ * Given a delimited string, get the tokens as a {@link List}
+ * @param str
+ * @param delimiter the delimiter
+ * @return
+ */
+ public static List<String> tokenize(String str, String delimiter)
+ {
List<String> list = new ArrayList<String>();
- StringTokenizer tokenizer = new StringTokenizer(str, ",");
+ StringTokenizer tokenizer = new StringTokenizer(str, delimiter);
while (tokenizer.hasMoreTokens())
{
list.add(tokenizer.nextToken());
@@ -149,6 +162,24 @@
}
/**
+ * Given a string that is comma delimited and contains key-value pairs
+ * @param keyValuePairString
+ * @return
+ */
+ public static Map<String, String> tokenizeKeyValuePair(String keyValuePairString)
+ {
+ Map<String, String> map = new HashMap<String, String>();
+
+ List<String> tokens = tokenize(keyValuePairString);
+ for (String token : tokens)
+ {
+ int location = token.indexOf('=');
+ map.put(token.substring(0, location), token.substring(location + 1));
+ }
+ return map;
+ }
+
+ /**
* Given a masked password {@link String}, decode it
* @param maskedString a password string that is masked
* @param salt Salt
Added: federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/util/StringUtilTestCase.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/util/StringUtilTestCase.java (rev 0)
+++ federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/util/StringUtilTestCase.java 2012-02-22 21:21:07 UTC (rev 1431)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.picketlink.test.identity.federation.core.util;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+import org.picketlink.identity.federation.core.util.StringUtil;
+
+/**
+ * Unit test {@link StringUtil}
+ * @author Anil Saldhana
+ * @since Feb 22, 2012
+ */
+public class StringUtilTestCase
+{
+ @Test
+ public void testTokenizeKeyValuePairs() throws Exception
+ {
+ String str = "a=b,c=d,e=f";
+ Map<String, String> map = StringUtil.tokenizeKeyValuePair(str);
+
+ assertEquals("b", map.get("a"));
+ assertEquals("d", map.get("c"));
+ assertEquals("f", map.get("e"));
+ }
+
+ @Test
+ public void testTokenize() throws Exception
+ {
+ String str = "a,b";
+
+ String theOtherString = "a/b;c/d";
+
+ List<String> list = StringUtil.tokenize(str);
+ assertEquals(2, list.size());
+ assertTrue(list.contains("a"));
+ assertTrue(list.contains("b"));
+
+ List<String> bigList = StringUtil.tokenize(theOtherString, ";");
+ assertEquals(2, bigList.size());
+ for (String token : bigList)
+ {
+ List<String> theList = StringUtil.tokenize(token, "/");
+
+ if (token.equals("a/b"))
+ {
+ assertTrue(theList.contains("a"));
+ assertTrue(theList.contains("b"));
+ }
+ else if (token.equals("c/d"))
+ {
+ assertTrue(theList.contains("c"));
+ assertTrue(theList.contains("d"));
+ }
+ else
+ throw new RuntimeException("Unknown");
+ }
+ }
+}
\ No newline at end of file
Added: federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/AbstractSAMLConfigurationProvider.java
===================================================================
--- federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/AbstractSAMLConfigurationProvider.java (rev 0)
+++ federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/AbstractSAMLConfigurationProvider.java 2012-02-22 21:21:07 UTC (rev 1431)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.picketlink.identity.federation.web.config;
+
+import java.io.InputStream;
+
+import org.picketlink.identity.federation.core.ErrorCodes;
+import org.picketlink.identity.federation.core.config.IDPType;
+import org.picketlink.identity.federation.core.config.SPType;
+import org.picketlink.identity.federation.core.exceptions.ParsingException;
+import org.picketlink.identity.federation.core.exceptions.ProcessingException;
+import org.picketlink.identity.federation.core.parsers.config.SAMLConfigParser;
+import org.picketlink.identity.federation.web.util.SAMLConfigurationProvider;
+
+/**
+ * An abstact class to hold the common functionality across providers
+ * @author Anil Saldhana
+ * @since Feb 22, 2012
+ */
+public abstract class AbstractSAMLConfigurationProvider implements SAMLConfigurationProvider
+{
+ public static final String VALIDATING_ALIAS = "ValidatingAlias";
+
+ protected IDPType configParsedIDPType = null;
+
+ protected SPType configParsedSPType = null;
+
+ public void setConfigFile(InputStream is) throws ParsingException
+ {
+ if (is == null)
+ {
+ throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT);
+ }
+
+ SAMLConfigParser parser = new SAMLConfigParser();
+ Object parsedObject = parser.parse(is);
+ if (parsedObject instanceof IDPType)
+ configParsedIDPType = (IDPType) parsedObject;
+ else
+ configParsedSPType = (SPType) parsedObject;
+ }
+
+ public abstract IDPType getIDPConfiguration() throws ProcessingException;
+
+ public abstract SPType getSPConfiguration() throws ProcessingException;
+}
\ No newline at end of file
Modified: federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/IDPMetadataConfigurationProvider.java
===================================================================
--- federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/IDPMetadataConfigurationProvider.java 2012-02-22 18:49:45 UTC (rev 1430)
+++ federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/IDPMetadataConfigurationProvider.java 2012-02-22 21:21:07 UTC (rev 1431)
@@ -49,7 +49,9 @@
* @author Anil Saldhana
* @since Feb 15, 2012
*/
-public class IDPMetadataConfigurationProvider implements SAMLConfigurationProvider
+public class IDPMetadataConfigurationProvider extends AbstractSAMLConfigurationProvider
+ implements
+ SAMLConfigurationProvider
{
public static final String IDP_MD_FILE = "idp-metadata.xml";
@@ -76,6 +78,11 @@
}
}
+ if (configParsedIDPType != null)
+ {
+ idpType.importFrom(configParsedIDPType);
+ }
+
return idpType;
}
Modified: federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/SPPostMetadataConfigurationProvider.java
===================================================================
--- federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/SPPostMetadataConfigurationProvider.java 2012-02-22 18:49:45 UTC (rev 1430)
+++ federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/SPPostMetadataConfigurationProvider.java 2012-02-22 21:21:07 UTC (rev 1431)
@@ -49,7 +49,9 @@
* @author Anil Saldhana
* @since Feb 15, 2012
*/
-public class SPPostMetadataConfigurationProvider implements SAMLConfigurationProvider
+public class SPPostMetadataConfigurationProvider extends AbstractSAMLConfigurationProvider
+ implements
+ SAMLConfigurationProvider
{
public static final String SP_MD_FILE = "sp-metadata.xml";
@@ -81,7 +83,10 @@
throw new ProcessingException(e);
}
}
-
+ if (configParsedSPType != null)
+ {
+ spType.importFrom(configParsedSPType);
+ }
return spType;
}
Modified: federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/SPRedirectMetadataConfigurationProvider.java
===================================================================
--- federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/SPRedirectMetadataConfigurationProvider.java 2012-02-22 18:49:45 UTC (rev 1430)
+++ federation/trunk/picketlink-web/src/main/java/org/picketlink/identity/federation/web/config/SPRedirectMetadataConfigurationProvider.java 2012-02-22 21:21:07 UTC (rev 1431)
@@ -49,7 +49,9 @@
* @author Anil Saldhana
* @since Feb 15, 2012
*/
-public class SPRedirectMetadataConfigurationProvider implements SAMLConfigurationProvider
+public class SPRedirectMetadataConfigurationProvider extends AbstractSAMLConfigurationProvider
+ implements
+ SAMLConfigurationProvider
{
public static final String SP_MD_FILE = "sp-metadata.xml";
@@ -81,7 +83,10 @@
throw new ProcessingException(e);
}
}
-
+ if (configParsedSPType != null)
+ {
+ spType.importFrom(configParsedSPType);
+ }
return spType;
}
Modified: federation/trunk/picketlink-web/src/test/java/org/picketlink/test/identity/federation/web/saml/config/IDPMetadataConfigurationProviderUnitTestCase.java
===================================================================
--- federation/trunk/picketlink-web/src/test/java/org/picketlink/test/identity/federation/web/saml/config/IDPMetadataConfigurationProviderUnitTestCase.java 2012-02-22 18:49:45 UTC (rev 1430)
+++ federation/trunk/picketlink-web/src/test/java/org/picketlink/test/identity/federation/web/saml/config/IDPMetadataConfigurationProviderUnitTestCase.java 2012-02-22 21:21:07 UTC (rev 1431)
@@ -24,8 +24,11 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import java.io.InputStream;
+
import org.junit.Test;
import org.picketlink.identity.federation.core.config.IDPType;
+import org.picketlink.identity.federation.core.config.TrustType;
import org.picketlink.identity.federation.core.exceptions.ProcessingException;
import org.picketlink.identity.federation.web.config.IDPMetadataConfigurationProvider;
@@ -45,4 +48,23 @@
assertEquals("https://idp.testshib.org/idp/profile/SAML2/POST/SSO", idp.getIdentityURL());
}
+ @Test
+ public void testIDPTypeWithConfig() throws Exception
+ {
+ IDPMetadataConfigurationProvider provider = new IDPMetadataConfigurationProvider();
+ InputStream is = Thread.currentThread().getContextClassLoader()
+ .getResourceAsStream("saml2/logout/idp/WEB-INF/picketlink-idfed.xml");
+ assertNotNull(is);
+ provider.setConfigFile(is);
+
+ IDPType idp = provider.getIDPConfiguration();
+ assertNotNull(idp);
+ assertEquals("https://idp.testshib.org/idp/profile/SAML2/POST/SSO", idp.getIdentityURL());
+
+ TrustType trust = idp.getTrust();
+ assertNotNull(trust);
+ assertEquals("localhost,jboss.com,jboss.org", trust.getDomains());
+
+ assertEquals("org.picketlink.identity.federation.core.impl.EmptyAttributeManager", idp.getAttributeManager());
+ }
}
\ No newline at end of file
Modified: federation/trunk/picketlink-web/src/test/java/org/picketlink/test/identity/federation/web/saml/config/SPPostMetadataConfigurationProviderUnitTestCase.java
===================================================================
--- federation/trunk/picketlink-web/src/test/java/org/picketlink/test/identity/federation/web/saml/config/SPPostMetadataConfigurationProviderUnitTestCase.java 2012-02-22 18:49:45 UTC (rev 1430)
+++ federation/trunk/picketlink-web/src/test/java/org/picketlink/test/identity/federation/web/saml/config/SPPostMetadataConfigurationProviderUnitTestCase.java 2012-02-22 21:21:07 UTC (rev 1431)
@@ -24,6 +24,8 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import java.io.InputStream;
+
import org.junit.Test;
import org.picketlink.identity.federation.core.config.SPType;
import org.picketlink.identity.federation.core.exceptions.ProcessingException;
@@ -45,4 +47,18 @@
assertEquals("https://sp.testshib.org/Shibboleth.sso/SAML2/POST", sp.getServiceURL());
}
+ @Test
+ public void testSPTypeWithConfig() throws Exception
+ {
+ SPPostMetadataConfigurationProvider provider = new SPPostMetadataConfigurationProvider();
+ InputStream is = Thread.currentThread().getContextClassLoader()
+ .getResourceAsStream("saml2/logout/sp/sales/WEB-INF/picketlink-idfed.xml");
+ assertNotNull(is);
+ provider.setConfigFile(is);
+
+ SPType sp = provider.getSPConfiguration();
+ assertNotNull(sp);
+ assertEquals("https://sp.testshib.org/Shibboleth.sso/SAML2/POST", sp.getServiceURL());
+ }
+
}
\ No newline at end of file
12 years, 9 months
Picketlink SVN: r1430 - in federation/trunk/picketlink-fed-core/src/test: resources/parser/saml2 and 1 other directory.
by picketlink-commits@lists.jboss.org
Author: anil.saldhana(a)jboss.com
Date: 2012-02-22 13:49:45 -0500 (Wed, 22 Feb 2012)
New Revision: 1430
Modified:
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/saml/SAMLAssertionParserTestCase.java
federation/trunk/picketlink-fed-core/src/test/resources/parser/saml2/saml2-assertion-subjectconfirmation.xml
Log:
update test to see if we handle nameid under subject properly
Modified: federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/saml/SAMLAssertionParserTestCase.java
===================================================================
--- federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/saml/SAMLAssertionParserTestCase.java 2012-02-22 15:25:43 UTC (rev 1429)
+++ federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/saml/SAMLAssertionParserTestCase.java 2012-02-22 18:49:45 UTC (rev 1430)
@@ -243,7 +243,11 @@
AssertionType assertion = (AssertionType) parser.parse(configStream);
assertNotNull(assertion);
- List<SubjectConfirmationType> subjectConfirmationTypes = assertion.getSubject().getConfirmation();
+ SubjectType subjectType = assertion.getSubject();
+ STSubType stType = subjectType.getSubType();
+ assertEquals("A_DUDE", ((NameIDType) stType.getBaseID()).getValue());
+
+ List<SubjectConfirmationType> subjectConfirmationTypes = subjectType.getConfirmation();
assertNotNull(subjectConfirmationTypes);
assertEquals(1, subjectConfirmationTypes.size());
SubjectConfirmationType sct = subjectConfirmationTypes.get(0);
@@ -251,6 +255,7 @@
NameIDType nameID = sct.getNameID();
assertNotNull(nameID);
assertEquals("CN=theDUDE", nameID.getValue());
+
}
/**
Modified: federation/trunk/picketlink-fed-core/src/test/resources/parser/saml2/saml2-assertion-subjectconfirmation.xml
===================================================================
--- federation/trunk/picketlink-fed-core/src/test/resources/parser/saml2/saml2-assertion-subjectconfirmation.xml 2012-02-22 15:25:43 UTC (rev 1429)
+++ federation/trunk/picketlink-fed-core/src/test/resources/parser/saml2/saml2-assertion-subjectconfirmation.xml 2012-02-22 18:49:45 UTC (rev 1430)
@@ -4,6 +4,7 @@
<saml2:Issuer>TheDUDE</saml2:Issuer>
<saml2:Subject>
+ <saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">A_DUDE</saml2:NameID>
<saml2:SubjectConfirmation
Method="urn:oasis:names:tc:SAML:2.0:cm:sender-vouches">
<saml2:NameID>CN=theDUDE</saml2:NameID>
12 years, 9 months