Authorizations are generally expressed through some data structures that are cryptographically secured (or transmitted in a secure way). This section discusses the information model underlying the payload of that data (as opposed to the cryptographic armor around it).
The semantics of the authorization information defined in this document are that of an
allow-list: everything is denied until it is explicitly allowed.
For the purposes of this specification, the underlying access control model will be that of an access matrix, which gives a set of permissions for each possible combination of a subject and an object. We are focusing the AIF data item on a single row in the access matrix (such a row has often been called a "capability list") without concern to the subject for which the data item is issued. As a consequence, AIF
MUST be used in a way that the subject of the authorizations is unambiguously identified (e.g., as part of the armor around it).
The generic model of such a capability list is a list of pairs of object identifiers (of type
Toid) and the permissions (of type
Tperm) that the subject has on the object(s) identified.
AIF-Generic<Toid, Tperm> = [* [Toid, Tperm]]
In a specific data model (such as the one specified in this document), the object identifier (
Toid) will often be a text string, and the set of permissions (
Tperm) will be represented by a bit set, which in turn is represented as a number (see
Section 3).
AIF-Specific = AIF-Generic<tstr, uint>
In the specific instantiation of the REST resources and the permissions on them, we use the URI of a resource on a CoAP server for the object identifier (
Toid). More specifically, since the parts of the URI that identify the server ("authority" in [
RFC 3986]) are authenticated during REST resource access (
Section 4.2.2 of
RFC 9110 and
Section 6.2 of
RFC 7252), they naturally fall into the realm handled by the cryptographic armor; we therefore focus on the "path" ("path-abempty") and "query" parts of the URI (
URI-local-part in this specification, as expressed by the Uri-Path and Uri-Query options in CoAP). As a consequence, AIF
MUST be used in a way that it is clear who is the target (enforcement point) of these authorizations (note that there may be more than one target that the same authorization applies to, e.g., in a situation with homogeneous devices).
For the permissions (
Tperm), we use a simple permissions model that lists the subset of the REST (CoAP or HTTP) methods permitted. This model is summarized in
Table 1.
URI-local-part |
Permission Set |
/s/temp |
GET |
/a/led |
PUT, GET |
/dtls |
POST |
Table 1: An Authorization Instance in the REST-Specific AIF Information Model
In this example, a device offers a temperature sensor
/s/temp for read-only access, a LED actuator
/a/led for read/write, and a
/dtls resource for POST access.
As shown in the data model (
Section 3), the representations of REST methods provided are limited to those that have a CoAP method number assigned; an extension to the model may be necessary to represent permissions for exotic HTTP methods.
This simple information model only allows granting permissions for statically identifiable objects, e.g., URIs for the REST-specific instantiation. One might be tempted to extend the model towards URI templates [
RFC 6570] (for instance, to open up an authorization for many parameter values as in
/s/temp{?any*}). However, that requires some considerations of the ease and unambiguity of matching a given URI against a set of templates in an AIF data item.
This simple information model also does not allow expressing conditionalized access based on state outside the identification of objects (e.g., "opening a door is allowed if it is not locked").
Finally, the model does not provide any special access for a set of resources that are specific to a subject, e.g., that the subject created itself by previous operations (PUT, POST, or PATCH/iPATCH [
RFC 8132]) or that were specifically created for the subject by others.
The
REST-specific model with dynamic resource creation addresses the need to provide defined access to dynamic resources that were created by the subject itself, specifically, a resource that is made known to the subject by providing Location-* options in a CoAP response or using the Location header field in HTTP [
RFC 9110] (the Location-indicating mechanisms). (The concept is somewhat comparable to "Access Control List (ACL) inheritance" in the Network File System version 4 (NFSv4) protocol [
RFC 8881], except that it does not use a containment relationship but rather the fact that the dynamic resource was created from a resource to which the subject had access.) In other words, it addresses an important subset of the third limitation mentioned in
Section 2.2.
URI-local-part |
Permission Set |
/a/make-coffee |
POST, Dynamic-GET, Dynamic-DELETE |
Table 2: An Authorization Instance in the REST-Specific AIF Information Model with Dynamic Resource Creation
For a method X, the presence of a Dynamic-X permission means that the subject holds permission to exercise the method X on resources that have been returned in a 2.01 (201 Created) response by a Location-indicating mechanism to a request that the subject made to the resource listed. In the example shown in
Table 2, POST operations on
/a/make-coffee might return the location of a resource dynamically created on the coffee machine that allows GET to find out about the status of, and DELETE to cancel, the coffee-making operation.
Since the use of the extension defined in this section can be detected by the mentioning of the Dynamic-X permissions, there is no need for another explicit switch between the basic and the model extended by dynamic resource creation; the extended model is always presumed once a Dynamic-X permission is present.