[jboss-cvs] JBossAS SVN: r71261 - in projects/security/security-xacml/trunk/jboss-xacml: src/resources/test/policies/rsaconf and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Mar 25 15:24:01 EDT 2008
Author: anil.saldhana at jboss.com
Date: 2008-03-25 15:24:01 -0400 (Tue, 25 Mar 2008)
New Revision: 71261
Added:
projects/security/security-xacml/trunk/jboss-xacml/src/resources/test/requests/interop/rsaconf08/
projects/security/security-xacml/trunk/jboss-xacml/src/resources/test/requests/interop/rsaconf08/NCode_request_01.xml
projects/security/security-xacml/trunk/jboss-xacml/src/resources/test/requests/interop/rsaconf08/UCode_request_01.xml
projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/interop/rsaconf/PhysicianUnitTestCase.java
Modified:
projects/security/security-xacml/trunk/jboss-xacml/.classpath
projects/security/security-xacml/trunk/jboss-xacml/src/resources/test/policies/rsaconf/XacmlPolicySet-02c-N-PermCollections.xml
projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/bindings/web/HttpRequestUtil.java
projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/bindings/web/WebPEP.java
projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/factories/util/XACMLTestUtil.java
projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/interop/rsaconf/RSAConferenceTestCase.java
Log:
jboss-sunxacml and interop related
Modified: projects/security/security-xacml/trunk/jboss-xacml/.classpath
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml/.classpath 2008-03-25 19:22:48 UTC (rev 71260)
+++ projects/security/security-xacml/trunk/jboss-xacml/.classpath 2008-03-25 19:24:01 UTC (rev 71261)
@@ -7,9 +7,9 @@
<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/sun-xacml/sun-xacml/2.0/sun-xacml-2.0.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/jboss/jboss-javaee/5.0.0-SNAPSHOT/jboss-javaee-5.0.0-SNAPSHOT.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jboss-sunxacml"/>
<classpathentry kind="output" path="target/eclipse-classes"/>
</classpath>
Modified: projects/security/security-xacml/trunk/jboss-xacml/src/resources/test/policies/rsaconf/XacmlPolicySet-02c-N-PermCollections.xml
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml/src/resources/test/policies/rsaconf/XacmlPolicySet-02c-N-PermCollections.xml 2008-03-25 19:22:48 UTC (rev 71260)
+++ projects/security/security-xacml/trunk/jboss-xacml/src/resources/test/policies/rsaconf/XacmlPolicySet-02c-N-PermCollections.xml 2008-03-25 19:24:01 UTC (rev 71261)
@@ -26,7 +26,7 @@
DataType="http://www.w3.org/2001/XMLSchema#anyURI"
>urn:oasis:names:tc:xacml:interop:hl7:prd-003</AttributeValue>
<SubjectAttributeDesignator
- AttributeId="urn:oasis:names:tc:xacml:2.0:subject:hl7:permission"
+ AttributeId="urn:xacml:2.0:interop:example:subject:hl7:permission"
DataType="http://www.w3.org/2001/XMLSchema#anyURI"/>
</SubjectMatch>
<SubjectMatch
@@ -35,7 +35,7 @@
DataType="http://www.w3.org/2001/XMLSchema#anyURI"
>urn:oasis:names:tc:xacml:interop:hl7:prd-005</AttributeValue>
<SubjectAttributeDesignator
- AttributeId="urn:oasis:names:tc:xacml:2.0:subject:hl7:permission"
+ AttributeId="urn:xacml:2.0:interop:example:subject:hl7:permission"
DataType="http://www.w3.org/2001/XMLSchema#anyURI"/>
</SubjectMatch>
<SubjectMatch
@@ -44,7 +44,7 @@
DataType="http://www.w3.org/2001/XMLSchema#anyURI"
>urn:oasis:names:tc:xacml:interop:hl7:prd-006</AttributeValue>
<SubjectAttributeDesignator
- AttributeId="urn:oasis:names:tc:xacml:2.0:subject:hl7:permission"
+ AttributeId="urn:xacml:2.0:interop:example:subject:hl7:permission"
DataType="http://www.w3.org/2001/XMLSchema#anyURI"/>
</SubjectMatch>
<SubjectMatch
@@ -53,7 +53,7 @@
DataType="http://www.w3.org/2001/XMLSchema#anyURI"
>urn:oasis:names:tc:xacml:interop:hl7:prd-009</AttributeValue>
<SubjectAttributeDesignator
- AttributeId="urn:oasis:names:tc:xacml:2.0:subject:hl7:permission"
+ AttributeId="urn:xacml:2.0:interop:example:subject:hl7:permission"
DataType="http://www.w3.org/2001/XMLSchema#anyURI"/>
</SubjectMatch>
<SubjectMatch
@@ -62,7 +62,7 @@
DataType="http://www.w3.org/2001/XMLSchema#anyURI"
>urn:oasis:names:tc:xacml:interop:hl7:prd-010</AttributeValue>
<SubjectAttributeDesignator
- AttributeId="urn:oasis:names:tc:xacml:2.0:subject:hl7:permission"
+ AttributeId="urn:xacml:2.0:interop:example:subject:hl7:permission"
DataType="http://www.w3.org/2001/XMLSchema#anyURI"/>
</SubjectMatch>
<SubjectMatch
@@ -71,7 +71,7 @@
DataType="http://www.w3.org/2001/XMLSchema#anyURI"
>urn:oasis:names:tc:xacml:interop:hl7:prd-012</AttributeValue>
<SubjectAttributeDesignator
- AttributeId="urn:oasis:names:tc:xacml:2.0:subject:hl7:permission"
+ AttributeId="urn:xacml:2.0:interop:example:subject:hl7:permission"
DataType="http://www.w3.org/2001/XMLSchema#anyURI"/>
</SubjectMatch>
<SubjectMatch
@@ -80,7 +80,7 @@
DataType="http://www.w3.org/2001/XMLSchema#anyURI"
>urn:oasis:names:tc:xacml:interop:hl7:prd-017</AttributeValue>
<SubjectAttributeDesignator
- AttributeId="urn:oasis:names:tc:xacml:2.0:subject:hl7:permission"
+ AttributeId="urn:xacml:2.0:interop:example:subject:hl7:permission"
DataType="http://www.w3.org/2001/XMLSchema#anyURI"/>
</SubjectMatch>
</Subject>
Added: projects/security/security-xacml/trunk/jboss-xacml/src/resources/test/requests/interop/rsaconf08/NCode_request_01.xml
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml/src/resources/test/requests/interop/rsaconf08/NCode_request_01.xml (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml/src/resources/test/requests/interop/rsaconf08/NCode_request_01.xml 2008-03-25 19:24:01 UTC (rev 71261)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Request
+ xmlns="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">
+ <!-- Sample request. In this case a physician is trying to access -->
+ <!-- The medical record of a patient. The record has been marked -->
+ <!-- with both the CDA and N confidentiality codes and -->
+ <!-- there is a registered consent for the record. -->
+ <Subject>
+ <Attribute
+ AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id"
+ DataType="http://www.w3.org/2001/XMLSchema#string">
+ <AttributeValue>Dr. Alice</AttributeValue>
+ </Attribute>
+ <Attribute
+ AttributeId="urn:xacml:2.0:interop:example:subject:hl7:permission"
+ DataType="http://www.w3.org/2001/XMLSchema#string">
+ <AttributeValue>urn:xacml:2.0:interop:example:hl7:prd-003</AttributeValue>
+ <AttributeValue>urn:xacml:2.0:interop:example:hl7:prd-005</AttributeValue>
+ <AttributeValue>urn:xacml:2.0:interop:example:hl7:prd-006</AttributeValue>
+ <AttributeValue>urn:xacml:2.0:interop:example:hl7:prd-009</AttributeValue>
+ <AttributeValue>urn:xacml:2.0:interop:example:hl7:prd-010</AttributeValue>
+ <AttributeValue>urn:xacml:2.0:interop:example:hl7:prd-012</AttributeValue>
+ <AttributeValue>urn:xacml:2.0:interop:example:hl7:prd-017</AttributeValue>
+ </Attribute>
+ </Subject>
+ <Resource>
+ <Attribute
+ AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
+ DataType="http://www.w3.org/2001/XMLSchema#string">
+ <AttributeValue>Anthony Gurrola</AttributeValue>
+ </Attribute>
+ <Attribute
+ AttributeId="urn:xacml:2.0:interop:example:resource:hl7:permission"
+ DataType="http://www.w3.org/2001/XMLSchema#string">
+ <AttributeValue>urn:xacml:2.0:interop:example:hl7:prd-003</AttributeValue>
+ <AttributeValue>urn:xacml:2.0:interop:example:hl7:prd-005</AttributeValue>
+ <AttributeValue>urn:xacml:2.0:interop:example:hl7:prd-006</AttributeValue>
+ <AttributeValue>urn:xacml:2.0:interop:example:hl7:prd-009</AttributeValue>
+ <AttributeValue>urn:xacml:2.0:interop:example:hl7:prd-010</AttributeValue>
+ <AttributeValue>urn:xacml:2.0:interop:example:hl7:prd-012</AttributeValue>
+ <AttributeValue>urn:xacml:2.0:interop:example:hl7:prd-017</AttributeValue>
+ </Attribute>
+ <Attribute
+ AttributeId="urn:xacml:2.0:interop:example:resource:hl7:confidentiality-code"
+ DataType="http://www.w3.org/2001/XMLSchema#string">
+ <AttributeValue>UBA</AttributeValue>
+ </Attribute>
+ <Attribute
+ AttributeId="urn:xacml:2.0:interop:example:resource:hl7:dissented-subject-id"
+ DataType="http://www.w3.org/2001/XMLSchema#string">
+ <AttributeValue>Dr. Alice</AttributeValue>
+ </Attribute>
+ <Attribute
+ AttributeId="urn:xacml:2.0:interop:example:resource:type"
+ DataType="http://www.w3.org/2001/XMLSchema#string">
+ <AttributeValue
+ >urn:xacml:2.0:interop:example:resource:hl7:medical-record</AttributeValue>
+ </Attribute>
+ </Resource>
+ <Action/>
+ <Environment/>
+</Request>
\ No newline at end of file
Added: projects/security/security-xacml/trunk/jboss-xacml/src/resources/test/requests/interop/rsaconf08/UCode_request_01.xml
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml/src/resources/test/requests/interop/rsaconf08/UCode_request_01.xml (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml/src/resources/test/requests/interop/rsaconf08/UCode_request_01.xml 2008-03-25 19:24:01 UTC (rev 71261)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Request
+ xmlns="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">
+ <!-- Sample request. In this case a physician is trying to access -->
+ <!-- The medical record of a patient. The record has been marked -->
+ <!-- with both the CDA and U confidentiality codes and -->
+ <!-- there is a registered consent for the record. -->
+ <Subject>
+ <Attribute
+ AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id"
+ DataType="http://www.w3.org/2001/XMLSchema#string">
+ <AttributeValue>Dr. Alice</AttributeValue>
+ </Attribute>
+ <Attribute
+ AttributeId="urn:oasis:names:tc:xacml:2.0:subject:role"
+ DataType="http://www.w3.org/2001/XMLSchema#string">
+ <AttributeValue>urn:xacml:2.0:interop:example:role:hl7:physician</AttributeValue>
+ </Attribute>
+ </Subject>
+ <Resource>
+ <Attribute
+ AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
+ DataType="http://www.w3.org/2001/XMLSchema#string">
+ <AttributeValue
+ >Anthony Gurrola</AttributeValue>
+ </Attribute>
+ <Attribute
+ AttributeId="urn:xacml:2.0:interop:example:resource:hl7:confidentiality-code"
+ DataType="http://www.w3.org/2001/XMLSchema#string">
+ <AttributeValue>UBA</AttributeValue>
+ </Attribute>
+ <Attribute
+ AttributeId="urn:xacml:2.0:interop:example:resource:hl7:dissented-subject-id"
+ DataType="http://www.w3.org/2001/XMLSchema#string">
+ <AttributeValue>Dr. Alice</AttributeValue>
+ </Attribute>
+ <Attribute
+ AttributeId="urn:xacml:2.0:interop:example:resource:type"
+ DataType="http://www.w3.org/2001/XMLSchema#string">
+ <AttributeValue
+ >urn:xacml:2.0:interop:example:resource:hl7:medical-record</AttributeValue>
+ </Attribute>
+ </Resource>
+ <Action/>
+ <Environment/>
+</Request>
\ No newline at end of file
Modified: projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/bindings/web/HttpRequestUtil.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/bindings/web/HttpRequestUtil.java 2008-03-25 19:22:48 UTC (rev 71260)
+++ projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/bindings/web/HttpRequestUtil.java 2008-03-25 19:24:01 UTC (rev 71261)
@@ -67,11 +67,13 @@
return null;
}
- public Enumeration getHeaderNames() {
+ @SuppressWarnings("unchecked")
+ public Enumeration getHeaderNames() {
return null;
}
- public Enumeration getHeaders(String arg0) {
+ @SuppressWarnings("unchecked")
+ public Enumeration getHeaders(String arg0) {
return null;
}
@@ -151,7 +153,8 @@
return null;
}
- public Enumeration getAttributeNames() {
+ @SuppressWarnings("unchecked")
+ public Enumeration getAttributeNames() {
return null;
}
@@ -187,7 +190,8 @@
return null;
}
- public Enumeration getLocales() {
+ @SuppressWarnings("unchecked")
+ public Enumeration getLocales() {
return null;
}
@@ -195,11 +199,13 @@
return null;
}
- public Map getParameterMap() {
+ @SuppressWarnings("unchecked")
+ public Map getParameterMap() {
return null;
}
- public Enumeration getParameterNames() {
+ @SuppressWarnings("unchecked")
+ public Enumeration getParameterNames() {
return null;
}
Modified: projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/bindings/web/WebPEP.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/bindings/web/WebPEP.java 2008-03-25 19:22:48 UTC (rev 71260)
+++ projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/bindings/web/WebPEP.java 2008-03-25 19:24:01 UTC (rev 71261)
@@ -50,6 +50,7 @@
public class WebPEP
{
+ @SuppressWarnings("unchecked")
public RequestContext createXACMLRequest(HttpServletRequest request,
Principal principal, Group roleGroup) throws Exception
{
Modified: projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/factories/util/XACMLTestUtil.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/factories/util/XACMLTestUtil.java 2008-03-25 19:22:48 UTC (rev 71260)
+++ projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/factories/util/XACMLTestUtil.java 2008-03-25 19:24:01 UTC (rev 71261)
@@ -93,7 +93,7 @@
return new Group()
{
- private Vector vect = new Vector();
+ private Vector<Principal> vect = new Vector<Principal>();
public boolean addMember(final Principal principal)
{
Added: projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/interop/rsaconf/PhysicianUnitTestCase.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/interop/rsaconf/PhysicianUnitTestCase.java (rev 0)
+++ projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/interop/rsaconf/PhysicianUnitTestCase.java 2008-03-25 19:24:01 UTC (rev 71261)
@@ -0,0 +1,58 @@
+/*
+ * 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.interop.rsaconf;
+
+import java.io.InputStream;
+
+import org.jboss.security.xacml.core.JBossPDP;
+import org.jboss.security.xacml.interfaces.PolicyDecisionPoint;
+import org.jboss.security.xacml.interfaces.XACMLConstants;
+import org.jboss.test.security.xacml.factories.util.XACMLTestUtil;
+
+import junit.framework.TestCase;
+
+//$Id$
+
+/**
+ *
+ * @author Anil.Saldhana at redhat.com
+ * @since Mar 25, 2008
+ * @version $Revision$
+ */
+public class PhysicianUnitTestCase extends TestCase
+{
+ public void testNConfidentialityCode() throws Exception
+ {
+ int decision = XACMLTestUtil.getDecision(getPDP(),
+ "test/requests/interop/rsaconf08/NCode_request_01.xml");
+ assertEquals(XACMLConstants.DECISION_DENY,decision);
+ }
+
+ private PolicyDecisionPoint getPDP()
+ {
+ ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+ InputStream is = tcl.getResourceAsStream("test/config/rsaConferencePolicySetConfig.xml");
+ assertNotNull("InputStream != null", is);
+
+ return new JBossPDP(is);
+ }
+}
\ No newline at end of file
Modified: projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/interop/rsaconf/RSAConferenceTestCase.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/interop/rsaconf/RSAConferenceTestCase.java 2008-03-25 19:22:48 UTC (rev 71260)
+++ projects/security/security-xacml/trunk/jboss-xacml/src/tests/org/jboss/test/security/xacml/interop/rsaconf/RSAConferenceTestCase.java 2008-03-25 19:24:01 UTC (rev 71261)
@@ -176,6 +176,8 @@
RequestContext request = Util.createRequestWithHL7Permissions(doctor, permissions, patient, confidentialityCodes,
consentedIds, resourceType);
+
+ request.marshall(System.out);
assertEquals("Access Allowed?", XACMLConstants.DECISION_DENY, XACMLTestUtil.getDecision(pdp, request));
}
More information about the jboss-cvs-commits
mailing list