-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read-Only Directories #208
Comments
I would support lessening a little bit the spec to allows TDD to be just a queryable collection of TDs. It makes the mandatory implementation requirements smaller hence simpler to realize. Besides, I know that we are not aiming for cross-protocol compatibility, but a smaller set of functionalities is also easier to port. An additional point would be that the webthings.io gateway would be easier to align. Maybe @benfrancis can expand on this. |
Yes we have the same situation with WebThings Gateway.
+1 for allowing read-only directories. |
Going back to this issue. In this PF (among the other projects), I was thinking to add a TDD interface to node-wot. But again the mandatory updates methods make no sense in that context, cause the WebThings can be only registered by node-wot itself. Also, why can a TDD only be a collection of TDs? Why is JSONPath mandatory? In node-wot, we also evaluated the well-known URL introduction mechanism, but it seems to not fit well as well. eclipse-thingweb/node-wot#411 . @danielpeintner I'm tagging you here if you want to add more feedback on this 😃 . |
The problem we are seeing is that I am not sure if if miss anything but what makes most sense to me is that the host simply returns a list of links to things. Moreover, each thing itself can self-describe itself under well-known, Note: at the moment the TD is reported under http://plugfest.thingweb.io:8083/smart-coffee-machine directly |
RFC8615 says:
So, we can not use this introduction mechanism to put a TD for each thing on a single host... Or, we can update current specification, such as:
|
Thank you for the feedback! I would say then we have several different options here:
Anyway, let's discuss more on today's F2F call! |
The introduction mechanism is meant to point to a single thing. If a host has multiple of them and intends to act as a directory, the intro should resolve to the TD of that directory. If not, one way to address that is to have a virtual thing (hosted at the well-known address) with TD.links to actual things. |
Proposed Actions:
We might do 1 and 2, or just 2. Proposed solution:
No consensus yet:
Please continue in the comments below and state whether or you support the above proposal.
|
I agree.
+1 |
@farshidtz has confirmed in #267 that the registration API is mandatory for a ThingDirectory, and that the registration API must include create, update, read, delete and list operations. I think this may make it impossible to make WebThings Gateway compliant with the Directory exploration mechanism part of the specification, because it has a bunch of assumptions which don't apply to gateways. With WebThings Gateway, most devices are added out of band using some other non-WoT protocol (like Zigbee or Z-Wave). A software adapter generates a read-only Thing Description (and API) for the device which is then included in a listing of Things. Consumers can read the list of Things and interact with them using the API, but they can't arbitrarily create a Thing out of thin air or update an existing Thing, because that's just not how a gateway (at least not this gateway) works. A Consumer can't just add a new property to a Thing if that property doesn't actually exist in the physical device for example. Unless these assertions change, and read-only directories are allowed, I don't think I'll be able to implement the Directory Service API. Edit: Note that certain aspects of Thing Descriptions are actually editable (such as the title), but arbitrarily creating and updating Thing Descriptions is simply not feasible. |
What does it even mean that write operations are mandatory? What should a Consumer do if it comes across a directory which doesn't allow creation of Things, or only allows editing certain members of Thing Descriptions? Would it prevent the Consumer from listing and reading Things? What should a directory do if a Consumer tries to edit a Thing Description it doesn't own? It's surely also true that directories may want different levels of authorisation for particular operations on particular Things? |
I think that the reading and writing level of permissions will be indicated via the TD of the TDD, i.e. auth1 is needed for all operations and auth2 is needed for write level operations. Still, I think that these kinds of mechanisms are what is going to be annoying because they will force consumers to read the TD of the TDD. In a custom Consumer implementation, I have used all the CRUDL operations on WoT-Hive (from @AndreaCimminoArriaga) and then simply replaced the URL of the TDD with the Logilab one (from @wiresio). Everything worked fine (a nice win for interoperability) since both were using no security. However, once two TDDs do not implement the same list of CRUDL interfaces with the exact same security on all levels, such generic consumers cannot be written. One would need to adapt a TDD Consumer based on the TD of the TDD, which can be really annoying (but doable) for humans and pretty difficult to do it programmatically. A nervous comment: Maybe profiles for TDDs? |
@egekorkan wrote:
The way that I always assumed permissions would work is that the Thing Description will only show interactions which the user who requested it is permitted to perform. I guess not everyone sees it that way since Thing Descriptions are considered static resources. Perhaps both approaches could be supported, since a Thing Description can either be dynamically generated or statically served like any other JSON resource.
We have discussed the possibility of requiring support for the Directory Service API in the Core Profile, I'm not sure whether that's reasonable or not. Getting back to the point, is there a technical reason why write operations need to be mandatory? |
In the gateway use case that you just explained, the directory does support write operations, but via means other than the HTTP registration API. Note than in the current editor's draft, the HTTP registration API must implement CRUDL. But there is currently no assertion which says that the HTTP registration API is required in a directory, because the TM is yet to define what is required. The TD which got replacement by that TM was including the registration API so we have an understanding that it is mandatory, but it isn't written anywhere right now. I suggest you keep an eye on #86 and possible upcoming PRs and raise you arguments. I think one possible solution for a directory that wants to expose a TD collection produced from static resources is to split listing ( IMO, the registration API should not have that name and exclude the primitive "registration" functionality. The directory on the other hand, can exclude the registration API and still be a directory for listing and maybe search/filtering. |
@farshidtz wrote:
OK thanks, I will.
That makes a lot of sense. The registration API and listing API could continue to share the same |
+1 for this direction. |
Actions:
|
Also:
|
I've submitted a PR to resolve the concerns raised here. Two use cases are considered:
Returning multiple TDs from introductions mechanism (well-known and dns-sd) is discussed in #249. |
I am building a device hub around TD. Currently, it communicates available TDs by simply sending an array of all known TDs to a predetermined url known by my specific client app, but I am interested in switching to the Discovery spec for greater compatibility.
However, looking through the spec, it seems the create / update / delete operations are not optional. Since my hub represents a source of real devices (zwave in this case), creation or modification of their spec is undesirable. The closest I could get is setting the hub into inclusion mode for a new zwave device, but the device capabilities (and the resulting TD) is not left up to the user.
After reviewing the options in the Discovery spec, I don't seem to have a clear path forward:
I suppose I could implement the CRUD actions and return FORBIDDEN for all of them regardless of operation, but that seems a bit cheaty...
My use case would be much better served if there was a way to advertise a single thing, and have that thing return additional TDs, just like a directory but without the contractual mutation support.
The text was updated successfully, but these errors were encountered: