Skip to content
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

Support pnp_model_id in the IoTHubClientBuilder #64

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

laumann
Copy link
Contributor

@laumann laumann commented Oct 6, 2021

This PR supercedes #61 - instead of adding IoTHubClient::new_with_pnp(), add a pnp_model_id() function to the new IoTHubClientBuilder.

Depends on #62, #63

To support different configuration parameters, implement a builder
pattern for IoTHubClient, that initially just supports the same
parameters as IoTHubClient::new().
To use this library in an IoT Edge deployment we need to be able to set
add root certificates to the trust store.

See: https://docs.microsoft.com/en-us/azure/iot-edge/how-to-connect-downstream-device?view=iotedge-2020-11#provide-the-root-ca-certificate
As part of the plug-n-play (PNP) functionality, the IoTHubClient should
be able to support announcing a model ID. The model ID must be a valid
DTMI. The module introduced here implements validation for a string as a
possible DTMI.

See https://github.com/Azure/digital-twin-model-identifier
@laumann
Copy link
Contributor Author

laumann commented Oct 6, 2021

@damienpontifex Only the last two commits 05226a6 and f9d3f5d should be reviewed here.

@laumann laumann force-pushed the builder-pnp-model-id branch from f9d3f5d to 5e75b36 Compare October 6, 2021 11:23
The idea with PNP is that connecting devices can announce a model ID
which should be a valid DTMI when connecting. This functionality is only
really supported for MQTT.

The IoTHubClientBuilder accepts a str that it attempts to turn into a
Dtmi instance which can only be constructed if it passes validation.
@laumann laumann force-pushed the builder-pnp-model-id branch from 5e75b36 to e52b5ce Compare October 6, 2021 11:40
@damienpontifex damienpontifex added the enhancement New feature or request label Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants