-
Notifications
You must be signed in to change notification settings - Fork 80
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
Apply baseURI to list of things generated by HTTP server #932
Comments
@justus237 your thinking makes sense to me but maybe I miss some (corner) cases. @relu91 do you know? |
Yes we definitely need a fix for this issue, since I always have hard time to use node-wot inside a container runtime. Maybe, it is too ambitious but if @justus237 is willing to work with a PR we should come up with a mechanism that would work for all the protocol bindings. Currently, to personalize the form
We need a single mechanism consistent across all binding templates. We also need something that can work for different use cases:
|
Going back to the issue, the list of available Things should be moved to the appropriate syntax ( see the discovery spec) but meanwhile we can at least fix it so that it can be really used. |
Trying to find this in the discovery spec, are you referring to https://w3c.github.io/wot-discovery/#exploration-directory-api-things-listing? |
Am I correct to assume that this would ("only") need to touch all the binding templates with servers, i.e., HTTP(S), CoAP, MQTT, (firestore?) and websocket? The most straightforward approach would be to extend the Helpers class? |
yes that one, but it would be nice to support CoRE Directories too.
Yes exactly, currently we ask the helper class for a list of possible |
Reviving this, there are currently already multiple competing "definitions" for specifying You can define the What is the big picture here? I feel like there are multiple competing mechanisms that all attempt to do the same thing, but they’re all different. Is the goal to have maximum flexibility and just have all the mechanisms co-exist? With the list of available Things I can somewhat understand that CoRE directories are likely most useful for CoAP bindings, and putting all TDs in a list is probably most suited for the HTTP bindings. So all bindings might have a different "list of things" mechanism, but they do not compete with each other, whereas the origin/endpoint/base concepts all clash. |
You are right, there is a little bit of confusion here mostly because node-wot is an experimental effort to implement the specifications and during that time it tried to follow back all the features but sometimes we had to find some workaround. Let me try to clean up the waters a little bit. There are two mechanisms to control the final GenerativeIn node-wot, you can create your In practice, we don't allow the user to specify DeclarativeThing Descriptions have a member called base which can be used to calculate the full Does this help?
Let's talk about this in a dedicated issue and focus this thread only on the generation of the base URI of |
Thanks for the reply and explanation. Is there a specific reason why Going back to the implementation, assume I create a servient with an If I want to customize the form URIs, I would want to specify the Another option is adding the It sounded like you would prefer using |
My guess:
Other than these I don't think there is any blocking issue. We can get around point 1 by incubating a proposal here, but since in the spec
Yeah, this was my original idea, cause it would be quite elegant to have a single place that is used by all the bindings. But now I'm figuring out that different protocols will need different strings for schemes or other URI parts. Configuring that without leaking protocol infos into the Therefore, I think extending the configuration options of each protocol binding is the only good solution now. it just needs to be consistent across all of them. |
I think that overall it is important to differentiate what features of the partial TD given to the
|
The way the code is currently structured, the ExposedThing is not directly aware of all protocol binding servers (only of the servient, I think), and the servers are not aware of each other. Finding a common Regarding the configuration at the servient, as far as I can tell, this is basically what Regardless, I think the "start" should be implementing the configuration at the protocol binding level. The main question I have here is, how "backwards" compatible node-wot is meant to be. Currently the CoAP server takes configuration parameters directly in the constructor, while the HTTP server takes HttpConfigs. Also, if a new mechanism (e.g., |
It turned out to be much simpler to do one a pass over the TD to convert all
This is surely not a strong argument but at least a reason at that time... I think |
Yes, we can improve the approach later. I would say that what is important is to allow the user to configure the form generation as he pleased... we can refine the inner workings later. About backward compatibility, we are still in 0.x.y phase so we don't have that strict requirement to maintain everything backward compatible. Currently, we are increasing the minor only if |
Setting the baseURI in the configuration of an HTTP server currently changes the forms for all interaction affordances, but does not apply to the list of Things exposed by the server (https://github.com/eclipse/thingweb.node-wot/blob/master/packages/binding-http/src/http-server.ts#L694).
Not sure whether this is intended or not, but because the baseURI configuration is separate from base in the Thing Description, I thought it might be worth having baseURI applied consistently. This also avoids leaking local IP addresses if a node-wot server is exposed to the Internet through port forwarding, which was my use case.
If this is worth fixing/merging, I'll open a pull request.
The text was updated successfully, but these errors were encountered: