Bug 54017 - Simple UDM API: Do not raise WrongObjectType during iteration in search()
Simple UDM API: Do not raise WrongObjectType during iteration in search()
Status: REOPENED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-8-errata
Assigned To: Dirk Wiesenthal
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-11-01 14:24 CET by Dirk Wiesenthal
Modified: 2021-11-02 13:24 CET (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.034
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 Dirk Wiesenthal univentionstaff 2021-11-01 14:24:33 CET
If an object has the wrong object type, the simple UDM API refuses to use it. It raises a WrongObjectTypeError. This is done because no guarantees can be made for that object. This happens, if e.g., a share object has the "objectClass: univentionGroup". It is found by the group handler, but as the object itself is no group upon second look, the API will raise the error.

This makes sense in get(). But in search(), it leads to non-working errors during udm.get('groups/group').search() with no sane possibility to recover.
Comment 1 Dirk Wiesenthal univentionstaff 2021-11-01 14:32:19 CET
univention-directory-manager-rest.yaml
086f5b66bcd2 | Bug #54017: YAML

univention-directory-manager-modules (14.0.20-26)
4c5c50ecb01f | Bug #54017: Do not raise WrongObjectType during search()
Comment 2 Florian Best univentionstaff 2021-11-01 14:45:58 CET
(In reply to Dirk Wiesenthal from comment #1)
> univention-directory-manager-rest.yaml
> 086f5b66bcd2 | Bug #54017: YAML
REOPEN: Wrong YAML, messed up the previously existing entry.
Comment 3 Florian Best univentionstaff 2021-11-01 15:02:03 CET
Your LDAP data are invalid. You have a share with wrong data:

```
objectClass: univentionOffice365
objectClass: univentionGroup
objectClass: ucsschoolGroup
univentionOffice365ADConnectionAlias: ama
```

All of those attributes are wrong for a shares/share object.
Comment 4 Daniel Tröder univentionstaff 2021-11-02 07:59:31 CET
At first I was unhappy with the implementation: silently ignoring an exception.
I thought at least a log entry that an object was skipped should be made.
But after a while I have decided that it's OK to do that in this case, as the library user has used the "search()" method on an explicitly requested UDM module. And thus she simply wouldn't won't to get objects of other modules, meaning she wouldn't need a log entry for something that she never wanted.
So I'm happy with the solution of silently ignoring the exception.
Comment 5 Daniel Tröder univentionstaff 2021-11-02 08:00:07 CET
/won't/want/