HERAS-AF Forum
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 20, 2012, 11:16:41 am

Login with username, password and session length
Search:     Advanced search
Welcome to the HERAS-AF Forum...
373 Posts in 89 Topics by 272 Members
Latest Member: Jasmine
* Home Help Search Login Register
+  HERAS-AF Forum
|-+  HERAS-AF XACML (0.x, "old")
| |-+  HERAS-AF XACML (Moderator: Florian Huonder)
| | |-+  Function "function:xpath-node-match" not loaded at startup
« previous next »
Pages: [1] Print
Author Topic: Function "function:xpath-node-match" not loaded at startup  (Read 1023 times)
Sylvain LF
Newbie
*
Posts: 9


View Profile
« on: July 06, 2009, 03:01:55 pm »

Hi guys,

I'm trying to pass (with success) a policy with "function:xpath-node-match".

However, this function is not on the list at the startup of my application.

I've tried to load your policy (IIIG004Policy.xml) but i've this error :

Code:
15:10:09.016 [main] INFO  org.herasaf.xacml.pdp.impl.PDPImpl - 1: deploy new Collection Evaluatables
org.herasaf.xacml.WritingException: javax.xml.bind.MarshalException
 - with linked exception:
[com.sun.xml.bind.api.AccessorException: java.lang.NullPointerException]
at org.herasaf.xacml.core.policy.PolicyConverter.marshall(PolicyConverter.java:207)
at org.herasaf.xacml.pdp.persistence.impl.XMLDatabasePersistenceManager.persist(XMLDatabasePersistenceManager.java:334)
at org.herasaf.xacml.pdp.persistence.impl.XMLDatabasePersistenceManager.persistAll(XMLDatabasePersistenceManager.java:316)
at org.herasaf.xacml.pdp.impl.PDPImpl.deploy(PDPImpl.java:221)
at XACMLPrototype.Core.Core.main(Core.java:43)
Caused by: javax.xml.bind.MarshalException
 - with linked exception:
[com.sun.xml.bind.api.AccessorException: java.lang.NullPointerException]
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:331)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:257)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75)
at org.herasaf.xacml.core.policy.PolicyConverter.marshall(PolicyConverter.java:196)
... 4 more
Caused by: com.sun.xml.bind.api.AccessorException: java.lang.NullPointerException
at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:242)
at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:257)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeAttributes(ClassBeanInfoImpl.java:338)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:679)
at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:65)
at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:168)
at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:65)
at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:168)
at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:150)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:150)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:65)
at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:168)
at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:150)
at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:156)
at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:185)
at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:305)
at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:312)
at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:71)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:490)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:328)
... 7 more
Caused by: com.sun.xml.bind.api.AccessorException: java.lang.NullPointerException
at com.sun.xml.bind.v2.runtime.reflect.AdaptedAccessor.get(AdaptedAccessor.java:74)
at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.print(TransducedAccessor.java:235)
at com.sun.xml.bind.v2.runtime.property.AttributeProperty.serializeAttributes(AttributeProperty.java:97)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeAttributes(ClassBeanInfoImpl.java:331)
... 37 more
Caused by: java.lang.NullPointerException
at org.herasaf.xacml.core.converter.URNToFunctionConverter.marshal(URNToFunctionConverter.java:69)
at org.herasaf.xacml.core.converter.URNToFunctionConverter.marshal(URNToFunctionConverter.java:1)
at com.sun.xml.bind.v2.runtime.reflect.AdaptedAccessor.get(AdaptedAccessor.java:72)
... 40 more
org.herasaf.xacml.pdp.persistence.DataAccessException: org.herasaf.xacml.WritingException: javax.xml.bind.MarshalException
 - with linked exception:
[com.sun.xml.bind.api.AccessorException: java.lang.NullPointerException]
at org.herasaf.xacml.pdp.persistence.impl.XMLDatabasePersistenceManager.persist(XMLDatabasePersistenceManager.java:338)
at org.herasaf.xacml.pdp.persistence.impl.XMLDatabasePersistenceManager.persistAll(XMLDatabasePersistenceManager.java:316)
at org.herasaf.xacml.pdp.impl.PDPImpl.deploy(PDPImpl.java:221)
at XACMLPrototype.Core.Core.main(Core.java:43)
Caused by: org.herasaf.xacml.WritingException: javax.xml.bind.MarshalException
 - with linked exception:
[com.sun.xml.bind.api.AccessorException: java.lang.NullPointerException]
at org.herasaf.xacml.core.policy.PolicyConverter.marshall(PolicyConverter.java:207)
at org.herasaf.xacml.pdp.persistence.impl.XMLDatabasePersistenceManager.persist(XMLDatabasePersistenceManager.java:334)
... 3 more
Caused by: javax.xml.bind.MarshalException
 - with linked exception:
