Author: sohil.shah(a)jboss.com
Date: 2009-09-08 18:17:14 -0400 (Tue, 08 Sep 2009)
New Revision: 774
Added:
authz/trunk/public-api/src/main/java/org/jboss/security/authz/component/BooleanExpression.java
Removed:
authz/trunk/public-api/src/main/java/org/jboss/security/authz/component/LogicExpression.java
Modified:
authz/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/AnnotationProcessor.java
authz/trunk/core-components/src/main/java/org/jboss/security/authz/components/subject/Roles.java
authz/trunk/documentation/reference-guide/en/modules/authz-component-spec.xml
Log:
some refactoring/documentation
Modified:
authz/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/AnnotationProcessor.java
===================================================================
---
authz/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/AnnotationProcessor.java 2009-09-08
18:05:46 UTC (rev 773)
+++
authz/trunk/agent/src/main/java/org/jboss/security/authz/agent/services/AnnotationProcessor.java 2009-09-08
22:17:14 UTC (rev 774)
@@ -30,7 +30,7 @@
import org.jboss.security.authz.component.Component;
import org.jboss.security.authz.component.ComponentCategory;
import org.jboss.security.authz.component.SecurityContextData;
-import org.jboss.security.authz.component.LogicExpression;
+import org.jboss.security.authz.component.BooleanExpression;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
@@ -82,7 +82,7 @@
{
for(Method declaredMethod: declaredMethods)
{
- Annotation logicExpression = declaredMethod.getAnnotation(LogicExpression.class);
+ Annotation logicExpression = declaredMethod.getAnnotation(BooleanExpression.class);
if(logicExpression != null)
{
if(declaredMethod.getName().equals(expressionName))
Modified:
authz/trunk/core-components/src/main/java/org/jboss/security/authz/components/subject/Roles.java
===================================================================
---
authz/trunk/core-components/src/main/java/org/jboss/security/authz/components/subject/Roles.java 2009-09-08
18:05:46 UTC (rev 773)
+++
authz/trunk/core-components/src/main/java/org/jboss/security/authz/components/subject/Roles.java 2009-09-08
22:17:14 UTC (rev 774)
@@ -32,7 +32,7 @@
import org.jboss.security.authz.component.ComponentType;
import org.jboss.security.authz.component.ComponentCategory;
import org.jboss.security.authz.component.SecurityContextData;
-import org.jboss.security.authz.component.LogicExpression;
+import org.jboss.security.authz.component.BooleanExpression;
/**
* The Role Policy Component represents the "Roles" that are assigned to users
of a System
@@ -143,7 +143,7 @@
*
* @return the rule
*/
- @LogicExpression
+ @BooleanExpression
public String[] allowExpression()
{
String ruleReference =
"roles://allowRule/"+GeneralTool.generateUniqueId();
@@ -174,7 +174,7 @@
*
* @return the rule
*/
- @LogicExpression
+ @BooleanExpression
public String[] denyExpression()
{
String ruleReference = "roles://denyRule/"+GeneralTool.generateUniqueId();
Modified: authz/trunk/documentation/reference-guide/en/modules/authz-component-spec.xml
===================================================================
---
authz/trunk/documentation/reference-guide/en/modules/authz-component-spec.xml 2009-09-08
18:05:46 UTC (rev 773)
+++
authz/trunk/documentation/reference-guide/en/modules/authz-component-spec.xml 2009-09-08
22:17:14 UTC (rev 774)
@@ -129,10 +129,30 @@
that the application state of the annotated field should be used during both,
Enforcement Phase as well as Provisioning Phase of the framework.
</para>
</sect2>
- <sect2 id="LogicExpression">
- <title>LogicExpression</title>
+ <sect2 id="BooleanExpression">
+ <title>BooleanExpression</title>
<para>
+ <emphasis role="bold">BooleanExpression</emphasis> is a
<emphasis>Method-level</emphasis> annotation that indicates component methods
that generate the
+ <emphasis>boolean expression</emphasis> that can be optionally
associated with one or more <link
linkend="concepts.rule">Rule</link> associated with a
+ policy
</para>
+ <para>
+ The framework supports the following expression formats:
+ <itemizedlist>
+ <listitem>
+ <emphasis role="bold">Native XACML format:</emphasis> The
system supports expressions constructed in XACML spec based XML. However, experience has
shown that
+ using XML as an expression language is tedious and error prone. So other
expression formats are supported as extensions to the rule engine.
+ </listitem>
+ <listitem>
+ <emphasis role="bold">Drools DRL format:</emphasis> The
<ulink
url="http://jboss.org/drools/">Drools Rule Engine</ulink> is
integrated
+ as an extension to the core XACML rule engine, to allow <emphasis>boolean
expressions</emphasis> specified in the DRL format
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ <emphasis role="bold">Note:</emphasis> Supporting
<emphasis>boolean expressions</emphasis> in the most natural way using
<emphasis>Pure Java code</emphasis>
+ via the <ulink
url="http://www.beanshell.org/">BeanShell</ulink> light-weight
scripting environment is in the works.
+ </para>
</sect2>
</sect1>
</chapter>
Copied:
authz/trunk/public-api/src/main/java/org/jboss/security/authz/component/BooleanExpression.java
(from rev 773,
authz/trunk/public-api/src/main/java/org/jboss/security/authz/component/LogicExpression.java)
===================================================================
---
authz/trunk/public-api/src/main/java/org/jboss/security/authz/component/BooleanExpression.java
(rev 0)
+++
authz/trunk/public-api/src/main/java/org/jboss/security/authz/component/BooleanExpression.java 2009-09-08
22:17:14 UTC (rev 774)
@@ -0,0 +1,37 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, 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.authz.component;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+(a)Target(ElementType.METHOD)
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface BooleanExpression
+{
+
+}
Property changes on:
authz/trunk/public-api/src/main/java/org/jboss/security/authz/component/BooleanExpression.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted:
authz/trunk/public-api/src/main/java/org/jboss/security/authz/component/LogicExpression.java
===================================================================
---
authz/trunk/public-api/src/main/java/org/jboss/security/authz/component/LogicExpression.java 2009-09-08
18:05:46 UTC (rev 773)
+++
authz/trunk/public-api/src/main/java/org/jboss/security/authz/component/LogicExpression.java 2009-09-08
22:17:14 UTC (rev 774)
@@ -1,37 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, 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.authz.component;
-
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- */
-(a)Target(ElementType.METHOD)
-(a)Retention(RetentionPolicy.RUNTIME)
-public @interface LogicExpression
-{
-
-}