-
Notifications
You must be signed in to change notification settings - Fork 2
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
Update device provisioning service documentation #165
Conversation
WalkthroughThe recent changes primarily focus on updating the documentation for the Device Provisioning Service (DPS). Key modifications include the removal of specific configuration examples, deployment commands, and the deletion of certain API header files. The documentation now emphasizes the hub component, reflecting a shift in management and deployment strategies for the DPS, while also enhancing clarity for developers interacting with the service. Changes
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
💤 Files not reviewed due to no reviewable changes (4)
✅ Files skipped from review due to trivial changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for docsplgd ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (10)
- content/en/docs/configuration/certificate-authority.md (1 hunks)
- content/en/docs/configuration/cloud2cloud-gateway.md (1 hunks)
- content/en/docs/configuration/coap-gateway.md (1 hunks)
- content/en/docs/configuration/device-provisioning-service.md (4 hunks)
- content/en/docs/configuration/grpc-gateway.md (1 hunks)
- content/en/docs/configuration/http-gateway.md (1 hunks)
- content/en/docs/configuration/identity-store.md (1 hunks)
- content/en/docs/configuration/resource-aggregate.md (1 hunks)
- content/en/docs/configuration/resource-directory.md (1 hunks)
- content/en/docs/configuration/snippet-service.md (1 hunks)
Additional comments not posted (14)
content/en/docs/configuration/identity-store.md (1)
64-64
: Addition ofcacheExpiration
parameter is well-documented.The new configuration parameter
apis.grpc.authorization.tokenTrustVerification.cacheExpiration
is clearly defined with a description and default value. This enhances the documentation by providing users with more control over token caching behavior.content/en/docs/configuration/certificate-authority.md (1)
66-66
: Addition ofcacheExpiration
parameter is well-documented.The new configuration parameter
apis.grpc.authorization.tokenTrustVerification.cacheExpiration
is clearly defined with a description and default value. This enhances the documentation by providing users with more control over token caching behavior.content/en/docs/configuration/http-gateway.md (1)
60-60
: Addition ofcacheExpiration
parameter is well-documented.The new configuration parameter
apis.http.authorization.tokenTrustVerification.cacheExpiration
is clearly defined with a description and default value. This enhances the documentation by providing users with more control over token caching behavior.content/en/docs/configuration/resource-aggregate.md (1)
64-64
: Addition ofcacheExpiration
parameter is well-documented.The new configuration parameter
apis.grpc.authorization.tokenTrustVerification.cacheExpiration
is clearly defined with a description and default value. This enhances the documentation by providing users with more control over token caching behavior.content/en/docs/configuration/resource-directory.md (1)
65-65
: Addition oftokenTrustVerification.cacheExpiration
Configuration.The new configuration parameter
apis.grpc.authorization.tokenTrustVerification.cacheExpiration
has been added correctly. It specifies the duration for which a valid token is cached before requiring re-verification, with a default value of30s
. This addition is consistent with the existing documentation format and enhances clarity regarding token management.content/en/docs/configuration/grpc-gateway.md (1)
66-66
: Addition oftokenTrustVerification.cacheExpiration
Configuration.The new configuration parameter
apis.grpc.authorization.tokenTrustVerification.cacheExpiration
has been added correctly. It specifies the duration for which a valid token is cached before requiring re-verification, with a default value of30s
. This addition is consistent with the existing documentation format and enhances clarity regarding token management.content/en/docs/configuration/snippet-service.md (1)
64-64
: Addition oftokenTrustVerification.cacheExpiration
Configuration.The new configuration parameter
apis.grpc.authorization.tokenTrustVerification.cacheExpiration
has been added correctly. It specifies the duration for which a valid token is cached before requiring re-verification, with a default value of30s
. This addition is consistent with the existing documentation format and enhances clarity regarding token management.content/en/docs/configuration/coap-gateway.md (1)
82-82
: Addition oftokenTrustVerification.cacheExpiration
Configuration.The new configuration parameter
apis.coap.authorization.tokenTrustVerification.cacheExpiration
has been added correctly. It specifies the duration for which a valid token is cached before requiring re-verification, with a default value of30s
. This addition is consistent with the existing documentation format and enhances clarity regarding token management.content/en/docs/configuration/device-provisioning-service.md (5)
17-17
: Docker image reference updated.The Docker image reference has been updated to
ghcr.io/plgd-dev/hub/device-provisioning-service:latest
, reflecting the new organizational structure. Ensure that this change aligns with the repository updates.
22-22
: Configuration template path updated.The configuration template path has been updated to
https://github.com/plgd-dev/hub/blob/main/device-provisioning-service/config.yaml
. Ensure that this path is correct and accessible.
41-41
: Improved description for CoAP API address.The description for
apis.coap.address
has been updated to "Listening specification : for coap client connection," enhancing clarity.
58-76
: Expanded HTTP API configuration options.New properties have been added under
apis.http.authorization.endpoints[]
, providing more granular control over connection management and TLS settings. These additions enhance the flexibility and security of the API configuration.
76-76
: AddedtokenTrustVerification.cacheExpiration
property.The new
tokenTrustVerification.cacheExpiration
property specifies the duration a valid token is cached before requiring re-verification, enhancing security and performance.content/en/docs/configuration/cloud2cloud-gateway.md (1)
56-56
: AddedtokenTrustVerification.cacheExpiration
property.The
tokenTrustVerification.cacheExpiration
property has been introduced to specify the duration a valid token is cached before requiring re-verification. This addition enhances security and performance by allowing better control over token management.
298248f
to
814c82d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (10)
- content/en/docs/configuration/certificate-authority.md (1 hunks)
- content/en/docs/configuration/cloud2cloud-gateway.md (1 hunks)
- content/en/docs/configuration/coap-gateway.md (1 hunks)
- content/en/docs/configuration/device-provisioning-service.md (4 hunks)
- content/en/docs/configuration/grpc-gateway.md (1 hunks)
- content/en/docs/configuration/http-gateway.md (1 hunks)
- content/en/docs/configuration/identity-store.md (1 hunks)
- content/en/docs/configuration/resource-aggregate.md (1 hunks)
- content/en/docs/configuration/resource-directory.md (1 hunks)
- content/en/docs/configuration/snippet-service.md (1 hunks)
Files skipped from review as they are similar to previous changes (9)
- content/en/docs/configuration/certificate-authority.md
- content/en/docs/configuration/cloud2cloud-gateway.md
- content/en/docs/configuration/coap-gateway.md
- content/en/docs/configuration/grpc-gateway.md
- content/en/docs/configuration/http-gateway.md
- content/en/docs/configuration/identity-store.md
- content/en/docs/configuration/resource-aggregate.md
- content/en/docs/configuration/resource-directory.md
- content/en/docs/configuration/snippet-service.md
Additional comments not posted (6)
content/en/docs/configuration/device-provisioning-service.md (6)
17-17
: Docker image name update is correct.The renaming of the Docker image to
hub/device-provisioning-service
aligns with the repository restructuring.
22-22
: Configuration template path update is correct.The path update to
hub/blob/main/device-provisioning-service/config.yaml
reflects the reorganization of project resources.
41-41
: CoAP API address description update is clear.The change from "Listen specification" to "Listening specification" improves clarity without altering functionality.
58-58
: HTTP API address description update is clear.The change from "Listen specification" to "Listening specification" improves clarity without altering functionality.
66-75
: New HTTP authorization endpoint properties are well-defined.The added properties provide granular control over connection management and TLS settings, enhancing flexibility.
76-76
:tokenTrustVerification.cacheExpiration
property addition is appropriate.The property enhances security and performance by specifying the token caching duration.
Remove all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- content/en/docs/deployment/deployment.md (1 hunks)
- content/en/docs/deployment/device-provisioning-service/device-provisioning-service.md (2 hunks)
- content/en/docs/deployment/device-provisioning-service/troubleshooting.md (2 hunks)
- content/en/docs/deployment/device-provisioning-service/verify-device-onboarding.md (1 hunks)
- content/en/docs/tutorials/disaster-recovery-replica-set.md (9 hunks)
Files skipped from review due to trivial changes (3)
- content/en/docs/deployment/deployment.md
- content/en/docs/deployment/device-provisioning-service/device-provisioning-service.md
- content/en/docs/deployment/device-provisioning-service/troubleshooting.md
Additional comments not posted (2)
content/en/docs/deployment/device-provisioning-service/verify-device-onboarding.md (1)
78-79
: Ensure consistency in service management commands.The changes from
dps
tohub
in Helm and kubectl commands reflect a shift in focus. Ensure that all related documentation and commands are consistently updated to avoid confusion.content/en/docs/tutorials/disaster-recovery-replica-set.md (1)
390-390
: Clarify the default status ofdeviceProvisioningService
.The addition of
enabled: true
fordeviceProvisioningService
implies it is now enabled by default. Ensure that this change is clearly communicated in the documentation to avoid any misunderstandings.Also applies to: 559-559
bb69745
to
7b335ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- content/en/docs/services/device-provisioning-service/client-library.md (10 hunks)
- content/en/docs/services/device-provisioning-service/time-synchronization.md (1 hunks)
Files skipped from review due to trivial changes (1)
- content/en/docs/services/device-provisioning-service/time-synchronization.md
Additional context used
LanguageTool
content/en/docs/services/device-provisioning-service/client-library.md
[misspelling] ~208-~208: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ...to synchronize with the DPS server over an connection that does not verify the val...(EN_A_VS_AN)
[style] ~209-~209: Consider a shorter alternative to avoid wordiness.
Context: ...ake option-DPLGD_DEV_TIME_ENABLED=ON
in order to enable the [time synchronization featur...(IN_ORDER_TO_PREMIUM)
[grammar] ~278-~278: You used an adverb (‘finally’) instead of an adjective, or a noun (‘section’) instead of another adjective.
Context: ...he binary (with code examples). And the finally section shows how to run it. ### Bootstrapping...(A_RB_NN)
Additional comments not posted (14)
content/en/docs/services/device-provisioning-service/client-library.md (14)
10-10
: LGTM!The link to the IoTivity-lite client-server library provides relevant context for the Device Provisioning Service.
14-14
: LGTM!The statement accurately conveys that the API is defined in the public header file.
16-16
: LGTM!The link correctly points to the
plgd_dps.h
header file.
209-209
: LGTM!The statement provides important information about enabling the time synchronization feature in IoTivity-Lite. The suggestion to consider a shorter alternative can be ignored as it is a matter of style preference.
Tools
LanguageTool
[style] ~209-~209: Consider a shorter alternative to avoid wordiness.
Context: ...ake option-DPLGD_DEV_TIME_ENABLED=ON
in order to enable the [time synchronization featur...(IN_ORDER_TO_PREMIUM)
304-305
: LGTM!The assertions are a good practice to validate input parameters and prevent potential null pointer dereferences.
309-371
: LGTM!The function correctly handles the addition of DPS CA trusted root certificate and device's manufacturer certificate. The updated function signature improves clarity by using more descriptive variable names and types. The error handling and cleanup logic is appropriate.
397-398
: LGTM!The code correctly sets the device name using the provided
g_dps_device_name
variable.
410-411
: LGTM!The code correctly sets the cloud observer configuration using the provided variables.
414-421
: LGTM!The code correctly adds endpoint addresses using the provided array. The updated
plgd_dps_add_endpoint_address
function signature allows adding multiple endpoint addresses. The error handling is appropriate.
423-426
: LGTM!The code correctly calls the
dps_add_certificates
function with the appropriate parameters to add initial certificates on factory reset. The error handling is appropriate.
449-451
: LGTM!The code correctly checks if the DPS context is empty and skips factory reset handling if true. The debug message provides clarity about the reason for skipping.
454-456
: LGTM!The code correctly calls the
plgd_dps_on_factory_reset
function with the appropriate parameter to handle the factory reset. The error handling is appropriate.
458-465
: LGTM!The code correctly calls the
manufacturer_setup
function to configure the device and theplgd_dps_manager_start
function to start the DPS manager. The error handling is appropriate.
23-23
: Verify the usage of the updatedplgd_dps_set_manager_callbacks
function signature.The statement accurately lists the setter functions used for device configuration. However, ensure that all calls to
plgd_dps_set_manager_callbacks
have been updated to match the new function signature that accepts a structplgd_dps_manager_callbacks_t
instead of individual callback parameters.Run the following script to verify the function usage:
Verification successful
To ensure a comprehensive verification, we need to check for actual usage of the
plgd_dps_set_manager_callbacks
function in implementation files. Let's run an additional search:
To address the unexpected results and ensure a thorough verification, let's first check for the existence of .c files and then perform a broader search:
Function signature update verified and consistent across codebase and documentation.
The
plgd_dps_set_manager_callbacks
function signature has been correctly updated in all relevant parts of the codebase:
- The header file
dps.h
defines the function with the new signature:void plgd_dps_set_manager_callbacks(plgd_dps_context_t *ctx, plgd_dps_manager_callbacks_t callbacks) OC_NONNULL(1);
- The documentation in
client-library.md
describes the function's usage consistent with the new signature.- Code examples in the documentation demonstrate the correct usage of the function with the new signature.
No instances of the old function signature were found. While there are no .c files in the repository, which is likely because this is a documentation or header-only library, all available references to the function are consistent with the updated signature.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all calls to `plgd_dps_set_manager_callbacks` match the new signature. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type c -A 5 $'plgd_dps_set_manager_callbacks'Length of output: 755
Script:
#!/bin/bash # Description: Search for usage of plgd_dps_set_manager_callbacks in .c files # Test: Search for function calls in .c files rg --type c -g '*.c' -A 5 'plgd_dps_set_manager_callbacks\s*\('Length of output: 214
Script:
#!/bin/bash # Description: Check for .c files and search for plgd_dps_set_manager_callbacks usage # Test 1: Check for the existence of .c files echo "Checking for .c files:" fd -e c # Test 2: Perform a broader search for the function name across all files echo -e "\nSearching for plgd_dps_set_manager_callbacks usage:" rg -A 5 'plgd_dps_set_manager_callbacks'Length of output: 4843
content/en/docs/services/device-provisioning-service/client-library.md
Outdated
Show resolved
Hide resolved
content/en/docs/services/device-provisioning-service/client-library.md
Outdated
Show resolved
Hide resolved
content/en/docs/deployment/device-provisioning-service/troubleshooting.md
Outdated
Show resolved
Hide resolved
67d2bb7
to
e2ed731
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (5)
content/en/docs/deployment/device-provisioning-service/verify-device-onboarding.md (4)
78-79
: LGTM! Consider adding a comment for clarity.The changes align with the PR objectives to update terminology. The Helm release name has been updated from 'dps' to 'hub', and the pod deletion command now targets 'plgd-hub' pods.
Consider adding a brief comment explaining the reason for deleting the pods after the Helm upgrade. This can help users understand the purpose of this step. For example:
helm upgrade -i -n plgd --create-namespace -f withUpdatedMock.yaml hub plgd/plgd-hub +# Delete existing pods to ensure they're recreated with the updated configuration kubectl -n plgd delete $(kubectl -n plgd get pods -o name | grep "plgd-hub")
97-97
: LGTM! Consider adding documentation about the new image.The Docker image has been updated from 'plgd-dev/device-provisioning-client' to 'iotivity/iotivity-lite', which aligns with the changes mentioned in the AI-generated summary.
Consider adding a brief comment or documentation explaining the reason for this change and any potential differences in functionality or usage with the new IoTivity Lite image. This can help users understand the implications of this update. For example:
+# Using IoTivity Lite image for the device provisioning client docker run -it --rm -v $HOME/plgd_certs/device/pki_certs:/dps/pki_certs ghcr.io/iotivity/iotivity-lite/dps-cloud-server-debug:latest test-device "coaps+tcp://example.com:15684"
125-125
: LGTM! Ensure consistency in documentation.The Docker image update is consistent with the change made in the Zero Trust network section, which is good for maintaining consistency throughout the document.
For consistency, consider adding a similar comment as suggested for the Zero Trust network section:
+# Using IoTivity Lite image for the device provisioning client in Trusted network mode docker run -it --rm -v $HOME/plgd_certs/device/pki_certs:/dps/pki_certs ghcr.io/iotivity/iotivity-lite/dps-cloud-server-debug:latest test-device "coaps+tcp://example.com:15684" --no-verify-ca
Line range hint
1-125
: Consider adding more context about the changes.The updates to the Docker image and Helm release name are consistent throughout the document. However, to improve the overall documentation quality:
Consider adding a brief explanation at the beginning of the document about the transition from 'dps' to 'hub' and the switch to the IoTivity Lite image. This will help users understand the context of these changes.
Update the document title or add a note to reflect that this guide now covers the hub component instead of focusing solely on the Device Provisioning Service.
Review any references to 'DPS' or 'Device Provisioning Service' throughout the document and update them if necessary to align with the new terminology (e.g., "hub" or "plgd hub").
These additions will provide more context and clarity for users following this guide.
content/en/docs/services/device-provisioning-service/client-library.md (1)
208-209
: LGTM with a minor suggestion.The changes improve the clarity of the time synchronization explanation. However, we can make a small adjustment to reduce wordiness.
Consider simplifying the sentence structure slightly:
-It's important to note that IoTivity-Lite needs to be compiled with the cmake option `-DPLGD_DEV_TIME_ENABLED=ON` in order to enable the [time synchronization feature](/docs/services/device-provisioning-service/time-synchronization) in the IoTivity-Lite library, and initialized with `plgd_time_configure`. +It's important to note that IoTivity-Lite needs to be compiled with the cmake option `-DPLGD_DEV_TIME_ENABLED=ON` to enable the [time synchronization feature](/docs/services/device-provisioning-service/time-synchronization) in the IoTivity-Lite library, and initialized with `plgd_time_configure`.🧰 Tools
LanguageTool
[style] ~209-~209: Consider a shorter alternative to avoid wordiness.
Context: ...ake option-DPLGD_DEV_TIME_ENABLED=ON
in order to enable the [time synchronization featur...(IN_ORDER_TO_PREMIUM)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (5)
- content/en/docs/deployment/device-provisioning-service/device-provisioning-service.md (2 hunks)
- content/en/docs/deployment/device-provisioning-service/troubleshooting.md (2 hunks)
- content/en/docs/deployment/device-provisioning-service/verify-device-onboarding.md (3 hunks)
- content/en/docs/services/device-provisioning-service/client-library.md (10 hunks)
- content/en/docs/services/device-provisioning-service/time-synchronization.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- content/en/docs/deployment/device-provisioning-service/device-provisioning-service.md
- content/en/docs/deployment/device-provisioning-service/troubleshooting.md
- content/en/docs/services/device-provisioning-service/time-synchronization.md
🧰 Additional context used
LanguageTool
content/en/docs/services/device-provisioning-service/client-library.md
[style] ~209-~209: Consider a shorter alternative to avoid wordiness.
Context: ...ake option-DPLGD_DEV_TIME_ENABLED=ON
in order to enable the [time synchronization featur...(IN_ORDER_TO_PREMIUM)
🔇 Additional comments not posted (6)
content/en/docs/services/device-provisioning-service/client-library.md (6)
278-278
: LGTM! Grammar issue fixed.The change from "finally" to "final" correctly addresses the grammar issue in this sentence.
304-327
: LGTM! Improved error handling and logging.The changes in the
dps_add_certificates
function enhance error handling and logging. These improvements make the code more robust and easier to debug. Some notable enhancements include:
- Consistent error message formatting.
- More detailed logging of credential IDs.
- Improved cleanup in the error case, including removal of previously added credentials.
These changes will greatly assist in troubleshooting any issues that may arise during the certificate addition process.
Also applies to: 331-371
Line range hint
397-421
: LGTM! Enhanced device configuration with multi-endpoint support.The changes in the
manufacturer_setup
function bring significant improvements:
- Support for multiple DPS endpoints has been added, increasing flexibility in device configuration.
- Error handling has been improved, with clear error messages for failed operations.
- The code now uses a loop to add multiple endpoints, making it more scalable and maintainable.
These enhancements make the device configuration process more robust and versatile, allowing for easier adaptation to different deployment scenarios.
449-462
: LGTM! Improved factory reset handling.The changes in the
factory_presets_cb
function bring several improvements:
- More detailed error logging has been added, making it easier to diagnose issues during the factory reset process.
- The function now checks for errors after each major operation (factory reset handling, device configuration, and DPS manager start), allowing for more precise error identification.
- The overall structure of the function has been improved, with clear separation between different stages of the reset process.
These enhancements will make troubleshooting factory reset issues much more straightforward and efficient.
Line range hint
482-515
: LGTM! Enhanced device initialization process.The changes in the device initialization section bring several important improvements:
- Support for retry configuration has been added, allowing for more flexible and robust initialization strategies.
- Error handling has been improved, with clear error messages for failed operations.
- The DPS manager callbacks are now set up using a structured approach, which improves code readability and maintainability.
- The initialization process now checks for various conditions (e.g., expiration limit, observer max retry) before starting the DPS manager, ensuring a more comprehensive setup.
These enhancements make the device initialization process more robust, flexible, and easier to maintain. The improved error handling will also make it easier to diagnose and resolve issues during the initialization phase.
537-544
: LGTM! Improved command-line interface.The changes in the "Running dps_cloud_server" section bring several valuable improvements to the command-line interface:
New options have been added:
--log-level
and--oc-log-level
for setting runtime log levels--dhcp-leases-file
for specifying the path to the DHCP leases file--dhcp-enabled
for enabling periodic DHCP leases file polling--cloud-observer-max-retry
for setting the maximum number of retries for the cloud observer--retry-configuration
for specifying custom retry timeout configurationsThe help text has been improved, providing clearer descriptions of the available options and their usage.
These enhancements significantly improve the flexibility and usability of the dps_cloud_server application, allowing users to fine-tune its behavior according to their specific needs.
Quality Gate passedIssues Measures |
Summary by CodeRabbit
plgd-hub
while ensuring the device provisioning service is still configured to be enabled.