Univention Bugzilla – Bug 54063
UDM REST API doesn't handle ms/* (MS group policy) objects / modules
Last modified: 2022-03-23 14:14:38 CET
Although the ms/* UDM modules are listed in the UDM REST API navigation, it is not possible to use them: ms/gpipsec-filter ms/gpipsec-isakmp-policy ms/gpipsec-negotiation-policy ms/gpipsec-nfa ms/gpipsec-policy ms/gpsi-category-registration ms/gpsi-class-store ms/gpsi-package-registration ms/gpwl-wired ms/gpwl-wireless ms/gpwl-wireless-blob Accessing http://$HOST/univention/udm/ms/gpwl-wired/ retuns 404.
Yep. The regex for module names is too restrictive. Patch: diff --git management/univention-directory-manager-rest/src/univention/admin/rest/module.py management/univention-directory-manager-rest/src/univention/admin/rest/module.py index 1fa6707162..613dc6f03b 100755 --- management/univention-directory-manager-rest/src/univention/admin/rest/module.py +++ management/univention-directory-manager-rest/src/univention/admin/rest/module.py @@ -3707,7 +3707,7 @@ class Application(tornado.web.Application): def __init__(self, **kwargs): #module_type = '([a-z]+)' module_type = '(%s)' % '|'.join(re.escape(mod) for mod in Modules.mapping) - object_type = '([a-z]+/[a-z_]+)' + object_type = '([a-z_-]+/[a-z_-]+)' policies_object_type = '(policies/[a-z_]+)' dn = '((?:[^/]+%s.+%s)?%s)' % (self.multi_regex('='), self.multi_regex(','), self.multi_regex(ucr['ldap/base']),) # FIXME: with that dn regex, it is not possible to have urls like (/udm/$dn/foo/$dn/) because ldap-base at the end matches the last dn
https://git.knut.univention.de/univention/ucs/-/merge_requests/248
UDM object types containing "-" are now detected as well. univention-directory-manager-rest.yaml ae2d382be92a | Bug #54063: Merge branch 'fbest/54063-udm-rest-api-object-type-regex' into 5.0-1 5a5d33e8ab3c | Bug #54063: support more characters for UDM object types univention-directory-manager-rest (10.0.2-8) ae2d382be92a | Bug #54063: Merge branch 'fbest/54063-udm-rest-api-object-type-regex' into 5.0-1 5a5d33e8ab3c | Bug #54063: support more characters for UDM object types
QA: no 404 HTTP error anymore by: curl -i http://Administrator:univention@localhost/univention/udm/ms/gpipsec-filter/ -H 'Accept: application/json' (after univention-app install samba4)
Functionality tested: - no 404 HTTP error anymore by: curl -i http://Administrator:univention@localhost/univention/udm/ms/gpipsec-filter/ -H 'Accept: application/json' OK code review OK yaml, changelog OK
<https://errata.software-univention.de/#/?erratum=5.0x257>