[com.sun.xml.bind.api.AccessorException: java.lang.NullPointerException]
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:331)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:257)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75)
at org.herasaf.xacml.core.policy.PolicyConverter.marshall(PolicyConverter.java:196)
... 4 more
Caused by: com.sun.xml.bind.api.AccessorException: java.lang.NullPointerException
at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:242)
at com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:257)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeAttributes(ClassBeanInfoImpl.java:338)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:679)
at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:65)
at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:168)
at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:65)
at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:168)
at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:150)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:150)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:65)
at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:168)
at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:152)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:322)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:681)
at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.serializeBody(SingleElementNodeProperty.java:150)
at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:156)
at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:185)
at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:305)
at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:312)
at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:71)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:490)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:328)
... 7 more
Caused by: com.sun.xml.bind.api.AccessorException: java.lang.NullPointerException
at com.sun.xml.bind.v2.runtime.reflect.AdaptedAccessor.get(AdaptedAccessor.java:74)
at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.print(TransducedAccessor.java:235)
at com.sun.xml.bind.v2.runtime.property.AttributeProperty.serializeAttributes(AttributeProperty.java:97)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeAttributes(ClassBeanInfoImpl.java:331)
... 37 more
Caused by: java.lang.NullPointerException
at org.herasaf.xacml.core.converter.URNToFunctionConverter.marshal(URNToFunctionConverter.java:69)
at org.herasaf.xacml.core.converter.URNToFunctionConverter.marshal(URNToFunctionConverter.java:1)
at com.sun.xml.bind.v2.runtime.reflect.AdaptedAccessor.get(AdaptedAccessor.java:72)
... 40 more

How load this function ?
And/Or how add new function ?

Thank you,

Regards,

SLF.
Logged
Florian Huonder
Administrator
Full Member
*****
Posts: 129



View Profile WWW
« Reply #1 on: July 06, 2009, 09:41:13 pm »

Hi Sylvain,

The xpath-node-match function is not yet implemented (http://jira.herasaf.org/browse/XACMLIMPL-25).
Currently we did not plan to implement it.

If you'd like, you could implement it on your own.
Implementing such a function is very simple:
Create a new class implementing the org.herasaf.xacml.core.function.Function interface
The simply implement the logic of the function regarding the XACML 2.0 specification.
See any other function as template, e.g. http://svn.herasaf.org/herasaf-xacml/tags/0.12.0/herasaf-xacml-core/src/main/java/org/herasaf/xacml/core/function/impl/equalityPredicates/StringEqualFunction.java
Afterwards you can either put the function into the src/main/java/org/herasaf/xacml/core/function/impl/xpath folder, then it should be picked up automatically, or you can configure any location in the Functions.xml config file.

When you decide to implement the function, we would very appreciate it if we could merge it into our trunk.

If you do not have the time or any other problem with implementing, we could surely help you as much as our schedule allows.

If you have any further questions, don't hesitate to ask.

Regards,
Florian
Logged
Sylvain LF
Newbie
*
Posts: 9


View Profile
« Reply #2 on: July 07, 2009, 11:15:44 am »

Hi Florian,

Thank you for your explanations.

We decide to implement this function, and make the test.

Please find attached, the classes that we create, so you can check them before adding them into your trunk.

Best regards,

SLF

* XPathNodeMatchFunction.java (2.91 KB - downloaded 32 times.)
* TestXPathNodeMatchFunction.java (3.01 KB - downloaded 25 times.)
Logged
Florian Huonder
Administrator
Full Member
*****
Posts: 129



View Profile WWW
« Reply #3 on: July 08, 2009, 07:55:58 am »

I added your implementation as proposal to the issue.
http://jira.herasaf.org/browse/XACMLIMPL-25
Logged
Sylvain LF
Newbie
*
Posts: 9


View Profile
« Reply #4 on: July 08, 2009, 02:23:57 pm »

Hi florian,

We apologyze, the implementation that we have posted is not valid.

We have misunderstood the explanation of this function in the XACML 2.0 specification (Appendix A.3.15).

We will notify you when a new implementation will be made.

Regards,

SLF
Logged
Erwan G
Newbie
*
Posts: 9


View Profile
« Reply #5 on: July 08, 2009, 03:09:59 pm »

Hi

I work with Sylvain LF on the xpath-node-match function implementation
and we need to access the request's ResourceContent within the function to evaluate both xpath expression

Is it possible ? How can we access the ResourceContent within a function ?

Regards,

Erwan
Logged
Florian Huonder
Administrator
Full Member
*****
Posts: 129



View Profile WWW
« Reply #6 on: July 08, 2009, 10:24:02 pm »

Hi Erwan,

It is not possible to access the ResourceContent from within a function. The functions are not intended to access the request directly.
The xpath-node-match function we're talking about here should take two arguments of type string that shall be interpreted as xPath expressions.
That means that the function doesn't need to access the request.

For accessing the ResourceContent within the Request XACML has the AttributeSelector. In the HERASAF XACML Implementation 0.12.0 (latest release) the AttributeSelector is not yet implemented and not yet planned (see http://jira.herasaf.org/browse/XACMLIMPL-20).

If you'd decide to implement the AttributeSelector on your own we would very appreciate if you could share the implementation with us.
Further if you would need some assistance (possible within our limits), we're open.

Regards,
Florian
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!