Scenario: Try to create a new TLD using unicode string, for example: “例え” Actual Result: API fails with: Details: {'code': 400, 'type': 'invalid_object', 'message': 'Provided object is not valid. Got a ValueError error with message \u4f8b\u3048 is not an TLD', 'request_id': 'req-fa7cb43e-a6e9-41f2-b878-1ced6a853a2a'} Expected Result: Should pass Notes: 1) There is an tempest patch could be used to reproduce the scenario: https://review.opendev.org/c/openstack/designate-tempest-plugin/+/779558 2) Documentation: https://docs.openstack.org/api-ref/dns/?expanded=get-the-name-servers-for-a-zone-detail,list-all-recordsets-owned-by-project-detail,create-zone-detail,create-tld-detail#create-tld
The designate API is inconsistently accepting multi-byte strings. For example, the string above can be used for the TLD description, but not the TLD name even though it is a valid TLD. The Designate objects are performing a regex on the input value here: https://opendev.org/openstack/designate/src/branch/master/designate/objects/fields.py#L293 With the regex here: https://opendev.org/openstack/designate/src/branch/master/designate/objects/fields.py#L98 Making the assumption that the TLD will be ascii only.