MitchellChu / enterprise-java-xacml

Automatically exported from code.google.com/p/enterprise-java-xacml
0 stars 2 forks source link

AttributeDesignator does not work in AttributeAssignment inside Obligation #72

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This bug report is related to the issue described in my comment
http://code.google.com/p/enterprise-java-xacml/issues/detail?id=30#c4.
I spent some time on debugging this issue as this bug became blocker in my
service development but finally I think I found the reason of the problem.
As I described in mentioned comment:
"It seems my SubjectAttributeDesignator is not evaluated inside
AttributeStatement because of the supportInnerExpression() (inside
AttributeAssignment#evaluate()) method returning false, and in particular
null root and parent element of AttributeStatement. It seems the policy
structure is broken."
In fact not the whole structure of policies hierarchy is broken, but only
the obligation part. In AbtractPolicy#appendPolicyObligationsToResult()
method all obligations are being cloned but the parent references are not set.
This is why the AttributeValue#supportInnerExpression() method returns
false. It calls DefaultXACMLElement#getRootElement() but it cannot reach
proper root element.
The solution seems to be quite obvious: set properly all parent references
for ALL elements nested in obligations including setting the parent element
in each obligation to newly created Obligations element and set this
Obligations object parent element to policy(set) element.

Original issue reported on code.google.com by marek.ho...@gmail.com on 21 Aug 2008 at 11:25

GoogleCodeExporter commented 9 years ago
The only requirement in this scenario will be releasing parent reference of
Obligations element before appending this object into Result.

Original comment by marek.ho...@gmail.com on 21 Aug 2008 at 11:37

GoogleCodeExporter commented 9 years ago
After analyzing DefaultXACMLElement code it seems root elements need to be 
nulled
(before storing Obligations object in Result) as well, because it might be set 
by
DefaultXACMLElement#getRootElement() method.

Original comment by marek.ho...@gmail.com on 21 Aug 2008 at 11:42

GoogleCodeExporter commented 9 years ago

Original comment by ppz...@gmail.com on 30 Sep 2008 at 7:41

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Does anyone have a patch or work-around to make this work? I am currently doing 
a
course project that completely relies on obligations, and I am blocked. 

Original comment by jafa...@gmail.com on 19 Apr 2009 at 1:07

GoogleCodeExporter commented 9 years ago
Will investigate it soon.

Original comment by ppz...@gmail.com on 19 Apr 2009 at 1:37