syncope-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitriy B. (Jira)" <j...@apache.org>
Subject [jira] [Commented] (SYNCOPE-1490) Incorrect decoding when constructing fiql query
Date Tue, 10 Sep 2019 10:10:00 GMT

    [ https://issues.apache.org/jira/browse/SYNCOPE-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16926489#comment-16926489
] 

Dmitriy B. commented on SYNCOPE-1490:
-------------------------------------

Can be closed.

First, need to encode filter property values (to support commas) and after this - encode full
fiql string.

Code sample:

{code:language=java}

String fiqlString = SyncopeClient.getUserSearchConditionBuilder().is("phone").equalTo(utf8Encode("+1234556789112")).query();

AnyQuery anyQuery = new AnyQuery.Builder().realm(SyncopeConstants.ROOT_REALM).fiql(utf8Encode(fiqlString)).build();

PagedResult<UserTO> matchingUsers = userService.search(anyQuery);

{code}

> Incorrect decoding when constructing fiql query
> -----------------------------------------------
>
>                 Key: SYNCOPE-1490
>                 URL: https://issues.apache.org/jira/browse/SYNCOPE-1490
>             Project: Syncope
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.0.12
>            Reporter: Dmitriy B.
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> The incoming org.apache.cxf.jaxrs.ext.search.PrimitiveStatement#value value is already
decoded in org.apache.syncope.core.persistence.api.search.SearchCondVisitor#visitPrimitive.
> Thus, the useless logic that does decoding should be removed.
> Otherwise, it leads to incorrect behavior: e.g. when special chars present it the property
values.
> For example, I have user with "phone" attribute and value of this attribute is "+1234556789112"
> After double decoding, I'll have the " 1234556789112" instead of the original value.
> Example of search request:
> {code:language=java}
> String fiqlQuery = SyncopeClient.getUserSearchConditionBuilder()
>                 .is("phone").equalTo("+1234556789112")
>                 .query();
> AnyQuery anyQuery = new AnyQuery.Builder().realm(SyncopeConstants.ROOT_REALM).fiql(fiqlQuery).build();
>         PagedResult<UserTO> matchingUsers = userService.search(anyQuery);
> {code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Mime
View raw message