Bug 50127 - [UDM HTTP API] DN to URL / univentionObjectType operation
[UDM HTTP API] DN to URL / univentionObjectType operation
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - REST API
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: Florian Best
Daniel Tröder
:
Depends on:
Blocks: 50173
  Show dependency treegraph
 
Reported: 2019-09-08 06:56 CEST by Daniel Tröder
Modified: 2019-10-02 16:06 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Feature Request
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 Daniel Tröder univentionstaff 2019-09-08 06:56:34 CEST
Sometimes the univentionObjectType of a DN is unknown.
Happens mostly with computer, dhcp and policy objects, which can be found grouped together in multi value attributes.

While it is possible to try to guess the type by looking at computers/computer and policies/policy and hoping to find a link to follow, it would be better to  have an operation that clearly tells me either the univentionObjectType (or the URL) of the object or returns a 404.

I'm not sure which implementation would be best in a REST architecture:
* a resource/operation that returns the univentionObjectType for a DN
* a resource/operation that returns the URL for a DN
* a resource/operation that returns a 301 or 302 for a DN
Comment 2 Florian Best univentionstaff 2019-09-08 22:47:44 CEST
This functionality already exists by following the link relation 'udm:object/get-by-dn' on /univention/udm/ which is a URI template to "/univention/object/{dn}".
Comment 3 Daniel Tröder univentionstaff 2019-09-09 10:24:13 CEST
Perfect :)

Just for posterity: the links target is currently "/univention/udm/object/{dn}".

The relation "udm:object/get-by-uuid" also points there.
Comment 4 Daniel Tröder univentionstaff 2019-09-12 10:28:04 CEST
Does not work for saml/serviceprovider objects that contain a '://', ':/' or ':%/'.
Comment 5 Florian Best univentionstaff 2019-09-12 11:40:53 CEST
(In reply to Daniel Tröder from comment #4)
> Does not work for saml/serviceprovider objects that contain a '://', ':/' or
> ':%/'.
That's not a problem with this bug but Bug #50175.
URI templates aren't RESTful. There is no solution to fix this, as per RFC 3986 // may be normalized to /.
You can do a search with scope=base and position=DN instead.
Comment 6 Daniel Tröder univentionstaff 2019-09-12 12:23:51 CEST
(In reply to Florian Best from comment #5)
> You can do a search with scope=base and position=DN instead.
How or where can I do that (when I don't know the univentionObjectType)?
Comment 7 Florian Best univentionstaff 2019-10-02 16:06:34 CEST
UCS 4.4-2 has been released:
 https://docs.software-univention.de/release-notes-4.4-2-en.html
 https://docs.software-univention.de/release-notes-4.4-2-de.html

If this error occurs again, please use "Clone This Bug".