You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@syncope.apache.org by Lionel SCHWARZ <li...@in2p3.fr> on 2023/02/16 16:56:08 UTC

pull task only for a specific anyType

Dear all,

On my 3.0.1 syncope instance, I have defines a resource with 2 anyTypes (objectclasses). I'm trying to setup a pull task which would run only on 1 of these 2 anyTypes.

I feel I have 2 solutions:
1. run a "filtered reconciliation" with my own ReconFilterBuilder implementation
2. rather use 2 different resources, one for each anyType

Did I miss something more simple to do that?

Regards
Lionel

Re: pull task only for a specific anyType

Posted by Lionel SCHWARZ <li...@in2p3.fr>.
----- Le 27 Fév 23, à 10:10, Francesco Chicchiriccò ilgrosso@apache.org a écrit :

> On 24/02/23 17:35, Lionel SCHWARZ wrote:
>> ----- Le 24 Fév 23, à 15:55, Lionel SCHWARZ lionel.schwarz@in2p3.fr a écrit :
>>
>>> ----- Le 20 Fév 23, à 10:55, Francesco Chicchiriccò ilgrosso@apache.org a écrit
>>> :

> 
> Nice spot, Lionel!
> 
> Fixed by:
> 
> https://github.com/apache/syncope/commit/71fa807fc666d2b5c9291ad6c2ea9386000a9cb4
> 
> The fix will be released with Syncope 3.0.3.
> 

Hi Francesco, thanks for the fix, works fine.

However, when I run the PULL tasks, only 100 items are retrieved from the external store. I did not find how to change this limit nor in the connector conf, nor in the resource definition, nor in the task definition...
It is then possible to do a FULL_RECONCILIATION on more than 100 items? 

Lionel

Re: pull task only for a specific anyType

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 24/02/23 17:35, Lionel SCHWARZ wrote:
> ----- Le 24 Fév 23, à 15:55, Lionel SCHWARZ lionel.schwarz@in2p3.fr a écrit :
>
>> ----- Le 20 Fév 23, à 10:55, Francesco Chicchiriccò ilgrosso@apache.org a écrit
>> :
>>
>> Propagation works smoothly but during pull, I get the following error:
>>
>> org.apache.syncope.core.provisioning.java.pushpull.InboundMatcher - Could not
>> match {Uid=Attribute: {Name=__UID__, Value=[1288]}, ObjectClass=ObjectClass:
>> IDMSERVICE, DeltaType=CREATE_OR_UPDATE, Token=SyncToken: ,
>> Object={Uid=Attribute: {Name=__UID__, Value=[1288]}, ObjectClass=ObjectClass:
>> IDMSERVICE, Attributes=[Attribute: {Name=__NAME__, Value=[idnum_service]},
>> Attribute: {Name=__UID__, Value=[1288]}], Name=Attribute: {Name=__NAME__,
>> Value=[idnum_service]}}, PreviousUid=null} with any existing SERVICE
>> java.lang.NullPointerException: null
>> at
>> org.apache.syncope.core.provisioning.api.jexl.JexlUtils.addFieldsToContext(JexlUtils.java:124)
>> ~[syncope-core-provisioning-api-3.0.1.jar:3.0.1]
>> 	at
>> 	org.apache.syncope.core.provisioning.java.data.JEXLItemTransformerImpl.lambda$beforePull$1(JEXLItemTransformerImpl.java:179)
>> 	~[syncope-core-provisioning-java-3.0.1.jar:3.0.1]
>> 	at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
>> 	at
>> 	org.apache.syncope.core.provisioning.java.data.JEXLItemTransformerImpl.beforePull(JEXLItemTransformerImpl.java:176)
>> 	~[syncope-core-provisioning-java-3.0.1.jar:3.0.1]
>> 	at
>> 	org.apache.syncope.core.provisioning.java.pushpull.InboundMatcher.matchByConnObjectKeyValue(InboundMatcher.java:230)
>> 	~[syncope-core-provisioning-java-3.0.1.jar:3.0.1]
>> 	at
>> 	org.apache.syncope.core.provisioning.java.pushpull.InboundMatcher.match(InboundMatcher.java:420)
>> 	~[syncope-core-provisioning-java-3.0.1.jar:3.0.1]
> Looking at the code, I see that "null" is sent as an argument here:
> https://github.com/apache/syncope/blob/syncope-3.0.1/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/InboundMatcher.java#L232
> which seems to lead to the NPE

Nice spot, Lionel!

Fixed by:

https://github.com/apache/syncope/commit/71fa807fc666d2b5c9291ad6c2ea9386000a9cb4

The fix will be released with Syncope 3.0.3.

Meanwhile you should be able to backport it by copying the class

https://github.com/apache/syncope/blob/3_0_X/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/jexl/JexlUtils.java

into your local Maven project.

Regards.

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/


Re: pull task only for a specific anyType

Posted by Lionel SCHWARZ <li...@in2p3.fr>.
----- Le 24 Fév 23, à 15:55, Lionel SCHWARZ lionel.schwarz@in2p3.fr a écrit :

> ----- Le 20 Fév 23, à 10:55, Francesco Chicchiriccò ilgrosso@apache.org a écrit
> :
> 
> Propagation works smoothly but during pull, I get the following error:
> 
> org.apache.syncope.core.provisioning.java.pushpull.InboundMatcher - Could not
> match {Uid=Attribute: {Name=__UID__, Value=[1288]}, ObjectClass=ObjectClass:
> IDMSERVICE, DeltaType=CREATE_OR_UPDATE, Token=SyncToken: ,
> Object={Uid=Attribute: {Name=__UID__, Value=[1288]}, ObjectClass=ObjectClass:
> IDMSERVICE, Attributes=[Attribute: {Name=__NAME__, Value=[idnum_service]},
> Attribute: {Name=__UID__, Value=[1288]}], Name=Attribute: {Name=__NAME__,
> Value=[idnum_service]}}, PreviousUid=null} with any existing SERVICE
> java.lang.NullPointerException: null
> at
> org.apache.syncope.core.provisioning.api.jexl.JexlUtils.addFieldsToContext(JexlUtils.java:124)
> ~[syncope-core-provisioning-api-3.0.1.jar:3.0.1]
>	at
>	org.apache.syncope.core.provisioning.java.data.JEXLItemTransformerImpl.lambda$beforePull$1(JEXLItemTransformerImpl.java:179)
>	~[syncope-core-provisioning-java-3.0.1.jar:3.0.1]
>	at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
>	at
>	org.apache.syncope.core.provisioning.java.data.JEXLItemTransformerImpl.beforePull(JEXLItemTransformerImpl.java:176)
>	~[syncope-core-provisioning-java-3.0.1.jar:3.0.1]
>	at
>	org.apache.syncope.core.provisioning.java.pushpull.InboundMatcher.matchByConnObjectKeyValue(InboundMatcher.java:230)
>	~[syncope-core-provisioning-java-3.0.1.jar:3.0.1]
>	at
>	org.apache.syncope.core.provisioning.java.pushpull.InboundMatcher.match(InboundMatcher.java:420)
>	~[syncope-core-provisioning-java-3.0.1.jar:3.0.1]

Looking at the code, I see that "null" is sent as an argument here:
https://github.com/apache/syncope/blob/syncope-3.0.1/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/InboundMatcher.java#L232
which seems to lead to the NPE

Regards
Lionel

Re: pull task only for a specific anyType

Posted by Lionel SCHWARZ <li...@in2p3.fr>.
----- Le 20 Fév 23, à 10:55, Francesco Chicchiriccò ilgrosso@apache.org a écrit :

