OpenMobileAlliance / OMA_LwM2M_for_Developers

OMA LightweightM2M public resources.
http://openmobilealliance.github.io/OMA_LwM2M_for_Developers/
Other
239 stars 52 forks source link

Allowed paths in payload of Read-Composite operation #447

Closed krwc closed 4 years ago

krwc commented 5 years ago

This issue refers to OMA-TS-LightweightM2M_Core-V1_1-20180710-A.

Section 6.3.8 Read-Composite section states:

If supported by the client, the "Read-Composite" operation can be used by the LwM2M Server to selectively read a number of Resources, and/or Resource Instances of different Objects in a single request. The list of elements to be read are provided as separate parameters to the operation in JSON/CBOR format. The format is similar to JSON/CBOR reply format, but without values for the resources.

What does it mean in terms of allowed paths in the request payload? In other words:

  1. Is root path (/) allowed in the payload? That is, can Read-Composite be used to read the entire data model the Server has access to?
  2. Is path to an Object (/OID) allowed in the payload?
  3. Is path to an Instance (/OID/IID) allowed in the payload?
hannestschofenig commented 5 years ago

Section 7.4.4 provides the JSON encoding and in Table 7.4.4 shows an example. So, the answers to your questions are:

Is root path (/) allowed in the payload? That is, can Read-Composite be used to read the entire data model the Server has access to?

Yes. The encoding would be something like: [{"n":"/"}]

It would probably be good to add that example to the spec.

Is path to an Object (/OID) allowed in the payload?

Yes. Example:

[{"n":"/5"}]

Is path to an Instance (/OID/IID) allowed in the payload?

Yes. Example:

[{"n":"/3/0"}]

hannestschofenig commented 5 years ago

I should also note that just because you are able to make that request doesn't actually mean that you get the results back that way since the LwM2M Client has to check for access rights.