OpenMobileAlliance / OMA_LwM2M_for_Developers

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

Uri-Path and Uri-Query of Server URI #230

Closed kFYatek closed 5 years ago

kFYatek commented 7 years ago

Up until the second-to-last pre-1.0 draft, the LwM2M Server URI Resource in Section E.1 (LwM2M Object: LwM2M Security) read:

Uniquely identifies the LwM2M Server or LwM2M Bootstrap-Server, and is in the form: "coaps://host:port", where host is an IP address or FQDN, and port is the UDP port of the Server.

However, it has been changed in 2017-0051R02-CR_security_object_bugfix_uri_format, and in all current versions, including the 1.0 and 1.0.1 approved versions, it reads:

Uniquely identifies the LwM2M Server or LwM2M Bootstrap-Server. The format of the CoAP URI is defined in Section 6 of RFC 7252.

Allowing all URIs that are valid as per RFC suggests that things like paths and query-strings are now allowed, so that e.g. coaps://example.com:1234/some/crazy/path?and=more&craziness now seems a valid LwM2M Server URI.

However, other parts of the spec do not seem to be prepared for such URIs; for example, section 8.2.4 mentions that Register shall be sent on the "/rd" URI and also that "The LwM2M Server MUST return a location under the /rd path segment" in Location-Path Options. It might be interpreted as requiring an absolute "/rd" path, essentially discarding any Uri-Path present in the Server URI.

There are more unresolved questions if the configured Server URI includes a query string. Shall these values be reproduced when sending Register or Bootstrap-Request? What if the configured URI already contains some query-string arguments that are meaningful for LwM2M, such as ep? Also, what about Update?

All in all:

kFYatek commented 7 years ago

Another interpretation that didn't occur to me while originally writing this ticket is that the Server URI written to the data model should actually include the /rd or /bs path.

So another question is: if Uri-Path in the Server URI resource is allowed and meaningful

kFYatek commented 7 years ago

Also, just noting that on-site input from @hannestschofenig during the meeting of the Working Group with TestFest Warsaw participants on Wednesday seemed to suggest that:

As for me, I think this would be a perfectly suitable conclusion.

hannestschofenig commented 6 years ago

From a related issue:

Allow to include uri-path and any uri-query in a resource of LwM2M server URI (/0/0/0). This will enable passing extra information (like tenancy) to LwM2M server.

For example: coaps://example.com:5684/my-creazy-rd?parameter=value then client registers: POST coaps://example.com:5684/my-creazy-rd?parameter=value&ep=device0123

hannestschofenig commented 6 years ago

For v1.1 we have to clarify the security processing that relates to the comparison between the content of a certificate (such as the string contained in the CN field of a cert) with the LwM2M Server URI resource value. A dedicated resource carrying the Server Name Indication (SNI) has been defined already.

hannestschofenig commented 5 years ago

If this issue is still valid, please re-issue it against the LwM2M v1.1 release.