Bug 56734 - List missing properties in error response
List missing properties in error response
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - REST API
UCS 5.2
Other Linux
: P5 normal (vote)
: UCS 5.0-5-errata
Assigned To: Florian Best
Johannes Lohmer
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-10-16 18:52 CEST by Florian Best
Modified: 2023-10-25 16:31 CEST (History)
1 user (show)

See Also:
What kind of report is it?: ---
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 2023-10-16 18:52:44 CEST
When a create/modification request is missing required properties, they should be listed in the response like every other property syntax validation as well.

Currently the "dn" is marked as having an error:
    "udm:error": [
      {
        "location": [
          "body",
          "dn"
        ],
        "message": "Information provided is not sufficient: The following properties are missing:\nlastname\npassword.",
        "type": "value_error"
      }
    ]

Instead it should be:
    "udm:error": [
      {
        "location": [
          "body",                                                                                                                                                                                                                             
          "properties",
          "lastname"
        ],
        "message": "The property \"lastname\" is required.",
        "type": "value_error.missing"
      },
      {
        "location": [
          "body",
          "properties",
          "password"
        ],
        "message": "The property \"password\" is required.",
        "type": "value_error.missing"
      }
    ]
Comment 1 Florian Best univentionstaff 2023-10-16 20:43:07 CEST
Missing properties are now marked accordingly. Therefore the insufficientInformation exception was extended.
It's not possible to mark the error type as "value_error.missing", so it's just value_error" until we are able to set it.

univention-directory-manager-rest.yaml
f14ffbab043a | fix(udm-rest): add error handling for missing properties

univention-directory-manager-rest (10.0.6-12)
f14ffbab043a | fix(udm-rest): add error handling for missing properties

univention-directory-manager-rest (10.0.6-10)
52d4399d0525 | feat(udm-rest): improve error message when invalid basic auth syntax is used

univention-directory-manager-modules.yaml
f14ffbab043a | fix(udm-rest): add error handling for missing properties

univention-directory-manager-modules (15.0.24-21)
f14ffbab043a | fix(udm-rest): add error handling for missing properties

ucs-test (10.0.19-20)
f14ffbab043a | fix(udm-rest): add error handling for missing properties
Comment 2 Florian Best univentionstaff 2023-10-18 10:50:59 CEST
Additionally some splitting of module.py has been done.

univention-directory-manager-rest (10.0.6-13)
499700e30409 | refactor(udm-rest): split into html_ui package
ca56da1fb026 | refactor(udm-rest): split into hal package
68e44cf2208b | refactor(udm-rest): remove solved comments
56d0fce9dcf8 | refactor(udm-rest): split into utils package
d0c92bfe32c7 | refactor(udm-rest): split into openapi package
d0057494adde | refactor(udm-rest): split into http_conditional package
e89a54d553dd | refactor(udm-rest): remove unused import
8d56aee1371c | refactor(udm-rest): split into ldap_connection package
81ad20c80553 | refactor(udm-rest): dict items() value use
aa26beb9a478 | refactor(udm-rest): list comprehension
9c2aa835b1df | refactor(udm-rest): split into santizer package
Comment 3 Johannes Lohmer univentionstaff 2023-10-18 10:53:36 CEST
Reproduced: OK
Code: OK
Tests: OK
Package-Build: OK
Errata YAML: OK