[jboss-cvs] JBossAS SVN: r71409 - in projects/security/security-xacml/trunk: build and 27 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Mar 28 19:23:34 EDT 2008
Author: anil.saldhana at jboss.com
Date: 2008-03-28 19:23:33 -0400 (Fri, 28 Mar 2008)
New Revision: 71409
Added:
projects/security/security-xacml/trunk/jboss-xacml-saml/
projects/security/security-xacml/trunk/jboss-xacml-saml/.classpath
projects/security/security-xacml/trunk/jboss-xacml-saml/.project
projects/security/security-xacml/trunk/jboss-xacml-saml/pom.xml
projects/security/security-xacml/trunk/jboss-xacml-saml/src/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/constants/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/constants/SAMLXACMLConstants.java
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/core/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/core/XACMLObject.java
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/core/XACMLObjectBuilder.java
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeImpl.java
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeImplBuilder.java
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeMarshaller.java
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeUnMarshaller.java
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/request/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/request/SAMLRequest.java
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/response/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/types/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/types/XACMLAuthzDecisionQueryType.java
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/types/XACMLAuthzDecisionStatementType.java
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/util/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/util/DOMUtil.java
projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/util/SAML2Util.java
projects/security/security-xacml/trunk/jboss-xacml-saml/src/resources/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/org/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/org/jboss/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/org/jboss/test/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/org/jboss/test/security/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/org/jboss/test/security/xacml/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/org/jboss/test/security/xacml/saml/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/org/jboss/test/security/xacml/saml/SAMLXACMLUnitTestCase.java
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/resolver.jar
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/serializer.jar
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/xalan.jar
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/xercesImpl.jar
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/xml-apis.jar
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/saml/
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/saml/samlrequest.xml
projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/saml/xacmlrequest.xml
Modified:
projects/security/security-xacml/trunk/build/pom.xml
Log:
SECURITY-160: opensaml2 extensions to read xacml payload
Modified: projects/security/security-xacml/trunk/build/pom.xml
===================================================================
--- projects/security/security-xacml/trunk/build/pom.xml 2008-03-28 23:17:26 UTC (rev 71408)
+++ projects/security/security-xacml/trunk/build/pom.xml 2008-03-28 23:23:33 UTC (rev 71409)
@@ -140,5 +140,6 @@
<modules>
<module>../jboss-sunxacml</module>
<module>../jboss-xacml</module>
+ <module>../jboss-xacml-saml</module>
</modules>
</project>
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/.classpath
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/.classpath (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/.classpath 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/resources"/>
+ <classpathentry kind="src" path="src/tests"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="var" path="M2_REPO/opensaml/opensaml/2.0/opensaml-2.0.jar" sourcepath="/M2_REPO/opensaml/opensaml/2.0/opensaml-2.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/opensaml/openws/1.0/openws-1.0.jar"/>
+ <classpathentry kind="var" path="M2_REPO/opensaml/xmltooling/1.0/xmltooling-1.0.jar" sourcepath="/M2_REPO/opensaml/xmltooling/1.0/xmltooling-1.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.4.3/slf4j-log4j12-1.4.3.jar"/>
+ <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.13/log4j-1.2.13.jar"/>
+ <classpathentry kind="var" path="M2_REPO/net/sf/joda-time/1.4/joda-time-1.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-api/2.1.4/jaxb-api-2.1.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-impl/2.1.4/jaxb-impl-2.1.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaxb/jaxb-xjc/2.1.4/jaxb-xjc-2.1.4.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/sun-jaf/activation/1.1/activation-1.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/xmlsec/1.4.1/xmlsec-1.4.1.jar"/>
+ <classpathentry kind="var" path="M2_REPO/velocity/velocity-dep/1.5/velocity-dep-1.5.jar"/>
+ <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-sunxacml"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-xacml"/>
+ <classpathentry kind="output" path="target/eclipse-classes"/>
+</classpath>
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/.project
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/.project (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/.project 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jboss-xacml-saml</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+ <linkedResources>
+ <link>
+ <name>Link</name>
+ <type>2</type>
+ <locationURI>TEMP</locationURI>
+ </link>
+ </linkedResources>
+</projectDescription>
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/pom.xml
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/pom.xml (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/pom.xml 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,131 @@
+<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.jboss.security</groupId>
+ <artifactId>jboss-xacml-project</artifactId>
+ <version>2.0.2-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-xacml-saml</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss XACML</name>
+ <url>http://www.jboss.org</url>
+ <description>JBoss XACML Library</description>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <printSummary>true</printSummary>
+ <disableXmlReport>false</disableXmlReport>
+ <testFailureIgnore>true</testFailureIgnore>
+ <includes>
+ <include>**/**TestCase.java</include>
+ </includes>
+ <forkMode>pertest</forkMode>
+ <argLine>-Djava.endorsed.dirs=${basedir}/src/tests/resources/endorsed</argLine>
+ <useFile>false</useFile>
+ <trimStackTrace>false</trimStackTrace>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-xacml</artifactId>
+ <version>2.0.2-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-sunxacml</artifactId>
+ <version>2.0.2-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging-api</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.4.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.4.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org</groupId>
+ <artifactId>javolution</artifactId>
+ <version>4.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+ <dependency>
+ <groupId>apache-log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>opensaml</groupId>
+ <artifactId>openws</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>opensaml</groupId>
+ <artifactId>xmltooling</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache</groupId>
+ <artifactId>xmlsec</artifactId>
+ <version>1.4.1</version>
+ </dependency>
+ <dependency>
+ <groupId>velocity</groupId>
+ <artifactId>velocity-dep</artifactId>
+ <version>1.5</version>
+ </dependency>
+ <dependency>
+ <groupId>sun-jaxb</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>sun-jaxb</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>sun-jaxb</groupId>
+ <artifactId>jaxb-xjc</artifactId>
+ <version>2.1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+ </dependencies>
+</project>
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/constants/SAMLXACMLConstants.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/constants/SAMLXACMLConstants.java (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/constants/SAMLXACMLConstants.java 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.security.xacml.saml.integration.opensaml.constants;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * SAML v2.0 XACML constants
+ * @author Anil.Saldhana at redhat.com
+ * @since Mar 27, 2008
+ * @version $Revision$
+ */
+public interface SAMLXACMLConstants
+{
+
+ String SAML2_XACML_ATTRIBUTE_NS = "urn:oasis:names:tc:SAML:2.0:profiles:attribute:XACML";
+
+ /** XACML attribute profile spec. */
+ QName SAML_DATATYPE_ATTRIB = new QName(SAML2_XACML_ATTRIBUTE_NS, "DataType", "xacmlprof");
+
+ /** The prefix for saml-xacml assertion. */
+ String SAML2_XACMLASSERTION_PREFIX = "xacml-saml";
+
+ /** The prefix for saml20-xacml protocol. */
+ String SAML2_XACMLPROTOCOL_PREFIX = "xacml-samlp";
+
+ String SAMLP = "urn:oasis:xacml:2.0:saml:protocol:schema:os";
+
+ /** The namespaces for XACML 1.0 SAML 2.0 protocol. */
+ String SAML2_XACML10P_NS = "urn:oasis:names:tc:xacml:1.0:profile:saml2.0:v2:schema:protocol";
+
+ /** The namespaces for XACML 1.0 SAML 2.0 assertion. */
+ String SAML2_XACML10_NS = "urn:oasis:names:tc:xacml:1.0:profile:saml2.0:v2:schema:assertion";
+
+ /** The namespace for XACML 1.1 SAML 2.0 protocol. */
+ String SAML2_XACML1_1P_NS = "urn:oasis:names:tc:xacml:1.1:profile:saml2.0:v2:schema:protocol";
+
+ /** The namespace for XACML 1.1 SAML 2.0 assertion. */
+ String SAML2_XACML1_1_NS = "urn:oasis:names:tc:xacml:1.1:profile:saml2.0:v2:schema:assertion";
+
+ /** The namespaces for XACML 2.0 SAML 2.0 protocol. */
+ String SAML2_XACML20P_NS = "urn:oasis:names:tc:xacml:2.0:profile:saml2.0:v2:schema:protocol";
+
+ /** The namespaces for XACML 2.0 SAML 2.0 assertion. */
+ String SAML2_XACML20_NS = "urn:oasis:names:tc:xacml:2.0:profile:saml2.0:v2:schema:assertion";
+}
\ No newline at end of file
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/core/XACMLObject.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/core/XACMLObject.java (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/core/XACMLObject.java 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.security.xacml.saml.integration.opensaml.core;
+
+//$Id$
+
+/**
+ * Marker Interface
+ * @author Anil.Saldhana at redhat.com
+ * @since Mar 28, 2008
+ * @version $Revision$
+ */
+public interface XACMLObject
+{
+
+}
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/core/XACMLObjectBuilder.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/core/XACMLObjectBuilder.java (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/core/XACMLObjectBuilder.java 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.security.xacml.saml.integration.opensaml.core;
+
+import org.opensaml.xml.XMLObjectBuilder;
+
+/**
+ *
+ * @author Anil.Saldhana at redhat.com
+ * @since Mar 28, 2008
+ * @version $Revision$
+ */
+public interface XACMLObjectBuilder<T extends XACMLObject>
+extends XMLObjectBuilder
+{
+ T buildObject() ;
+}
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeImpl.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeImpl.java (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeImpl.java 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.security.xacml.saml.integration.opensaml.impl;
+
+import org.jboss.security.xacml.interfaces.RequestContext;
+import org.jboss.security.xacml.saml.integration.opensaml.types.XACMLAuthzDecisionQueryType;
+import org.opensaml.saml2.core.impl.RequestAbstractTypeImpl;
+import org.opensaml.xml.schema.XSBooleanValue;
+
+
+/**
+ * Implementation of the xacml authz decision query
+ * @author Anil.Saldhana at redhat.com
+ * @since Mar 27, 2008
+ * @version $Revision$
+ */
+public class XACMLAuthzDecisionQueryTypeImpl extends RequestAbstractTypeImpl
+implements XACMLAuthzDecisionQueryType
+{
+ private RequestContext requestType;
+ private XSBooleanValue combinePolicies;
+
+ /*
+ * Constructor.
+ * @param nsURI the namespace the element is in
+ * @param localname the local name of the XML element
+ * @param prefix the prefix for the given namespace
+ */
+ protected XACMLAuthzDecisionQueryTypeImpl(String nsURI, String localname,
+ String prefix)
+ {
+ super(nsURI, localname, prefix);
+ setElementNamespacePrefix(prefix);
+ }
+
+ public XSBooleanValue getCombinePolicies()
+ {
+ return combinePolicies;
+ }
+
+ public RequestContext getRequest()
+ {
+ return requestType;
+ }
+
+ public boolean isCombinePolicies()
+ {
+ return combinePolicies != null ? combinePolicies.getValue() : null;
+ }
+
+ public void setCombinePolicies(XSBooleanValue combinePolicies)
+ {
+ this.combinePolicies = combinePolicies;
+ }
+
+ public void setRequest(RequestContext request)
+ {
+ this.requestType = request;
+ }
+}
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeImplBuilder.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeImplBuilder.java (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeImplBuilder.java 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.security.xacml.saml.integration.opensaml.impl;
+
+import org.jboss.security.xacml.saml.integration.opensaml.types.XACMLAuthzDecisionQueryType;
+import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
+
+/**
+ * Implementation Builder for the XACML Authorization Query Type
+ * @author Anil.Saldhana at redhat.com
+ * @since Mar 28, 2008
+ * @version $Revision$
+ */
+public class XACMLAuthzDecisionQueryTypeImplBuilder
+extends AbstractSAMLObjectBuilder<XACMLAuthzDecisionQueryType>
+{
+ /** Constructor. */
+ public XACMLAuthzDecisionQueryTypeImplBuilder() {
+
+ }
+
+ /** {@inheritDoc} */
+ public XACMLAuthzDecisionQueryType buildObject(String nsURI,
+ String localName, String prefix)
+ {
+ return new XACMLAuthzDecisionQueryTypeImpl(nsURI, localName, prefix);
+ }
+
+ @Override
+ public XACMLAuthzDecisionQueryType buildObject()
+ {
+ return null;
+ }
+}
\ No newline at end of file
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeMarshaller.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeMarshaller.java (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeMarshaller.java 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.security.xacml.saml.integration.opensaml.impl;
+
+import org.opensaml.saml2.core.impl.RequestAbstractTypeMarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.MarshallingException;
+import org.w3c.dom.Element;
+
+/**
+ * Marshaller
+ * @author Anil.Saldhana at redhat.com
+ * @since Mar 28, 2008
+ * @version $Revision$
+ */
+public class XACMLAuthzDecisionQueryTypeMarshaller
+extends RequestAbstractTypeMarshaller
+{
+ /** Constructor. */
+ public XACMLAuthzDecisionQueryTypeMarshaller()
+ {
+ super();
+ }
+
+ /**
+ * Constructor.
+ */
+ protected XACMLAuthzDecisionQueryTypeMarshaller(String targetNamespaceURI, String targetLocalName)
+ {
+ super(targetNamespaceURI, targetLocalName);
+ }
+
+ /** {@inheritDoc} */
+ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException
+ {
+ super.marshallAttributes(samlObject, domElement);
+ }
+}
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeUnMarshaller.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeUnMarshaller.java (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/impl/XACMLAuthzDecisionQueryTypeUnMarshaller.java 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.security.xacml.saml.integration.opensaml.impl;
+
+import java.io.IOException;
+
+import org.jboss.security.xacml.factories.RequestResponseContextFactory;
+import org.jboss.security.xacml.interfaces.RequestContext;
+import org.jboss.security.xacml.interfaces.XACMLConstants;
+import org.jboss.security.xacml.saml.integration.opensaml.types.XACMLAuthzDecisionQueryType;
+import org.opensaml.saml2.core.impl.RequestAbstractTypeUnmarshaller;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.w3c.dom.Element;
+
+
+/**
+ * Unmarshaller
+ * @author Anil.Saldhana at redhat.com
+ * @since Mar 28, 2008
+ * @version $Revision$
+ */
+public class XACMLAuthzDecisionQueryTypeUnMarshaller
+extends RequestAbstractTypeUnmarshaller
+{
+ /** Constructor. */
+ public XACMLAuthzDecisionQueryTypeUnMarshaller()
+ {
+ super();
+ }
+
+ /**
+ * Constructor.
+ */
+ protected XACMLAuthzDecisionQueryTypeUnMarshaller(String targetNamespaceURI, String targetLocalName)
+ {
+ super(targetNamespaceURI, targetLocalName);
+ }
+
+ /** {@inheritDoc} */
+ protected void processChildElement(XMLObject parentObject,
+ XMLObject childObject) throws UnmarshallingException
+ {
+ XACMLAuthzDecisionQueryType xacmlauthzdecisionquery = (XACMLAuthzDecisionQueryType) parentObject;
+
+ if (childObject instanceof RequestContext) {
+ xacmlauthzdecisionquery.setRequest((RequestContext) childObject);
+ } else {
+ super.processChildElement(parentObject, childObject);
+ }
+ }
+
+ @Override
+ protected void unmarshallChildElement(XMLObject xmlObject, Element childElement) throws UnmarshallingException
+ {
+ XACMLAuthzDecisionQueryType xacmlAuthzDecisionQueryType = null;
+ if(xmlObject instanceof XACMLAuthzDecisionQueryType)
+ {
+ xacmlAuthzDecisionQueryType = (XACMLAuthzDecisionQueryType) xmlObject;
+ }
+ if(childElement.getLocalName().equals("Request")
+ && childElement.getNamespaceURI().equals(XACMLConstants.CONTEXT_SCHEMA))
+ {
+ //process the xacml request
+ RequestContext requestContext = RequestResponseContextFactory.createRequestCtx();
+ try
+ {
+ requestContext.readRequest(childElement);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ xacmlAuthzDecisionQueryType.setRequest(requestContext);
+ }
+ else
+ super.unmarshallChildElement(xmlObject, childElement);
+ }
+}
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/request/SAMLRequest.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/request/SAMLRequest.java (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/request/SAMLRequest.java 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.security.xacml.saml.integration.opensaml.request;
+
+import java.io.File;
+
+import org.jboss.security.xacml.saml.integration.opensaml.util.DOMUtil;
+import org.jboss.security.xacml.saml.integration.opensaml.util.SAML2Util;
+import org.opensaml.common.SAMLObject;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Represents a SAML Request
+ * @author Anil.Saldhana at redhat.com
+ * @since Mar 27, 2008
+ * @version $Revision$
+ */
+public class SAMLRequest
+{
+ public SAMLObject getSAMLRequest(String requestFile) throws Exception
+ {
+ Document document = DOMUtil.parse(new File(requestFile), true);
+ if(document == null)
+ throw new IllegalStateException("Document parsed is null");
+
+ SAML2Util util = new SAML2Util();
+ Element docElement = document.getDocumentElement();
+ if(docElement == null)
+ throw new IllegalStateException("Document Element is null");
+ return (SAMLObject) util.toXMLObject(docElement);
+ }
+}
\ No newline at end of file
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/types/XACMLAuthzDecisionQueryType.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/types/XACMLAuthzDecisionQueryType.java (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/types/XACMLAuthzDecisionQueryType.java 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.security.xacml.saml.integration.opensaml.types;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.security.xacml.interfaces.RequestContext;
+import org.jboss.security.xacml.saml.integration.opensaml.constants.SAMLXACMLConstants;
+import org.jboss.security.xacml.saml.integration.opensaml.core.XACMLObject;
+import org.opensaml.saml2.core.RequestAbstractType;
+import org.opensaml.xml.schema.XSBooleanValue;
+
+/**
+ * Represents a type for XACML authorization query request
+ * @author Anil.Saldhana at redhat.com
+ * @since Mar 27, 2008
+ * @version $Revision$
+ */
+public interface XACMLAuthzDecisionQueryType extends RequestAbstractType, XACMLObject
+{
+ /** Element local name. */
+ public static final String DEFAULT_ELEMENT_LOCAL_NAME = "XACMLAuthzDecisionQuery";
+
+ /** Default element name for XACML 1.0. */
+ public static final QName DEFAULT_ELEMENT_NAME_XACML10 = new QName(SAMLXACMLConstants.SAML2_XACML10P_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, SAMLXACMLConstants.SAML2_XACMLPROTOCOL_PREFIX);
+
+ /** Default element name for XACML 1.1. */
+ public static final QName DEFAULT_ELEMENT_NAME_XACML11 = new QName(SAMLXACMLConstants.SAML2_XACML1_1P_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, SAMLXACMLConstants.SAML2_XACMLPROTOCOL_PREFIX);
+
+ /** Default element name for XACML 2.0. */
+ public static final QName DEFAULT_ELEMENT_NAME_XACML20 = new QName(SAMLXACMLConstants.SAMLP,
+ DEFAULT_ELEMENT_LOCAL_NAME, SAMLXACMLConstants.SAML2_XACMLPROTOCOL_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "XACMLAuthzDecisionQueryType";
+
+ /** QName of the XSI type.XACML1.0. */
+ public static final QName TYPE_NAME_XACML10 = new QName(SAMLXACMLConstants.SAML2_XACML10P_NS, TYPE_LOCAL_NAME,
+ SAMLXACMLConstants.SAML2_XACMLPROTOCOL_PREFIX);
+
+ /** QName of the XSI type.XACML1.1. */
+ public static final QName TYPE_NAME_XACML11 = new QName(SAMLXACMLConstants.SAML2_XACML1_1P_NS, TYPE_LOCAL_NAME,
+ SAMLXACMLConstants.SAML2_XACMLPROTOCOL_PREFIX);
+
+ /** QName of the XSI type.XACML2.0. */
+ public static final QName TYPE_NAME_XACML20 = new QName(SAMLXACMLConstants.SAML2_XACML20P_NS, TYPE_LOCAL_NAME,
+ SAMLXACMLConstants.SAML2_XACMLPROTOCOL_PREFIX);
+
+ /** CombinePolicies attribute name. */
+ public static final String COMBINEPOLICIES_ATTRIB_NAME = "CombinePolicies";
+
+ /**
+ * Returns if the PDP can combine policies from the query and local policies.
+ *
+ * @return XSBooleanValue true if the PDP can combine policies from the query and locally
+ */
+ public XSBooleanValue getCombinePolicies();
+
+ /**
+ * Gets the request of the query.
+ *
+ * @return RequestContext The request inside the query
+ */
+ public RequestContext getRequest();
+
+ /**
+ * Returns if the PDP can combine policies from the query and local policies.
+ *
+ * @return true if the PDP can combine policies from the query and locally
+ */
+ public boolean isCombinePolicies();
+
+ /**
+ * Sets if the PDP can combine policies from this query and the one locally.
+ *
+ * @param combinePolicies If true then the PDP can combine policies from this query and the one locally
+ */
+ public void setCombinePolicies(XSBooleanValue combinePolicies);
+
+ /**
+ * Set's the XACML Request.
+ *
+ * @param request The request of the decision query
+ */
+ public void setRequest(RequestContext request);
+}
\ No newline at end of file
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/types/XACMLAuthzDecisionStatementType.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/types/XACMLAuthzDecisionStatementType.java (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/types/XACMLAuthzDecisionStatementType.java 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.security.xacml.saml.integration.opensaml.types;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.security.xacml.core.model.context.RequestType;
+import org.jboss.security.xacml.core.model.context.ResponseType;
+import org.jboss.security.xacml.saml.integration.opensaml.constants.SAMLXACMLConstants;
+import org.opensaml.saml2.core.Statement;
+
+//$Id$
+
+/**
+ * Represents a decision from XACML PDP
+ * @author Anil.Saldhana at redhat.com
+ * @since Mar 27, 2008
+ * @version $Revision$
+ */
+public interface XACMLAuthzDecisionStatementType extends Statement
+{
+ /** Element local name. */
+ String DEFAULT_ELEMENT_LOCAL_NAME = "XACMLAuthzDecisionStatement";
+
+ /** Default element name for XACML 1.0. */
+ QName DEFAULT_ELEMENT_NAME_XACML10 = new QName(SAMLXACMLConstants.SAML2_XACML10P_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, SAMLXACMLConstants.SAML2_XACMLPROTOCOL_PREFIX);
+
+ /** Default element name for XACML 1.1. */
+ QName DEFAULT_ELEMENT_NAME_XACML11 = new QName(SAMLXACMLConstants.SAML2_XACML1_1P_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, SAMLXACMLConstants.SAML2_XACMLPROTOCOL_PREFIX);
+
+ /** Default element name for XACML 2.0. */
+ QName DEFAULT_ELEMENT_NAME_XACML20 = new QName(SAMLXACMLConstants.SAML2_XACML20P_NS,
+ DEFAULT_ELEMENT_LOCAL_NAME, SAMLXACMLConstants.SAML2_XACMLPROTOCOL_PREFIX);
+
+ /** Local name of the XSI type. */
+ public static final String TYPE_LOCAL_NAME = "XACMLAuthzDecisionStatementType";
+
+ /** QName of the XSI type.XACML1.0. */
+ QName TYPE_NAME_XACML10 = new QName(SAMLXACMLConstants.SAML2_XACML10P_NS, TYPE_LOCAL_NAME,
+ SAMLXACMLConstants.SAML2_XACMLPROTOCOL_PREFIX);
+
+ /** QName of the XSI type.XACML1.1. */
+ QName TYPE_NAME_XACML11 = new QName(SAMLXACMLConstants.SAML2_XACML1_1P_NS, TYPE_LOCAL_NAME,
+ SAMLXACMLConstants.SAML2_XACMLPROTOCOL_PREFIX);
+
+ /** QName of the XSI type.XACML2.0. */
+ QName TYPE_NAME_XACML20 = new QName(SAMLXACMLConstants.SAML2_XACML20P_NS, TYPE_LOCAL_NAME,
+ SAMLXACMLConstants.SAML2_XACMLPROTOCOL_PREFIX);
+
+ /** CombinePolicies attribute name. */
+ String COMBINEPOLICIES_ATTRIB_NAME = "CombinePolicies";
+
+
+ public RequestType getRequest();
+
+ public ResponseType getResponse();
+
+ public void setRequest(RequestType request);
+
+ public void setResponse(ResponseType response);
+}
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/util/DOMUtil.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/util/DOMUtil.java (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/util/DOMUtil.java 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.security.xacml.saml.integration.opensaml.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+
+import org.opensaml.xml.parse.BasicParserPool;
+import org.w3c.dom.Document;
+
+/**
+ * DOM util class
+ * @author Anil.Saldhana at redhat.com
+ * @since Mar 27, 2008
+ * @version $Revision$
+ */
+public class DOMUtil
+{
+
+ public static Document parse(File xmlFile, boolean validating) throws Exception
+ {
+ FileInputStream fis = null;
+
+ try
+ {
+ BasicParserPool parser = new BasicParserPool();
+ parser.setNamespaceAware(true);
+ fis = new FileInputStream(xmlFile);
+ return parser.parse(fis);
+ }
+ catch (Exception e)
+ {
+ throw e;
+ }
+ finally
+ {
+ if(fis != null)
+ fis.close();
+ }
+ }
+}
\ No newline at end of file
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/util/SAML2Util.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/util/SAML2Util.java (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/src/main/java/org/jboss/security/xacml/saml/integration/opensaml/util/SAML2Util.java 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.security.xacml.saml.integration.opensaml.util;
+
+import javax.xml.namespace.QName;
+
+import org.joda.time.DateTime;
+import org.joda.time.chrono.ISOChronology;
+import org.opensaml.xml.Configuration;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.XMLObjectBuilder;
+import org.opensaml.xml.io.Marshaller;
+import org.opensaml.xml.io.MarshallingException;
+import org.opensaml.xml.io.Unmarshaller;
+import org.opensaml.xml.io.UnmarshallerFactory;
+import org.opensaml.xml.io.UnmarshallingException;
+import org.opensaml.xml.schema.XSString;
+import org.opensaml.xml.util.XMLHelper;
+import org.w3c.dom.Element;
+
+/**
+ * Utility class to create OpenSAML2 objects
+ * @author Anil.Saldhana at redhat.com
+ * @since Mar 27, 2008
+ * @version $Revision$
+ */
+public class SAML2Util
+{
+ public SAML2Util()
+ {
+ super();
+ }
+
+ public XMLObjectBuilder<?> getBuilder(QName qname)
+ {
+ return Configuration.getBuilderFactory().getBuilder(qname);
+ }
+
+ public XMLObject buildXMLObject(QName qname)
+ {
+ XMLObjectBuilder<?> ob = getBuilder(qname);
+ return ob.buildObject(qname.getNamespaceURI(), qname.getLocalPart(), qname.getPrefix());
+ }
+
+ public XSString buildXSString(QName qname)
+ {
+ XMLObjectBuilder<?> stringBuilder = getBuilder(XSString.TYPE_NAME);
+ return (XSString) stringBuilder.buildObject(qname, XSString.TYPE_NAME);
+ }
+
+ public DateTime getIssueInstant()
+ {
+ return new DateTime(ISOChronology.getInstanceUTC());
+ }
+
+ public Element toElement(XMLObject xmlObj) throws MarshallingException
+ {
+ Marshaller marshaller = Configuration.getMarshallerFactory().getMarshaller(xmlObj);
+ return marshaller.marshall(xmlObj);
+ }
+
+ public String toString(XMLObject xmlObj) throws MarshallingException
+ {
+ return XMLHelper.prettyPrintXML(toElement(xmlObj));
+ }
+
+ public XMLObject toXMLObject(Element element) throws UnmarshallingException
+ {
+ if(element ==null)
+ throw new IllegalArgumentException("Null Element");
+ UnmarshallerFactory factory = Configuration.getUnmarshallerFactory();
+ Unmarshaller unmarshaller = factory.getUnmarshaller(element);
+ if(unmarshaller == null)
+ throw new IllegalStateException("Unmarshaller for element "+element.getLocalName()
+ + " is null");
+ return unmarshaller.unmarshall(element);
+ }
+}
\ No newline at end of file
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/org/jboss/test/security/xacml/saml/SAMLXACMLUnitTestCase.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/org/jboss/test/security/xacml/saml/SAMLXACMLUnitTestCase.java (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/org/jboss/test/security/xacml/saml/SAMLXACMLUnitTestCase.java 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.security.xacml.saml;
+
+import junit.framework.TestCase;
+
+import org.jboss.security.xacml.core.PDPConfiguration;
+import org.jboss.security.xacml.interfaces.RequestContext;
+import org.jboss.security.xacml.saml.integration.opensaml.impl.XACMLAuthzDecisionQueryTypeImplBuilder;
+import org.jboss.security.xacml.saml.integration.opensaml.impl.XACMLAuthzDecisionQueryTypeMarshaller;
+import org.jboss.security.xacml.saml.integration.opensaml.impl.XACMLAuthzDecisionQueryTypeUnMarshaller;
+import org.jboss.security.xacml.saml.integration.opensaml.request.SAMLRequest;
+import org.jboss.security.xacml.saml.integration.opensaml.types.XACMLAuthzDecisionQueryType;
+import org.opensaml.Configuration;
+import org.opensaml.common.SAMLObject;
+import org.opensaml.xml.XMLObject;
+import org.opensaml.xml.io.Marshaller;
+import org.opensaml.xml.util.XMLHelper;
+
+/**
+ * Unit Test for the Opensaml saml/xacml
+ * @author Anil.Saldhana at redhat.com
+ * @since Mar 27, 2008
+ * @version $Revision$
+ */
+public class SAMLXACMLUnitTestCase extends TestCase
+{
+ protected void setUp() throws Exception
+ {
+ org.opensaml.DefaultBootstrap.bootstrap();
+ Configuration.registerObjectProvider(XACMLAuthzDecisionQueryType.DEFAULT_ELEMENT_NAME_XACML20,
+ new XACMLAuthzDecisionQueryTypeImplBuilder(),
+ new XACMLAuthzDecisionQueryTypeMarshaller(),
+ new XACMLAuthzDecisionQueryTypeUnMarshaller(),
+ null);
+ }
+
+ public void testSAMLXACMLRequestRead() throws Exception
+ {
+ //Install Custom Attributes
+ PDPConfiguration.installSingleValueAttribute("urn:va:names:xacml:2.0:subject:ien");
+
+ SAMLRequest request = new SAMLRequest();
+ SAMLObject samlObject = request.getSAMLRequest("src/tests/resources/saml/xacmlrequest.xml");
+ assertNotNull(samlObject);
+ assertTrue(samlObject instanceof XACMLAuthzDecisionQueryType);
+ XACMLAuthzDecisionQueryType xacmlRequest = (XACMLAuthzDecisionQueryType)samlObject;
+ RequestContext requestType = xacmlRequest.getRequest();
+ assertNotNull("XACML Request is not null", requestType);
+
+ XMLObject xmlObject = xacmlRequest;
+ Marshaller marshaller = Configuration.getMarshallerFactory().getMarshaller(xmlObject);
+ //surefire plugin issue
+ try
+ {
+ System.out.println(XMLHelper.prettyPrintXML(marshaller.marshall(xmlObject)));
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void testSAMLRequestRead() throws Exception
+ {
+ SAMLRequest request = new SAMLRequest();
+ SAMLObject samlObject = request.getSAMLRequest("src/tests/resources/saml/samlrequest.xml");
+ assertNotNull(samlObject);
+ }
+}
\ No newline at end of file
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/resolver.jar
===================================================================
(Binary files differ)
Property changes on: projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/resolver.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/serializer.jar
===================================================================
(Binary files differ)
Property changes on: projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/serializer.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/xalan.jar
===================================================================
(Binary files differ)
Property changes on: projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/xalan.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/xercesImpl.jar
===================================================================
(Binary files differ)
Property changes on: projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/xercesImpl.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/xml-apis.jar
===================================================================
(Binary files differ)
Property changes on: projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/endorsed/xml-apis.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/saml/samlrequest.xml
===================================================================
(Binary files differ)
Property changes on: projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/saml/samlrequest.xml
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/saml/xacmlrequest.xml
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/saml/xacmlrequest.xml (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml-saml/src/tests/resources/saml/xacmlrequest.xml 2008-03-28 23:23:33 UTC (rev 71409)
@@ -0,0 +1,49 @@
+<samlp:RequestAbstract xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
+xsi:type="xacml-samlp:XACMLAuthzDecisionQuery"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:xacml-samlp="urn:oasis:xacml:2.0:saml:protocol:schema:os"
+xacml-samlp:InputContextOnly="true"
+xacml-samlp:ReturnContext="true"
+ID="s2846efb514a944cc3dc5b65ed8a76dde449787617" Version="2.0"
+IssueInstant="2008-03-19T22:18:42Z" Destination="destination-uri">
+<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">vaPepEntity</saml:Issuer>
+<xacml-context:Request xmlns:xacml-context="urn:oasis:names:tc:xacml:2.0:context:schema:os"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/"
+xsi:schemaLocation="urn:oasis:names:tc:xacml:2.0:context:schema:os http://docs.oasis-open.org/xacml/access_control-xacml-2.0-context-schema-os.xsd">
+<Subject SubjectCategory="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
+<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id"
+DataType="urn:va:names:xacml:2.0:subject:ien" >
+<AttributeValue>100001</AttributeValue>
+</Attribute>
+<Attribute AttributeId="urn:va:names:xacml:2.0:subject:role"
+DataType="http://www.w3.org/2001/XMLSchema#string" >
+<AttributeValue>Chief Resident</AttributeValue>
+<AttributeValue>Doctor</AttributeValue>
+</Attribute>
+<Attribute AttributeId="urn:va:names:xacml:2.0:subject:hl7permission"
+DataType="http://www.w3.org/2001/XMLSchema#string" >
+<AttributeValue>PRD-017</AttributeValue>
+<AttributeValue>PRD-003</AttributeValue>
+<AttributeValue>PRD-010</AttributeValue>
+<AttributeValue>PRD-006</AttributeValue>
+</Attribute>
+<Attribute AttributeId="urn:va:names:xacml:2.0:subject:locality"
+DataType="http://www.w3.org/2001/XMLSchema#string" >
+<AttributeValue>Facility A</AttributeValue>
+</Attribute>
+</Subject>
+<xacml-context:Resource>
+<Attribute AttributeId="urn:va:names:xacml:2.0:record_type"
+DataType="http://www.w3.org/2001/XMLSchema#string" >
+<AttributeValue>patientchart</AttributeValue>
+</Attribute>
+</xacml-context:Resource>
+<xacml-context:Action>
+<Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"
+DataType="http://www.w3.org/2001/XMLSchema#string" >
+<AttributeValue>read</AttributeValue>
+</Attribute>
+</xacml-context:Action>
+<xacml-context:Environment></xacml-context:Environment>
+</xacml-context:Request>
+</samlp:RequestAbstract>
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list