Internet-Draft | CoAP Application version of Resource Directory | January 2020 |
Schaad | Expires 6 July 2020 | [Page] |
This is a draft of what I think a CoRE Application should look like.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 6 July 2020.¶
Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
This document explores how a CoRE Resource Directory [I-D.ietf-core-resource-directory] might look if based on [CoRAL]. This document is not currently intended as something to be standardized at this time.¶
Refer to the introduction of [I-D.ietf-core-resource-directory]. Concise Binary Object Representation (CBOR) [CBOR] is a compact self-describing binary encoding formation that is starting to be used in many different applications. One of the primary uses of CBOR is in the Internet of Things where the constrained nature means that having minimal size of encodings becomes very important. The use of the Cryptographic Message System (CMS) [CMS] is still one of the most common method for providing message-based security, although in many cases the CBOR Object Signing and Encryption (COSE) [COSE] message-based security system is starting to be used. Given that CBOR is going to be transported using CMS, it makes sense to define CMS content types for the purpose of denoting that the embedded content is CBOR. This document defines two new content types: CBOR Content Type and CBOR Sequence Content Type [I-D.ietf-cbor-sequence].¶
Unless otherwise noted, all of the vocabulary defined in this document are prefixed with "http://jimsch.example.org/rd#". For convience, all item defined in this vocabulary is tagged with strong.¶
This container represents a single endpoint on a resource server. The content module of this container is:¶
This container represents a single resource that is provided by a server. There is no requirement on the content model for this container type.¶
This container provides a method of pulling link attributes into the RD content model. The target of the container is the name of the link attribute. The values of the container is value with one field occurring for each different value. Unlink link attributes, space separated values are listed at multiple values.¶
Where this document as defined an equivalent to a link attribute, that equivalent MUST be used. Where equivalents are defined in other documents, that equivalent SHOULD be used when it is new. Where equivalents are defined in other documents for long standing attributes, the RD SHOULD NOT attempt to map between them but to keep them as they were registered. In this case it is a requirement on the registering agent to ensure that when things are registered both ways they are the same.¶
This container allows for grouping together a set of resources. The purpose of the container is to be able to allow for an endpoint to advertise resources at different addresses but associated with that endpoint. Endpoints SHOULD NOT advertise resources on other systems, even if those resources are copies of a resource on the system. Instead, alternative should be used for that purpose.¶
The endpoint base URI of a registration. This represents a URI that typically gives the scheme and authority information about an endpoint. The endpoint base URI is provided at registration or update time, and is used by the RD to resolve relative references when returning resource descriptions. Separating the base URI allows for it to be patched independently of the resource items.¶
This is equivalent to the base link attribute defined in [I-D.ietf-core-resource-directory].¶
This is equivalent to the ct link attribute defined in [????].¶
A UTF8 string indicating the name of the endpoint. The endpoint name MUST NOT include characters in the range 0-31 or 127-159.¶
This is equivalent to the ep link attribute defined in [I-D.ietf-core-resource-directory].¶
A string indicating the sector to which an endpoint belongs. In the context of a Resource Directory, a sector is a logical grouping of endpoints.¶
This is equivalent to the d link attribute defined in [I-D.ietf-core-resource-directory].¶
This leaf occurs in an rd-linkAttribute and holds a single value for a link attribute.¶
The endpoint interface is used by a client to update or remove an endpoint and its associated resources from the resource directory. The interface supports the following operations:¶
The register interface is used by a client to register an endpoint and its associated resources with the ressource directory. This interface is intended both for an endpoint to register itself as well as third party registration of an endpoint.¶
The registration interface supports one operation: POST. The content of the POST operation is a CoRAL document containing the content of a rd-endpoint. The rd-endpoint container itself MAY be included, but only the content of the container is expected.¶
Processing a registration request involves the following steps:¶
The resource search interface is used by clients to locate and retrieve the description of resources based on some criteria.¶
The resource search interface supports one operation: FETCH. The content of the FETCH operation is a set of search criteria to be matched against all of the resources registered with the RD. The rules for doing a match following the rules in Appendix A.1 with one addition. The container rd-group is ignored when doing matching against the criteria. Specifically, the rd-item in the container are always matched against.¶
If an rd-endpoint is included in the search criteria, then the endpoint which hosts the resource is matched against that criteria.¶
This resource represents the entry point into the Resource Directory. The resource always exists in some form on a resource directory server. The resource will support the GET verb to return a CoRAL document describing where the interfaces on the resource directory can be found.¶
This resource can additionally support the rd-register and either the rd-endpointSearch or rd-resourceSearch interfaces.¶
In order to have interop, a number of items need to be defined. For the example below the following assumptions are made:¶
Key | Value |
---|---|
1 | http://jimsch.example.org/rd#content-type |
2 | http://jimsch.example.org/rd#ace-Profile |
3 | http://jimsch.example.org/rd#authority-type |
4 | http://jimsch.example.org/rd#authority |
5 | http://jimsch.example.org/rd#rd-register |
6 | http://jimsch.example.org/rd#rd-endpointSearch |
7 | http://jimsch.example.org/rd#rd-resourceSearch |
8 | http://jimsch.example.org/rd#ace-Audience |
Request: GET coap://jimsch.example.org/rd Accept: TBD-CoRAL Response: 2.05 Content Content-Format: TBD-CoRAL #using <http://jimsch.example.org/rd#> rd-register </rd/endpoints> [ content-type TBD-CoRAL authority <coap://ace.example.org/token> [ authority-type "ACE" ace-Profile "coap_oscore" ace-Audience "jimsch.example.org" ] ] rd-endpointSearch </rd/endpoints> rd-resourceSearch <rd/resources> rd-register <coaps://jimsch.example.org/rd/endpoints> [ content-type TBD-CoRAL authority <coap://ace.example.org/token> [ authority-type "ACE" ace-Profile "coap_oscore" ace-Profile "coap_dtls" ace-Audience "jimsch.example.org" ] authority _ [ authority-type "X.509" ] ] #base <coaps://jimsch.example.org/rd> rd-endpointSearch </rd/endpoints> rd-resourceSearch </rd/resources> or [[2, 5, [5, 2, 6, "endpoints"], [ [2, 1, 99599], [2, 4, [2, "ace.example.org", 6, "token"], [ [2, 2, "coap_oscore"], [2, 3, "ACE"], [2, 8, "jimsch.example.org"] ]] ]], [2, 6, [5, 2, 6, "endpoints"]], [2, 7, [5, 2, 6, "resources"]], [1, [1, "coaps", 2, "jimsch.example.org", 6, "rd"]], [2, 5, [5, 2, 6, "endpoints"], [ [2, 1, 99599], [2, 4, [2, "ace.example.org", 6, "token"], [ [2, 2, "coap_oscore"], [2, 2, "coap_dtls"], [2, 3, "ACE"], [2, 8, "jimsch.example.org"] ]] ]], [2, 6, [5, 2, 6, "endpoints"]], [2, 7, [5, 2, 6, "resources"]]]¶
Sample registration of an endpoint with four resources.¶
POST coaps://jimsch.example.com/rd/endpoints Content-Format: TBD-CoRAL rd-endpointName "node1" rd-base <coaps://[2001:db8:1::1]> rd-item </sensors/temp> [ content-type 41 resource-type "temperature-c" rd-linkAttribute "if" [ value "sensor" ] describedby <http://www.example.com/sensors/temp> ] rd-item </temp> [ content-type 0 resource-type "temperature" ] rd-item </light> [ content-type 0 resource-type "light-lux" ] rd-item </t> [ ]¶
Example registration of a resource server which exposes resources on multiple addresses. This example was made mechanically from /.well-known/core for my test server, as such it is missing several items which it would normally have dealing with security and other items as there are no uniform link attributes for these features. At some point I might go in and clean this up based on how things are enforced, such as items which cannot be read due to security issues. This example uses the CoRAL content type from [CoRAL].¶
rd-group <coap://server.example.org> [ rd-item </authz-info> rd-item </rd> [ content-type 40 content-type 65088 resource-type "core.rd" ] rd-item </rd/post2> rd-item </rd-lookup> rd-item </rd-lookup/ep> [ content-type 40 content-type 65088 resource-type "core.rd-lookup-ep" ] rd-item </rd-lookup/res> [ content-type 40 resource-type "core.rd-lookup-res" ] rd-item </ace-echo> rd-item </ExtraLargeResource> [ resource-type "BlockWiseTransferTester" title "This is a large resource for testing block-wise transfer" ] rd-item </StorageHere> rd-item </oscore> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/LargeResource> [ resource-type "BlockWiseTransferTester" title "This is a large resource for testing block-wise transfer" ] rd-item </oscore/hello> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/hello/1> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/hello/2> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/hello/3> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/hello/6> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/hello/7> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/hello/coap> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/observe1> [ rd-linkAttribute obs resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/observe2> [ obs resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/test> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </ace> rd-item </ace/helloWorld> rd-item </ace/lock> rd-item </hello> [ resource-type "HelloWorldDisplayer" title "GET a friendly greeting!" ] ] rd-group <coaps://server.example.org> [ rd-item </authz-info> rd-item </rd> [ content-type 40 content-type 65088 resource-type "core.rd" ] rd-item </rd/post2> rd-item </rd-lookup> rd-item </rd-lookup/ep> [ content-type 40 content-type 65088 resource-type "core.rd-lookup-ep" ] rd-item </rd-lookup/res> [ content-type 40 resource-type "core.rd-lookup-res" ] rd-item </ace-echo> rd-item </ExtraLargeResource> [ resource-type "BlockWiseTransferTester" title "This is a large resource for testing block-wise transfer" ] rd-item </StorageHere> rd-item </oscore> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/LargeResource> [ resource-type "BlockWiseTransferTester" title "This is a large resource for testing block-wise transfer" ] rd-item </oscore/hello> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/hello/1> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/hello/2> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/hello/3> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/hello/6> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/hello/7> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/hello/coap> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/observe1> [ rd-linkAttribute obs resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/observe2> [ obs resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </oscore/test> [ resource-type "OSCOAP-Tester" title "GET a friendly greeting!" ] rd-item </ace> rd-item </ace/helloWorld> rd-item </ace/lock> rd-item </hello> [ resource-type "HelloWorldDisplayer" title "GET a friendly greeting!" ] ]¶
FETCH coaps://jimsch.example.com/rd/endpoints Content-Format: TBD-CoRAL rd-linkAttribute "et" [ value "oic.d.sensor" ] 2.05 Content Conent-Type: TBD-CoRAL rd-endpoint <endpoints/1234> [ endpoint-name "node5" resource-type "core.rd-ep" rd-linkAttribute "et" [ value "oic.d.sensor" ] ] rd-endpoint <endpoints/4521> [ endpoint-name "node7" domain "floor-3" resource-type "core.rd-ep" rd-linkAttribute "et" [ value "oic.d.sensor" ] ]¶
FETCH coaps://jimsch.example.com/rd/resources Content-Format: TBD-CoRAL rd-endpoint null [ rd-linkAttribute "et" [ value "oic.d.sensor" ] ] 2.05 Content Content-Format: TBD-CoRAL #base <coap://sensor1.example.com> rd-item </sensors> [ content-type 40 title "Sensor Index" ] rd-item </sensors/temp> [ resource-type "temperature-c" rd-linkAttribute "if" [ value "sensor" ] describedby <http://www.example.com/sensors/t123> alternate </t> ] rd-item </sensors/light> [ resource-type "light-lux" rd-linkAttribute "if" [ value "sensor" ] ] #base <coap://sensor2.example.com> rd-item </sensors> [ content-type 40 title "Sensor Index" ] rd-item </sensors/temp> [ resource-type "temperature-c" rd-linkAttribute "if" [ value "sensor" ] describedby <http://www.example.com/sensors/t123> alternate </t> ] rd-item </sensors/light> [ resource-type "light-lux" rd-linkAttribute "if" [ value "sensor" ] ]¶
There are none, this is a thought experiment.¶
There are some, this is a thought experiment.¶
The start for FETCH is on github for CoRAL. Nothing has been done for PATCH. This appendix is merely a place for me to start thinking about things.¶
Need to look at this in detail, because it may be very complicated. I am not sure that the same CoRAL document format can be used. One of the issues is how to match the nth version of something. JSON Patch is probably a better model than SEML patch.¶
Unless otherwise noted, all of the vocabulary defined in this document are prefixed with "http://jimsch.example.org/rd#". For convience, all item defined in this vocabulary is tagged with strong.¶
The authority container is used to hold information about how authentication is going to be done. The container MUST include a authority-type. The rest of the content of the container is dependent on the value of the authority type.¶
Is a string which identifies what type of authority is being used. Currently defined values are in Table 2.¶
ACE | The ACE profile [I-D.ietf-ace-oauth-authz] |
X.509 | X.509 Certificates containing specific information are used for authentication. |
Leafs¶
Leafs¶