Bug 55115 - Fix URI template for ?query= argument of UDM REST API search
Fix URI template for ?query= argument of UDM REST API search
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - REST API
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-2-errata
Assigned To: Florian Best
Dirk Wiesenthal
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-08-18 14:18 CEST by Florian Best
Modified: 2022-10-26 16:32 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2022-08-18 14:18:21 CEST
It's possible via the UDM REST API search to search for certain properties without specifying a LDAP filter:
?query[$propertyname]=$propertyvalue

The URI template specified for this is:
{?position,query[],filter,scope,hidden,properties,limit,page,by,dir}`

this does not work and should instead be:
{?position,query*,filter,scope,hidden,properties,limit,page,by,dir}`

So instead of e.g.:
>>> uritemplate.expand('/foo/{?query[]}', {'query[]':{'foo':'bar'}})
'/foo/?query[]=foo,bar'

we have to use:
>>> uritemplate.expand('/foo/{?query*}', {'query':{'query[foo]':'bar'}})
'/foo/?query%5Bfoo%5D=bar

See also:
https://www.rfc-editor.org/rfc/rfc6570.html#section-3.2.8
Comment 1 Florian Best univentionstaff 2022-10-24 18:30:14 CEST
The URI template has been adjusted to `query*`:

univention-directory-manager-rest.yaml
10a751ef28fb | Bug #55115: fix URI template for search query

univention-directory-manager-rest (10.0.4-6)
10a751ef28fb | Bug #55115: fix URI template for search query
Comment 2 Dirk Wiesenthal univentionstaff 2022-10-26 13:21:51 CEST
Manual tests (which validate the URI template): OK
YAML: OK
Tests: OK