Uploaded image for project: 'Mender'
  1. Mender
  2. MEN-2624

api/management/v2/devauth/devices endpoint does not return documented object on 409 error

    XMLWordPrintable

    Details

    • Backlog:
      no
    • Days in progress:
      0

      Description

      If device already exist when trying to add a new preuthorized device, it should according to docs return the following,

      HTTP Code	Description	                                                                                Schema
      409	                Device already exists. Response contains conflicting device.	Device
      

      But it does not return an schema of the conflicting device as can be seen by running the following sequence (assuming the device already exists)

      # Pre-authorize
      curl -X POST -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" -d "@pre-auth.json" https://hosted.mender.io/api/management/v2/devauth/devices
      {"error":"device already exists","request_id":"2a77f9cd-f137-4845-a94f-1d025686895d"}
      

      Content of "pre-auth.json" in above is:

      {
        "identity_data" : {
          "application/json" : {
            "mac" : "00:01:02:03:04:05",
            "sku" : "My Device 1",
            "sn" : "SN1234567890"
          }
        },
        "pubkey" : "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzogVU7RGDilbsoUt/DdH\nVJvcepl0A5+xzGQ50cq1VE/Dyyy8Zp0jzRXCnnu9nu395mAFSZGotZVr+sWEpO3c\nyC3VmXdBZmXmQdZqbdD/GuixJOYfqta2ytbIUPRXFN7/I7sgzxnXWBYXYmObYvdP\nokP0mQanY+WKxp7Q16pt1RoqoAd0kmV39g13rFl35muSHbSBoAW3GBF3gO+mF5Ty\n1ddp/XcgLOsmvNNjY+2HOD5F/RX0fs07mWnbD7x+xz7KEKjF+H7ZpkqCwmwCXaf0\niyYyh1852rti3Afw4mDxuVSD7sd9ggvYMc0QHIpQNkD4YWOhNiE1AB0zH57VbUYG\nUwIDAQAB\n-----END PUBLIC KEY-----\n"
      }
      
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mirzak Mirza Krak
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support