> On 16/02/23 17:56, Lionel SCHWARZ wrote:
>> Dear all,
>>
>> On my 3.0.1 syncope instance, I have defines a resource with 2 anyTypes
>> (objectclasses). I'm trying to setup a pull task which would run only on 1 of
>> these 2 anyTypes.
>>
>> I feel I have 2 solutions:
>> 1. run a "filtered reconciliation" with my own ReconFilterBuilder implementation
>> 2. rather use 2 different resources, one for each anyType
>>
>> Did I miss something more simple to do that?
> 
> Hi Lionel,
> the simplest way to achieve your goal is definitely (2).

Hi francesco,
I followed your advice, thanks.
I have another question regarding PULL. I have defined a mapping as follows:


      "mapping": {
        "connObjectLink": null,
        "connObjectKeyItem": {
          "intAttrName": "name",
          "extAttrName": "__NAME__",
          "connObjectKey": true,
          "password": false,
          "mandatoryCondition": "true",
          "purpose": "BOTH",
          "propagationJEXLTransformer": "value.split('\\.',2)[1]",
          "pullJEXLTransformer": "'SERVICE.' + value",
          "transformers": []
        },
        "items": [
           ...
        ]
      }

to sepcify that the remote __NAME__ must match the local "name" attribute, with a prefix, for example

Syncope anyobject name:"SERVICE.myservice" must match remote __NAME__:"myservice".

Propagation works smoothly but during pull, I get the following error:

org.apache.syncope.core.provisioning.java.pushpull.InboundMatcher - Could not match {Uid=Attribute: {Name=__UID__, Value=[1288]}, ObjectClass=ObjectClass: IDMSERVICE, DeltaType=CREATE_OR_UPDATE, Token=SyncToken: , Object={Uid=Attribute: {Name=__UID__, Value=[1288]}, ObjectClass=ObjectClass: IDMSERVICE, Attributes=[Attribute: {Name=__NAME__, Value=[idnum_service]}, Attribute: {Name=__UID__, Value=[1288]}], Name=Attribute: {Name=__NAME__, Value=[idnum_service]}}, PreviousUid=null} with any existing SERVICE
java.lang.NullPointerException: null	
at org.apache.syncope.core.provisioning.api.jexl.JexlUtils.addFieldsToContext(JexlUtils.java:124) ~[syncope-core-provisioning-api-3.0.1.jar:3.0.1]
	at org.apache.syncope.core.provisioning.java.data.JEXLItemTransformerImpl.lambda$beforePull$1(JEXLItemTransformerImpl.java:179) ~[syncope-core-provisioning-java-3.0.1.jar:3.0.1]
	at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
	at org.apache.syncope.core.provisioning.java.data.JEXLItemTransformerImpl.beforePull(JEXLItemTransformerImpl.java:176) ~[syncope-core-provisioning-java-3.0.1.jar:3.0.1]
	at org.apache.syncope.core.provisioning.java.pushpull.InboundMatcher.matchByConnObjectKeyValue(InboundMatcher.java:230) ~[syncope-core-provisioning-java-3.0.1.jar:3.0.1]
	at org.apache.syncope.core.provisioning.java.pushpull.InboundMatcher.match(InboundMatcher.java:420) ~[syncope-core-provisioning-java-3.0.1.jar:3.0.1]

I have the feeling that it comes from the "pullJEXLTransformer", but do not understand what's wrong with this.

Do you have an idea, I'm stuck

Regards
Lionel

Re: pull task only for a specific anyType

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 16/02/23 17:56, Lionel SCHWARZ wrote:
> Dear all,
>
> On my 3.0.1 syncope instance, I have defines a resource with 2 anyTypes (objectclasses). I'm trying to setup a pull task which would run only on 1 of these 2 anyTypes.
>
> I feel I have 2 solutions:
> 1. run a "filtered reconciliation" with my own ReconFilterBuilder implementation
> 2. rather use 2 different resources, one for each anyType
>
> Did I miss something more simple to do that?

Hi Lionel,
the simplest way to achieve your goal is definitely (2).

(1) would be a way to filter which instances, for all object classes defined, shall be returned by pull so I don't think it applies.

Regards.

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/