syncope-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: Search conditions ignored with "and"
Date Mon, 05 Sep 2016 15:35:10 GMT
Hi Francesco, All

Thanks for identifying it is a bash which strips ';' -
Tomcat is off the 'hook' :-) and typing a query in the browser should be 
Ok too

Thanks, Sergey
On 05/09/16 14:58, Francesco Chicchiriccò wrote:
> Hi,
> when breaking in the indicated location, and issuing (as in the Colm's
> original sample):
>
> curl -u admin:password
> http://localhost:9080/syncope/rest/users?fiql=city==dublin;country==canada
>
> I obtain
>
> fiql=city==dublin
>
> for QUERY_STRING.
>
> If instead I execute
>
> curl -u admin:password
> "http://localhost:9080/syncope/rest/users?fiql=city==dublin;country==canada"
>
>
> I obtain correctly
>
> fiql=city==dublin;country==canada
>
> for QUERY_STRING.
>
> It seems that it is bash that strips the content after ';' then.
>
> Regards.
>
> On 02/09/2016 14:03, Francesco Chicchiriccò wrote:
>> ----- Il 2-set-16, alle 13:24, Sergey Beryozkin sberyozkin@gmail.com
>> ha scritto:
>>
>>> Hi Francesco
>>> Would like to return to this issue raised by Colm,
>>>
>>> Can you give me a favor please and check sometime next week, with
>>> Syncope loaded into Tomcat, with a breakpoint set at:
>>>
>>> https://github.com/apache/cxf/blob/cxf-3.1.7/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java#L372
>>>
>>>
>>> what QUERY_STRING returns.
>>>
>>> I believe you should see ';' gone and then it is down to Tomcat itself
>>> or, quite possibly, to some filters, sitting in front of CXF. I'm
>>> curious because I'm not sure I've heard that Tomcat strips ';' before.
>> Sure, I'll keep you posted.
>> Regards.
>>
>>> On 30/08/16 15:07, Sergey Beryozkin wrote:
>>>> It's Jetty vs Tomcat, I've double checked, added
>>>> @Encoded @QueryParam("_s")
>>>> to ensure CXF does not decode itself and still see ';'.
>>>>
>>>> Yeah, minor issue, though not ideal if a user is typing it manually...
>>>>
>>>> P.S. Happy to see Syncope being so cool about allowing arbitrary
>>>> FIQL/(and OData ?) search filter queries :-)
>>>>
>>>> Thanks, Sergey
>>>>
>>>> On 30/08/16 14:59, Colm O hEigeartaigh wrote:
>>>>> I'll take your word for it that it works fine in CXF :-) It's probably
>>>>> Tomcat alright which is causing the problem. It's not a big deal in
>>>>> any
>>>>> case, URL encoding fixes the problem.
>>>>>
>>>>> Colm.
>>>>>
>>>>> On Tue, Aug 30, 2016 at 2:51 PM, Sergey Beryozkin
>>>>> <sberyozkin@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> CXF won't be that bad though and start picking up the matrix
>>>>>> parameters
>>>>>> from a query component :-), so my guess Tomcat is stripping it.
>>>>>>
>>>>>> When I run CXF JAXRSClientServerBook.testSearchBook123
>>>>>> I see in the server log:
>>>>>>
>>>>>> Address: http://localhost:9001/bookstore/books/search?_s=name==CXF*;
>>>>>> id=ge=123;id=lt=124
>>>>>>
>>>>>> If I update a test server method from :
>>>>>> @GET
>>>>>>      @Path("/books/search")
>>>>>>      @Produces("application/xml")
>>>>>>      public Book getBook(@Context SearchContext searchContext)
>>>>>>
>>>>>> to
>>>>>> ...
>>>>>> public Book getBook(@QueryParam("_s") String s)
>>>>>>
>>>>>> then I can see _s being equal to:
>>>>>>
>>>>>> name==CXF*;id=ge=123;id=lt=124
>>>>>>
>>>>>> Colm you can try it in CXF too :-)
>>>>>>
>>>>>> Thanks, Sergey
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 30/08/16 14:16, Colm O hEigeartaigh wrote:
>>>>>>
>>>>>>> Actually it appears Francesco is right, encoding ';' as '%3B'
>>>>>>> gives the
>>>>>>> correct result.
>>>>>>>
>>>>>>> Colm.
>>>>>>>
>>>>>>> On Tue, Aug 30, 2016 at 1:03 PM, Sergey Beryozkin
>>>>>>> <sberyozkin@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>> Hi Francesco
>>>>>>>> On 30/08/16 13:00, Francesco Chicchiriccò wrote:
>>>>>>>>
>>>>>>>> Il 30 agosto 2016 13:50:18 CEST, "Francesco Chicchiriccò"
<
>>>>>>>>> ilgrosso@apache.org> ha scritto:
>>>>>>>>>
>>>>>>>>> Hi Colm,
>>>>>>>>>> have you already tried via SyncopeClient? There should
be
>>>>>>>>>> integration
>>>>>>>>>> test cases for AND...
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> I'd think that the fiql string needs to be encoded, otherwise
;
>>>>>>>>> could be
>>>>>>>>> interpreted by CXF as separator for matrix parameters...
>>>>>>>>>
>>>>>>>>> No, only if it is provided as part of a path, like this:
>>>>>>>>>
>>>>>>>> http://cxf.apache.org/docs/jax-rs-search.html#JAX-RSSearch-S
>>>>>>>> earchExpressionsinURIPathsegments
>>>>>>>>
>>>>>>>> Otherwise if it is a query component, it is not a problem
>>>>>>>>
>>>>>>>> Cheers, Sergey
>>>>>>>>
>>>>>>>>
>>>>>>>> Il 30 agosto 2016 13:39:10 CEST, Colm O hEigeartaigh
>>>>>>>>
>>>>>>>>> <coheigea@apache.org> ha scritto:
>>>>>>>>>> Hi all,
>>>>>>>>>>> I've created the following users in Syncope with
attributes of
>>>>>>>>>>> "city"
>>>>>>>>>>> and
>>>>>>>>>>> "country":
>>>>>>>>>>>
>>>>>>>>>>> alice/dublin/ireland
>>>>>>>>>>> bob/dublin/canada
>>>>>>>>>>> eve//usa
>>>>>>>>>>>
>>>>>>>>>>> Search for users who live in dublin gives the
correct total
>>>>>>>>>>> of "2":
>>>>>>>>>>>
>>>>>>>>>>> curl -u admin:password
>>>>>>>>>>> http://localhost:9080/syncope/rest/users?fiql=city==dublin
>>>>>>>>>>>
>>>>>>>>>>> However, if I search for users who live in dublin
and canada, I
>>>>>>>>>>> still
>>>>>>>>>>> get
>>>>>>>>>>> "2", meaning that the second search term is ignored:
>>>>>>>>>>>
>>>>>>>>>>> curl -u admin:password
>>>>>>>>>>> http://localhost:9080/syncope/rest/users?fiql=city==dublin;c
>>>>>>>>>>> ountry==canada
>>>>>>>>>>>
>>>>>>>>>>> The strange thing is that the "or" condition
appears to work ok.
>>>>>>>>>>> Searching
>>>>>>>>>>> for users who live in dublin or the usa returns
all 3 users as
>>>>>>>>>>> expected:
>>>>>>>>>>>
>>>>>>>>>>> curl -u admin:password
>>>>>>>>>>> http://localhost:9080/syncope/rest/users?fiql=city==dublin,c
>>>>>>>>>>> ountry==usa
>>>>>>>>>>>
>>>>>>>>>>> This is reproducible on both 2.0.0-SNAPSHOT +
1.2.8. It is a bug
>>>>>>>>>>> IMO
>>>>>>>>>>> but
>>>>>>>>>>> wanted to get some feedback first before creating
a JIRA.
>>>>>>>>>>>
>>>>>>>>>>> Colm.
>


Mime
View raw message