Clarify "device_identity" JSON Sub-string Behavior

Description

The string construction for the device_identity JSON substring needs to be documented in the Mender documentation and the examples corrected.

The issue is that the "device_identity" JSON substring is compared via an exact string match including the JSON itself. This means, that i.e. 

is not the same as

 

 

 

The spaces matter, and so does the ordering. It appears that the board client formats the strings without spaces in between colons, and also it puts them in alphabetical order.

 

So for the abstract device_identity set:

 

 

 

The board mender client would build and POST a JSON string that looks like the following:

 

 

However, the examples in the documentation show this as it would be:

 

 

 

Notice all the extra spaces in the substring with the attributes, those won't actually be there, so this example is incorrect and confusing especially considering this behavior doesn't seem to be documented.

 

This should probably be mentioned here:

https://docs.mender.io/1.4/apis/management-apis/device-admission#devices-post

and maybe here too (or at least linked)

https://docs.mender.io/1.4/client-configuration/identity

Note that this appears to be identical in newer versions of Mender that use the v1 API. I haven't looked at v2 so I understand it may be different, but either way this should be documented.

Affects versions

Environment

Linux 3.10 - Yocto Morty

Checklist

Activity

Show:

Details

Assignee

Reporter

Priority

Zendesk Support

Checklist

Created February 16, 2019 at 6:28 PM
Updated February 28, 2019 at 7:50 AM