Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-11685

Return names as well as labels in missingRequiredAttributes in error response

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.5.0
    • Fix Version/s: 6.5.0
    • Component/s: Module - Authorization
    • Labels:
    • Environment:
      master snapshot build of rev #9276111 on 2018-09-10 20:53

      Description

      When there is an incorrect attempt to create a privilege with CREATE permissions, but not all required attributes have read/write access, an error response is returned, as follows:

      {
          "code": 403,
          "reason": "Forbidden",
          "message": "Policy validation failed",
          "detail": {
              "result": false,
              "failedPolicyRequirements": [
                  {
                      "policyRequirements": [
                          {
                              "params": {
                                  "missingRequiredAttributes": "Username, First Name, Last Name, Email Address"
                              },
                              "policyRequirement": "PRIVILEGE_MISSING_REQUIRED_CREATE_ATTRIBUTES"
                          }
                      ],
                      "property": "permissions"
                  }
              ]
          }
      }
      

      To betterĀ the usability of this API, missingRequiredAttributes should return the attribute names, not their labels. It is the attribute names that are missing and need to be sent in a subsequent request to this endpoint, not the labels.

      [EDIT] The labels should be returned as well as the 'names' to be easily consumed by a UI if the consumer desires. This allows ease of use for QA and backend while offering greater flexibility for any custom UI.

        Attachments

          Activity

            People

            Assignee:
            katie.gonzalez Katie Gonzalez
            Reporter:
            GErickson Garyl Erickson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: