Skip to content

feat: expand exploreDirectory algorithm #545

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

Closed
wants to merge 4 commits into from

Conversation

JKRhb
Copy link
Member

@JKRhb JKRhb commented Feb 5, 2024

This PR contains a rough first draft for expanding the exploreDirectory algorithm.


Preview | Diff

@JKRhb JKRhb force-pushed the explore-directory-additions branch from 0e3ab07 to a16f076 Compare March 18, 2024 11:04
index.html Outdated
Run the <a>discovery process</a> given |discovery| by
either invoking one of the actions associated with the Search API
– if the {{ThingDiscoveryProcess/[[filter]]}} argument is not
`undefined` or `null` – or reading the `things` property.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be expanded into more concise sub-steps.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started the split into sub-steps, however, there is still some more refinement needed.

@JKRhb JKRhb force-pushed the explore-directory-additions branch from 6191f67 to dc81bc5 Compare July 8, 2024 09:03
@zolkis
Copy link
Contributor

zolkis commented Jul 10, 2024

The algorithm drafted here looks more like an internal implementation detail. It is hard to standardize it in order to expose these details to scripts. Or, in other words, it's hard to distillate simple APIs that cover the programmatic side of discovery, without going too much into protocol details -- since then a script could just use the network/REST API.

I am thinking if we could make examples on how to fetch TD directories using the Discovery spec / network API, as depicted here. Those will help figuring out if we can distillate a good programmatic API on top of that.

Currently the WoT Discovery introduction mechanisms are definitely encapsulated in the Scripting implementation.

Moreover, the Authentication layer and the Exploration layer, too, are encapsulated. The Scripting API presents another (programmatic) exploration API that connects to the middleman (the Scripting implementation), provisioned as an endpoint in the given WoT solution, and maybe represented (in the future) as an internal slot to the implementation (to the WoT API object). True, we are missing a standard provisioning API, but more about this later.

Since currently we are not co-hosting multiple solutions in a single WoT runtime (Scripting implementation, i.e. WoT API object), this works quite well, separating the complexities of the underlying WoT Discovery spec.

We can specify a separate API for implementing the details of the WoT Discovery spec, and that should be in a different conformance class, with its own Security section, same level as WoT Provisioning. In my view, these belong to the next level down in the stack. If we were to standardize these (Provisioning, Discovery introduction + exploration), I would support it, but eventually in a separate deliverable (spec, impl + tests) in the WG.

If we were to co-host and support multiple WoT/IoT solutions with a single runtime and WoT object and API, then it needs to be transparent from identification/authentication point of view as well, therefore pulling the need for more low level configuration functions -- therefore going one level down as mentioned above.

Another way to do that is to expose multiple WoT objects for multiple solutions, i.e. we need an additional root-level API to create (async) a WoT API object, with the given provisioning/initialization routines, including discovery introduction and exploration, resulting in a configured discovery "middleman" internal slot. We could use the WoT object which exposes the current API functionality the same way as now, making this proposal backwards compatible, but also (re)configurable wrt provisioning, discovery etc.

I can draft an experimental API for this in a separate issue.

@JKRhb
Copy link
Member Author

JKRhb commented Jul 11, 2024

Thank you, @zolkis, for your comment and the proposal in #558! I think we can probably close this PR then.

Should we maybe also close #535 since the discussion is going in a different direction now?

@JKRhb JKRhb closed this Jul 11, 2024
@JKRhb JKRhb deleted the explore-directory-additions branch July 11, 2024 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants