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

DPS: update client library documentation #152

Merged
merged 5 commits into from
Apr 23, 2024

Conversation

Danielius1922
Copy link
Member

@Danielius1922 Danielius1922 commented Apr 17, 2024

Summary by CodeRabbit

  • New Features
    • Introduced new functions for handling multiple DPS server endpoints.
    • Added verification for DPS endpoint certificate's Common Name to match the selected endpoint.
    • Enhanced cloud status observer mechanisms and introduced custom retry actions for improved reliability.
  • Documentation
    • Expanded documentation on provisioning status values and DPS configuration.
  • Deprecations
    • Deprecated the function for setting a single DPS server endpoint.

Copy link
Contributor

coderabbitai bot commented Apr 17, 2024

Walkthrough

The recent updates to the Device Provisioning Service (DPS) involve deprecating old functions, introducing new endpoint management functions, enhancing retry mechanisms, and verifying endpoint certificates. These changes aim to improve flexibility, reliability, and security in device provisioning processes.

Changes

File Path Change Summary
.../client-library.md - Deprecated plgd_dps_set_endpoint function.
- Added functions for multiple endpoints.
- Expanded status flags and provisioning status values.
.../features.md - New feature to verify DPS endpoint certificate's Common Name.
.../retry-mechanism.md - Updated retry configurations and actions.
- Modified cloud manager connection process.
- Enhanced cloud status observer mechanism.

🐰🌟✨
In the land of code and wire,
Changes come as needs aspire.
Old functions fade, new ones bloom,
In DPS's evolving room.
Hop along on paths anew,
With endpoints safe, and retries too!
🌟✨🐰


Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 89dae91 and e11e68f.
Files ignored due to path filters (1)
  • content/en/docs/services/device-provisioning-service/static/retry-mechanism.drawio.svg is excluded by !**/*.svg
Files selected for processing (4)
  • content/en/docs/services/device-provisioning-service/client-library.md (7 hunks)
  • content/en/docs/services/device-provisioning-service/device-provisioning-service.md (2 hunks)
  • content/en/docs/services/device-provisioning-service/features.md (1 hunks)
  • content/en/docs/services/device-provisioning-service/retry-mechanism.md (3 hunks)
Additional Context Used
LanguageTool (226)
content/en/docs/services/device-provisioning-service/client-library.md (121)

Near line 16: Possible spelling mistake found.
Context: ...rovisioning Service is distributed as a tar.gz package, which contains the dps shared...


Near line 16: Possible spelling mistake found.
Context: ... a tar.gz package, which contains the dps shared library, public C headers and an...


Near line 26: This sentence does not start with an uppercase letter.
Context: ...rovided in the distributed package. - [dps.h](/docs/services/device-provisioning-s...


Near line 27: Possible spelling mistake found.
Context: ...ng-service/static/dps-release/dps.h) - [dps_export.h](/docs/services/device-provisi...


Near line 28: Possible spelling mistake found.
Context: ...ice/static/dps-release/dps_export.h) - [dps_log.h](/docs/services/device-provisioni...


Near line 32: Possible spelling mistake found.
Context: ...PS client device is an extension of an [IoTivity](https://github.com/iotivity/iotivity-l...


Near line 34: Possible spelling mistake found.
Context: ...p the DPS initialization by calling the plgd_dps_init function, which allocates and...


Near line 35: Possible spelling mistake found.
Context: ...s required data structures. Use setters plgd_dps_set_manager_callbacks, `plgd_dps_s...


Near line 35: Possible spelling mistake found.
Context: ...tters plgd_dps_set_manager_callbacks, plgd_dps_set_skip_verify, `plgd_dps_set_con...


Near line 35: Possible spelling mistake found.
Context: ...callbacks, plgd_dps_set_skip_verify, plgd_dps_set_configuration_resource, plgd_...


Near line 35: Possible spelling mistake found.
Context: ... plgd_dps_set_configuration_resource, plgd_dps_time_configure, `plgd_dps_set_retr...


Near line 35: Possible spelling mistake found.
Context: ...n_resource, plgd_dps_time_configure, plgd_dps_set_retry_configuration, plgd_dps...


Near line 35: Possible spelling mistake found.
Context: ...e, plgd_dps_set_retry_configuration, plgd_dps_set_cloud_observer_configuration` a...


Near line 35: Possible spelling mistake found.
Context: ...s_set_cloud_observer_configurationandplgd_dps_pki_set_expiring_limit` to configur...


Near line 39: The abbreviation “i.e.” (= that is) requires two periods.
Context: ... stored in a list ordered by priority. (ie. the first endpoint has the highest prio...


Near line 41: Did you mean “to”?
Context: ...to the list of DPS server endpoints use plgd_dps_add_endpoint_address(plgd_dps_context_t *ctx, const char *uri, size_t uri_len, const char *name, size_t name_len) function. - To remove an end...


Near line 43: Make sure that ‘use To’ is correct. For habitual actions in the past or to mean ‘accustomed to’, use “used to”.
Context: ...t *address)- To iterate over the list useplgd_dps_iterate_server_addresses(const plgd_dps_context_t *ctx, oc_endpoint_addresses_iterate_fn_t iterate_fn, void *iterate_fn_data)` - To select an endpoint from the list to be ...


Near line 44: The word ‘address_t’ is not standard English. Did you mean “address’t” (curly apostrophe) or “address't” (straight apostrophe)?
Context: ... to be used during DPS provisioning use plgd_dps_select_endpoint_address(plgd_dps_context_t *ctx, const oc_endpoint_address_t *address) (by default the first endpoi...


Near line 46: A determiner appears to be missing. Consider inserting it.
Context: ...ddress(const plgd_dps_context_t *ctx) Functionplgd_dps_set_endpoint` used to previou...


Near line 47: Possible spelling mistake found.
Context: ...nst plgd_dps_context_t *ctx) Functionplgd_dps_set_endpoint` used to previously co...


Near line 55: Possible spelling mistake found.
Context: ...he cloud registration status by calling plgd_dps_set_manager_callbacks function. Th...


Near line 55: Possible spelling mistake found.
Context: ...istration is part of the public API of [IoTivity](https://github.com/iotivity/iotivity-l...


Near line 63: Possible spelling mistake found.
Context: ..._status_t status, void *data); ``` The ctx argument is device context created by ...


Near line 63: Possible spelling mistake found.
Context: ...argument is device context created byplgd_dps_init, the data` argument is a val...


Near line 63: Possible spelling mistake found.
Context: ...ment is a value provided to the call of plgd_dps_set_manager_callbacks. The `status...


Near line 63: Possible spelling mistake found.
Context: ...s of the following flags defined in the dps.h header: ```C /** * @brief DPS prov...


Near line 151: Possible spelling mistake found.
Context: ...S configuration resource To expose the /plgd/dps resource call `plgd_dps_set_config...


Near line 151: The word ‘context_t’ is not standard English. Did you mean “context’t” (curly apostrophe) or “context't” (straight apostrophe)?
Context: ...To expose the /plgd/dps resource call plgd_dps_set_configuration_resource(plgd_dps_context_t *ctx, bool create), with the create ...


Near line 151: Possible spelling mistake found.
Context: ...egister_resourcescallback provided tooc_main_init`. The resource type of the D...


Near line 153: Possible spelling mistake found.
Context: ...pe of the DPS configuration resource is x.plgd.dps.conf and the resource has the foll...


Near line 157: Possible spelling mistake found.
Context: ...---- | | Endpoint | endpoint | string | RW | No | Selected device provisioning ser...


Near line 157: Possible spelling mistake found.
Context: ... provisioning server endpoint in format coaps+tcp://{domain}:{port} | | Endpoint nam...


Near line 158: Possible spelling mistake found.
Context: ...://{domain}:{port}` | | Endpoint name | endpointName | string | RW | No | Name associated wi...


Near line 158: Possible spelling mistake found.
Context: ...Endpoint name | endpointName | string | RW | No | Name associated with the selecte...


Near line 159: Possible spelling mistake found.
Context: ...points | endpoints | array of objects | RW | No | Array of device provisioning ser...


Near line 159: Possible spelling mistake found.
Context: ...rver endpoints. Each item is a pair of (uri, name) values, where uri is the en...


Near line 159: Possible spelling mistake found.
Context: ...a pair of (uri, name) values, where uri is the endpoint address in the format ...


Near line 159: Possible spelling mistake found.
Context: ...is the endpoint address in the formatcoaps+tcp://{domain}:{port}andname` is a ...


Near line 160: Possible spelling mistake found.
Context: ... 2 endpoints set) | | Last error code | lastErrorCode | string | R | No | Provides last error...


Near line 161: Possible spelling mistake found.
Context: ...t below for possible values). | | Force reprovision | forceReprovision | bool | RW | No | C...


Near line 161: Possible spelling mistake found.
Context: ...ssible values). | | Force reprovision | forceReprovision | bool | RW | No | Connect to dps servi...


Near line 161: Possible spelling mistake found.
Context: ... Force reprovision | forceReprovision | bool | RW | No | Connect to dps service and ...


Near line 161: Possible spelling mistake found.
Context: ...reprovision | forceReprovision | bool | RW | No | Connect to dps service and repro...


Near line 161: Possible spelling mistake found.
Context: ...provision | bool | RW | No | Connect to dps service and reprovision time, owner, cl...


Near line 161: Possible spelling mistake found.
Context: ... | RW | No | Connect to dps service and reprovision time, owner, cloud configuration, crede...


Near line 161: Possible spelling mistake found.
Context: ...r, cloud configuration, credentials and acls. | | Provisioning status | provisionSta...


Near line 162: Possible spelling mistake found.
Context: ...als and acls. | | Provisioning status | provisionStatus | enum(string) | R | No | String repres...


Near line 162: Possible spelling mistake found.
Context: ...Provisioning status | provisionStatus | enum(string) | R | No | String representatio...


Near line 162: It appears that a white space is missing.
Context: ...isioning status | provisionStatus | enum(string) | R | No | String representation...


Near line 166: Possible spelling mistake found.
Context: ...es). | Last error code values: - 0 (PLGD_DPS_OK): OK - 1 (`PLGD_DPS_ERROR_RES...


Near line 167: Possible spelling mistake found.
Context: ...lues: - 0 (PLGD_DPS_OK): OK - 1 (PLGD_DPS_ERROR_RESPONSE): error response - ...


Near line 168: Possible spelling mistake found.
Context: ...ERROR_RESPONSE): error response - 2 (PLGD_DPS_ERROR_CONNECT`): cannot connect to ...


Near line 168: Possible spelling mistake found.
Context: ..._DPS_ERROR_CONNECT): cannot connect to dps - 3 (PLGD_DPS_ERROR_GET_CREDENTIALS`...


Near line 169: Possible spelling mistake found.
Context: ...CONNECT): cannot connect to dps - 3 (PLGD_DPS_ERROR_GET_CREDENTIALS`): cannot app...


Near line 170: Possible spelling mistake found.
Context: ... apply credentials configuration - 4 (PLGD_DPS_ERROR_GET_ACLS): cannot apply acls...


Near line 170: Possible spelling mistake found.
Context: ...PLGD_DPS_ERROR_GET_ACLS): cannot apply acls - 5 (PLGD_DPS_ERROR_SET_CLOUD`): can...


Near line 171: Possible spelling mistake found.
Context: ...OR_GET_ACLS): cannot apply acls - 5 (PLGD_DPS_ERROR_SET_CLOUD`): cannot apply clo...


Near line 172: Possible spelling mistake found.
Context: ...cannot apply cloud configuration - 6 (PLGD_DPS_ERROR_START_CLOUD): cannot start c...


Near line 173: Possible spelling mistake found.
Context: ...TART_CLOUD): cannot start cloud - 7 (PLGD_DPS_ERROR_GET_OWNER`): cannot retrieve ...


Near line 174: Possible spelling mistake found.
Context: ...): cannot retrieve device owner - 8 (PLGD_DPS_ERROR_GET_TIME`): cannot retrieve c...


Near line 178: Loose punctuation mark.
Context: ...ioning status values: - uninitialized: endpoint is not set or dps manger has n...


Near line 178: Possible spelling mistake found.
Context: ...uninitialized: endpoint is not set or dps manger has not been started yet - `init...


Near line 184: Possible spelling mistake found.
Context: ... - provisioning acls: provisioning of acls has been started - provisioned acls: ...


Near line 185: Possible spelling mistake found.
Context: ... has been started - provisioned acls: acls are provisioned - provisioning cloud:...


Near line 197: Possible spelling mistake found.
Context: ...ing TLS, add the certificate using the [IoTivity PKI API](https://github.com/iotivity/io...


Near line 199: Possible spelling mistake found.
Context: ...r/include/oc_pki.h) to the device. The oc_pki_add_mfg_cert function adds manufac...


Near line 199: You might be missing the article “the” here.
Context: ...cturer's certificate and private key to device. This certificate is used to sign the c...


Near line 199: Possible spelling mistake found.
Context: ... the communication with the DPS server, authenticatating and identifying the device. On success,...


Near line 199: This abbreviation for “identification” is spelled all-uppercase.
Context: ...On success, use the returned credential id to assign a security profile by calling...


Near line 199: Possible spelling mistake found.
Context: ...to assign a security profile by calling oc_pki_set_security_profile. The `oc_pki...


Near line 201: Possible spelling mistake found.
Context: ...ing oc_pki_set_security_profile. The oc_pki_add_mfg_trust_anchor function adds...


Near line 201: You might be missing the article “the” here.
Context: ...pki_add_mfg_trust_anchor` function adds manufacturer's trusted root certificate of the DPS s...


Near line 204: Possible spelling mistake found.
Context: ...n of the DPS can be disabled by calling plgd_dps_set_skip_verify(false). {{< /note ...


Near line 209: Possible spelling mistake found.
Context: ...he whole process is fired up by calling plgd_dps_manager_start. After the provisio...


Near line 211: Possible spelling mistake found.
Context: ...t is closed and the registration to the plgd hub is started using the data, that was...


Near line 215: The word “thus” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...le, the answer from DPS endpoint didn’t come, thus the handler didn’t trigger and schedule...


Near line 217: Consider adding a comma.
Context: ...e. when the last retry interval was 120s then the next will be 10s again) until the p...


Near line 221: Possible spelling mistake found.
Context: ...able time synchronization, the function plgd_dps_time_configure(true) should be cal...


Near line 221: Possible spelling mistake found.
Context: ... be called. It's important to note that IoTivity-Lite needs to be compiled with the cmake opt...


Near line 221: Possible spelling mistake found.
Context: ...vity-Lite needs to be compiled with the cmake option -DPLGD_DEV_TIME_ENABLED=ON in ...


Near line 221: Possible spelling mistake found.
Context: ...ds to be compiled with the cmake option -DPLGD_DEV_TIME_ENABLED=ON in order to enable...


Near line 221: Consider a shorter alternative to avoid wordiness.
Context: ...ake option -DPLGD_DEV_TIME_ENABLED=ON in order to enable the [time synchronization featur...


Near line 221: Possible spelling mistake found.
Context: ...ng-service/time-synchronization) in the IoTivity-Lite library, and initialized with `plgd_tim...


Near line 221: Possible spelling mistake found.
Context: ...vity-Lite library, and initialized with plgd_time_init. {{< note >}} To compensate...


Near line 237: Possible spelling mistake found.
Context: ...xpiration interval is determined by the expiringLimit value, by default this is 1 hour) - va...


Near line 242: Consider removing “of” to be more concise
Context: ...repeated. A valid certificate fulfills all of the following conditions: - certificate wa...


Near line 244: You might be missing the article “the” here.
Context: ...lls all of the following conditions: - certificate was correctly parsed and stored by the ...


Near line 244: Possible spelling mistake found.
Context: ... was correctly parsed and stored by the IoTivity-lite library - its valid-from and valid-to t...


Near line 246: The abbreviation “i.e.” (= that is) requires two periods.
Context: ...alid - the certificate is not expiring (ie. the interval until the certificate expi...


Near line 246: Possible spelling mistake found.
Context: ... certificate expires is longer than the expiringLimit value) Once the certificates are stor...


Near line 252: Possible spelling mistake found.
Context: ...nterval To set expiration interval use plgd_dps_pki_set_expiring_limit. To get the...


Near line 252: Possible spelling mistake found.
Context: ...et the current expiration interval call plgd_dps_pki_get_expiring_limit. The interv...


Near line 279: Possible spelling mistake found.
Context: ... active can be detected by checking for PLGD_DPS_RENEW_CREDENTIALS provisioning sta...


Near line 283: This sentence does not start with an uppercase letter.
Context: ...es are handled in the following way: - sending of the CSR fails - scheduling of the re...


Near line 284: This sentence does not start with an uppercase letter.
Context: ... mechanism used during provisioning). - the response is not received - after succes...


Near line 285: Possible spelling mistake found.
Context: ...ement of the current fails, then a full reprovisioning is triggered - if any other failures oc...


Near line 286: Possible spelling mistake found.
Context: ...lures occur during renewal, then a full reprovisioning is triggered ## Example application - ...


Near line 288: Possible spelling mistake found.
Context: ... is triggered ## Example application - dps_cloud_server Part of the package is an...


Near line 290: Possible spelling mistake found.
Context: ...ackage is an example application called dps_cloud_server. The following sections d...


Near line 290: You might be missing the article “the” here.
Context: ...r`. The following sections describe how DPS client library is integrated in the bin...


Near line 290: 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...


Near line 294: Possible spelling mistake found.
Context: ...he certificates to be in a folder named pki_certs located next to the binary file....


Near line 300: Possible spelling mistake found.
Context: ...nufacturer certificate private key The dps_cloud_server supports --no-verify-ca...


Near line 300: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...oint will be used without authentication and you don't need the dpsca.pem file. I...


Near line 300: Possible spelling mistake found.
Context: ...t authentication and you don't need the dpsca.pem file. In code, the application us...


Near line 302: Possible spelling mistake found.
Context: ...` file. In code, the application uses [IoTivity's PKI functions to load the certificate...


Near line 391: You might be missing the article “the” here.
Context: ... -1; } ``` ### Configuring device Use public API of Iotivity-lite and DPS to setup d...


Near line 391: Possible spelling mistake found.
Context: ...# Configuring device Use public API of Iotivity-lite and DPS to setup device to desired init...


Near line 391: The verb ‘set up’ is spelled as two words. The noun ‘setup’ is spelled as one.
Context: ... public API of Iotivity-lite and DPS to setup device to desired initial configuration...


Near line 440: Possible missing comma found.
Context: ... also invoked on the first start of the device and thus can be used to call the config...


Near line 443: Possible missing comma found.
Context: ...n. {{< note >}} If your device has run before then it should've created storage files...


Near line 443: Possible missing comma found.
Context: ...a folder next to the binary. During the initialization the data will be loaded from these stor...


Near line 446: A comma might be missing here.
Context: ... /note >}} To properly handle a device reset the handler must reload the manufacture...


Near line 446: Possible spelling mistake found.
Context: ...ce. At the end of the handler, call the plgd_dps_on_factory_reset function, which d...


Near line 446: Possible spelling mistake found.
Context: ...art the provisioning process by calling plgd_dps_manager_start. ```C static void f...


Near line 520: Possible spelling mistake found.
Context: ...run loop finish: ... ``` ### Running dps_cloud_server Use --help switch to ge...


Near line 522: You might be missing the article “the” here.
Context: ... ``` ### Running dps_cloud_server Use --help switch to get information about ...


Near line 544: Possible spelling mistake found.
Context: ...he device after it is registered to the plgd cloud. The endpoint argument is the e...


Near line 546: Possible spelling mistake found.
Context: ... DPS endpoint is running on the address api.try.plgd.cloud:25684 then start your d...


Near line 552: Possible spelling mistake found.
Context: ...y.plgd.cloud:25684" ``` ### Restarting dps_cloud_server To force provisioning res...


Near line 554: Possible spelling mistake found.
Context: ...nd call your handler setup by a call to oc_set_factory_presets_cb.

content/en/docs/services/device-provisioning-service/device-provisioning-service.md (79)

Near line 11: Possible spelling mistake found.
Context: ...iring any human interaction is what our plgd Device Provisioning Service (DPS) solve...


Near line 11: Possible missing preposition found.
Context: ...vice Provisioning Service (DPS) solves. Doesn't matter if you're running the plgd hub...


Near line 11: Possible spelling mistake found.
Context: ...s. Doesn't matter if you're running the plgd hub on-premise, off-premise or a fully ...


Near line 11: Possible spelling mistake found.
Context: ...devices and provision them to the right plgd hub instance. Exactly no human interact...


Near line 14: This sentence does not start with an uppercase letter.
Context: ...hen to use Device Provisioning Service plgd ecosystem supports various provisioning...


Near line 17: Possible spelling mistake found.
Context: ...e number of devices without hard-coding plgd hub connection - Distribute devices acr...


Near line 18: Possible spelling mistake found.
Context: ...n - Distribute devices across different plgd hub instances based on custom identifie...


Near line 19: When ‘customer-specific’ is used as a modifier, it is usually spelled with a hyphen.
Context: ... serial number) - Distribute devices to customer specific environments while securing the communi...


Near line 22: Possible spelling mistake found.
Context: ... a security requirements or use-cases - Reprovision the device when it is not able to conne...


Near line 22: As a shorter alternative for ‘able to’, consider using “can not”.
Context: ...-cases - Reprovision the device when it is not able to connect to the plgd hub - Blacklist dev...


Near line 22: Possible spelling mistake found.
Context: ...e when it is not able to connect to the plgd hub - Blacklist devices which were comp...


Near line 33: Did you mean to use the possessive pronoun “its”?
Context: ...* in which the device is enrolled after it's manufacturer identity was verified ###...


Near line 38: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...his point, hardware assembly is complete and the initial software has been loaded. A...


Near line 38: Did you mean “its” (possessive pronoun) instead of ‘it’s’ (short for ‘it is’)?
Context: ...the TPM's endorsement key, required for it's individual enrollment. {{< note >}} Pro...


Near line 46: Unpaired symbol: ‘[’ seems to be missing
Context: ...etup step Creating an Enrollment Group in your plgd DPS instance is required...


Near line 46: Possible spelling mistake found.
Context: ...Creating an Enrollment Group]() in your plgd DPS instance is required in order to ma...


Near line 46: Consider a shorter alternative to avoid wordiness.
Context: ...) in your plgd DPS instance is required in order to make sure the DPS can properly attest t...


Near line 46: Possible spelling mistake found.
Context: ...device-to-device scenarios]() where the plgd hub is not involved at all. Once the en...


Near line 52: Possible spelling mistake found.
Context: ...guration, which is a prerequisite. {{< plantuml id="dps-overview" >}} @startuml skinpar...


Near line 52: Possible spelling mistake found.
Context: ...ch is a prerequisite. {{< plantuml id="dps-overview" >}} @startuml skinparam backgroundColo...


Near line 53: Possible spelling mistake found.
Context: ...lantuml id="dps-overview" >}} @startuml skinparam backgroundColor grey hide footbox acto...


Near line 54: Possible spelling mistake found.
Context: ...="dps-overview" >}} @startuml skinparam backgroundColor grey hide footbox actor "Solution Oper...


Near line 54: Possible spelling mistake. ‘grey’ is British English.
Context: ...>}} @startuml skinparam backgroundColor grey hide footbox actor "Solution Operator"...


Near line 55: Possible spelling mistake found.
Context: ...uml skinparam backgroundColor grey hide footbox actor "Solution Operator" as op collec...


Near line 58: Make sure that the single character ‘d’ is correct and is not a typing error.
Context: ...perator" as op collections "Devices" as d participant "Device Provisioning\nServi...


Near line 59: Possible spelling mistake found.
Context: ..." as d participant "Device Provisioning\nService" as dps participant "plgd hub" as hub ...


Near line 59: Possible spelling mistake found.
Context: ...ipant "Device Provisioning\nService" as dps participant "plgd hub" as hub note ove...


Near line 60: Possible spelling mistake found.
Context: ...visioning\nService" as dps participant "plgd hub" as hub note over op, hub Enrollme...


Near line 65: Do you wish to insert an arrow?
Context: ... key identifiers was created end note d -> d: 1 Initiate device ownership tran...


Near line 66: Possible typo: you repeated a word
Context: ...iate device ownership transfer activate d d -> dps: 2 Connect and authenticate ...


Near line 67: Do you wish to insert an arrow?
Context: ... device ownership transfer activate d d -> dps: 2 Connect and authenticate dps...


Near line 67: Possible spelling mistake found.
Context: ...vice ownership transfer activate d d -> dps: 2 Connect and authenticate dps -> ...


Near line 67: Possible spelling mistake found.
Context: ... -> dps: 2 Connect and authenticate dps -> dps: 3 Find matching Enrollment ...


Near line 68: Do you wish to insert an arrow?
Context: ...dps: 2 Connect and authenticate dps -> dps: 3 Find matching Enrollment Gro...


Near line 68: Possible spelling mistake found.
Context: ...: 2 Connect and authenticate dps -> dps: 3 Find matching Enrollment Group a...


Near line 69: Possible spelling mistake found.
Context: ...Find matching Enrollment Group activate dps d -> dps: 4 Get DPS service time to...


Near line 70: Do you wish to insert an arrow?
Context: ...atching Enrollment Group activate dps d -> dps: 4 Get DPS service time to sync...


Near line 70: Possible spelling mistake found.
Context: ...hing Enrollment Group activate dps d -> dps: 4 Get DPS service time to sync clo...


Near line 70: Possible spelling mistake found.
Context: ...4** Get DPS service time to sync clocks dps --> d d -> dps: 5 Get owner of the ...


Near line 71: Do you wish to insert an arrow?
Context: ...Get DPS service time to sync clocks dps --> d d -> dps: 5 Get owner of the devi...


Near line 71: Possible typo: you repeated a word
Context: ...DPS service time to sync clocks dps --> d d -> dps: 5 Get owner of the device d...


Near line 72: Do you wish to insert an arrow?
Context: ...service time to sync clocks dps --> d d -> dps: 5 Get owner of the device dps ...


Near line 72: Possible spelling mistake found.
Context: ...vice time to sync clocks dps --> d d -> dps: 5 Get owner of the device dps --> ...


Near line 72: Possible spelling mistake found.
Context: ...d -> dps: 5 Get owner of the device dps --> d d -> dps: 6 Get plgd hub conn...


Near line 73: Do you wish to insert an arrow?
Context: ... dps: 5 Get owner of the device dps --> d d -> dps: 6 Get plgd hub connecti...


Near line 73: Possible typo: you repeated a word
Context: ...: 5 Get owner of the device dps --> d d -> dps: 6 Get plgd hub connection c...


Near line 74: Do you wish to insert an arrow?
Context: ...5** Get owner of the device dps --> d d -> dps: 6 Get plgd hub connection conf...


Near line 74: Possible spelling mistake found.
Context: ... Get owner of the device dps --> d d -> dps: 6 Get plgd hub connection configur...


Near line 74: Possible spelling mistake found.
Context: ...he device dps --> d d -> dps: 6 Get plgd hub connection configuration dps --> d ...


Near line 74: Possible spelling mistake found.
Context: ...* Get plgd hub connection configuration dps --> d d -> dps: 7 Send Identity Cer...


Near line 75: Do you wish to insert an arrow?
Context: ...t plgd hub connection configuration dps --> d d -> dps: 7 Send Identity Certifi...


Near line 75: Possible typo: you repeated a word
Context: ...gd hub connection configuration dps --> d d -> dps: 7 Send Identity Certificate...


Near line 76: Do you wish to insert an arrow?
Context: ...ub connection configuration dps --> d d -> dps: 7 Send Identity Certificate Si...


Near line 76: Possible spelling mistake found.
Context: ...connection configuration dps --> d d -> dps: 7 Send Identity Certificate Signin...


Near line 76: Possible spelling mistake found.
Context: ...nd Identity Certificate Signing Request dps --> d d -> dps: 8 Retrieve ACL conf...


Near line 77: Do you wish to insert an arrow?
Context: ...dentity Certificate Signing Request dps --> d d -> dps: 8 Retrieve ACL configur...


Near line 77: Possible typo: you repeated a word
Context: ...ity Certificate Signing Request dps --> d d -> dps: 8 Retrieve ACL configuratio...


Near line 78: Do you wish to insert an arrow?
Context: ...Certificate Signing Request dps --> d d -> dps: 8 Retrieve ACL configuration d...


Near line 78: Possible spelling mistake found.
Context: ...tificate Signing Request dps --> d d -> dps: 8 Retrieve ACL configuration dps -...


Near line 78: Possible spelling mistake found.
Context: ...> dps: 8 Retrieve ACL configuration dps --> d d ->x dps: Disconnect deactivate ...


Near line 79: Do you wish to insert an arrow?
Context: ...s: 8 Retrieve ACL configuration dps --> d d ->x dps: Disconnect deactivate dps ...


Near line 79: Possible typo: you repeated a word
Context: ...8* Retrieve ACL configuration dps --> d d ->x dps: Disconnect deactivate dps deac...


Near line 80: Do you wish to insert an arrow?
Context: ... Retrieve ACL configuration dps --> d d ->x dps: Disconnect deactivate dps deactiv...


Near line 80: Possible spelling mistake found.
Context: ...rieve ACL configuration dps --> d d ->x dps: Disconnect deactivate dps deactivate d...


Near line 81: Possible spelling mistake found.
Context: ... --> d d ->x dps: Disconnect deactivate dps deactivate d d -> hub: 9 Connect an...


Near line 82: Possible typo: you repeated a word
Context: ...s: Disconnect deactivate dps deactivate d d -> hub: 9 Connect and authenticate ...


Near line 83: Do you wish to insert an arrow?
Context: ...isconnect deactivate dps deactivate d d -> hub: 9 Connect and authenticate act...


Near line 88: Possible spelling mistake found.
Context: ... authenticate activate d @enduml {{< /plantuml >}} 1. The device application or exter...


Near line 90: Possible spelling mistake found.
Context: ... tool which discovered the device using CoAP multicast requests the DPS Client to st...


Near line 90: To make your writing flow more naturally, try moving ‘also’ before the verb.
Context: ...ting the DPS endpoint. The DPS endpoint can be also configured at the factory. 2. The devic...


Near line 91: Did you mean “its” (possessive pronoun) instead of ‘it’s’ (short for ‘it is’)?
Context: ...ns the connection to the DPS and proves it's identity using a Manufacturer Certifica...


Near line 93: Consider a shorter alternative to avoid wordiness.
Context: ...ificate CA or TPM's endorsement key. 4. In order to validate TLS certificates and rotate th...


Near line 95: Possible spelling mistake found.
Context: ...izes the device to communicate with the plgd hub APIs. 7. The device issues Certific...


Near line 96: Possible spelling mistake found.
Context: ..., running next to the DPS or within the plgd hub deployment. Custom Identity CA can ...


Near line 96: Possible spelling mistake found.
Context: ...tification and secure connection to the plgd hub. 8. The device requests resources' ...


Near line 98: Possible spelling mistake found.
Context: .... The device connects to the configured plgd hub instance, authenticates and encrypt...


Near line 104: Did you mean “connecting”? Or maybe you should add a pronoun? In active voice, ‘require’ + ‘to’ takes an object, usually a pronoun.
Context: ... 9. Device provisioning doesn't require to connect the device to the plgd hub. In such a c...


Near line 104: Possible spelling mistake found.
Context: ...'t require to connect the device to the plgd hub. In such a case, device is ready to...


Near line 104: Possible missing article found.
Context: ...device to the plgd hub. In such a case, device is ready to be securely used for your D...

content/en/docs/services/device-provisioning-service/features.md (4)

Near line 13: Possible spelling mistake found.
Context: ...es). - ☑ Onboarding devices to plgd hub: This feature enables the process...


Near line 13: Possible spelling mistake found.
Context: ... devices for management and control by [plgd hub](/docs/architecture/component-overv...


Near line 24: Consider a shorter alternative to avoid wordiness.
Context: ...s require manual approval from the user in order to receive configuration settings. Instead...


Near line 25: Possible spelling mistake found.
Context: ...es the name of the selected endpoint by dps client.

content/en/docs/services/device-provisioning-service/retry-mechanism.md (22)

Near line 11: Possible spelling mistake found.
Context: ...ng the failed step or triggering a full reprovisioning. The mechanism is illustrated by the f...


Near line 17: You might be missing the article “the” here.
Context: ...nd the retry configuration. Internally, DPS client library uses a counter to keep t...


Near line 21: Possible missing comma found.
Context: ...uration array must contain at least one value and the maximal size of is 8. By defaul...


Near line 27: Possible spelling mistake found.
Context: ...The configuration can be changed by the plgd_dps_set_retry_configuration function. ...


Near line 27: A comma might be missing here.
Context: ...tionfunction. To retrieve the current configuration use theplgs_dps_get_retry_configurati...


Near line 27: Possible spelling mistake found.
Context: ...rieve the current configuration use the plgs_dps_get_retry_configuration function. ...


Near line 35: Possible spelling mistake found.
Context: ...vice owner * requesting and applying of plgd hub connection configuration * sending ...


Near line 39: You might be missing the article “a” here.
Context: ...equest to the DPS service and waits for response. After a request is sent, then the retr...


Near line 39: Is an article like ‘a’ or ‘an’ missing?
Context: ... the operation timeouts and the request is resend. If the response is received in ...


Near line 41: Possible spelling mistake found.
Context: ...curs consecutively 3 times, then a full reprovisioning is forced. The retry counter starts wi...


Near line 47: Possible spelling mistake found.
Context: ...ong after a failure is the step or full reprovisioning retried) and timeout based on the confi...


Near line 60: Possible missing article found.
Context: ...oreover, once the retry counter reaches higher value than the maximal index of the con...


Near line 60: Did you mean “they are” or “there are”?
Context: ...to change the selected DPS endpoint. If the are more than one DPS endpoint servers conf...


Near line 62: Possible missing comma found.
Context: ...st endpoint). To set up a custom retry action use plgd_dps_set_schedule_action. ##...


Near line 62: Possible spelling mistake found.
Context: ...). To set up a custom retry action use plgd_dps_set_schedule_action. ## Failures ...


Near line 66: Possible spelling mistake found.
Context: ... and initiates the cloud manager within IoTivity-lite. If the cloud manager fails to start, ...


Near line 66: Possible spelling mistake found.
Context: ...ager fails to start, it triggers a full reprovisioning process. Conversely, if the cloud manag...


Near line 70: Possible spelling mistake found.
Context: ... interval (default: 1 second) using the plgd_dps_set_cloud_observer_configuration f...


Near line 73: Possible spelling mistake found.
Context: ... operation is handled internally by the IoTivity-lite library, which schedules a token refre...


Near line 80: Possible spelling mistake found.
Context: ...CLs might also be different. Therefore, reprovisioning of credentials and ACLs is triggered. I...


Near line 82: Possible spelling mistake found.
Context: ...loud manager is stopped, and a full DPS reprovisioning is forced. {{< note >}} To lean how to...


Near line 85: Possible spelling mistake found.
Context: ...p multiple cloud server addresses in an IoTivity-lite device [see Cloud: support for multipl...

Additional comments not posted (9)
content/en/docs/services/device-provisioning-service/features.md (1)

25-25: Ensure the feature description aligns with the implementation in the DPS client.

This new feature is crucial for security. Please confirm that the DPS client's implementation matches this description and that the feature functions as intended.

content/en/docs/services/device-provisioning-service/retry-mechanism.md (1)

21-21: Ensure the retry configuration array validation is robust.

The documentation states that the retry configuration array must contain at least one non-zero value. Please verify that there are checks in place to enforce this requirement in the code.

content/en/docs/services/device-provisioning-service/device-provisioning-service.md (1)

71-86: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [74-98]

Verify the accuracy of the reordered steps in the provisioning process.

The steps in the device provisioning process have been reordered. Please ensure that this new sequence is correctly implemented in the DPS and that it aligns with the operational workflows.

content/en/docs/services/device-provisioning-service/client-library.md (6)

39-39: Consider using "i.e.," instead of "ie." for clarity and grammatical correctness.


47-47: Ensure that the deprecation of plgd_dps_set_endpoint is clearly communicated in the SDK's changelog or migration guide to avoid confusion for existing users.


116-121: Confirm that the new status flags for cloud configuration (PLGD_DPS_GET_CLOUD, PLGD_DPS_HAS_CLOUD) are implemented in the SDK and tested to ensure they work as expected.


188-189: Verify that the new time-related provisioning status values (provisioning time, provisioned time) are correctly implemented in the SDK and covered by unit tests.


157-161: Check that the new properties in the DPS configuration resource (endpoints, forceReprovision) are properly documented in the SDK's API reference and that examples are provided to demonstrate their usage.


410-428: Ensure that the new retry mechanism and cloud observer configuration settings (plgd_dps_set_cloud_observer_configuration) are clearly documented and include examples of how to configure these settings in different scenarios.


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Apr 17, 2024

Deploy Preview for docsplgd ready!

Name Link
🔨 Latest commit e11e68f
🔍 Latest deploy log https://app.netlify.com/sites/docsplgd/deploys/66267c08539b4900098c0291
😎 Deploy Preview https://deploy-preview-152--docsplgd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Danielius1922 Danielius1922 force-pushed the adam/feature/dps-multiple-endpoints branch from d0c9041 to 2ca1c3d Compare April 17, 2024 10:56
@Danielius1922 Danielius1922 force-pushed the adam/feature/dps-multiple-endpoints branch from 2ca1c3d to 24ec46e Compare April 17, 2024 15:12
@Danielius1922 Danielius1922 requested a review from jkralik April 19, 2024 11:11
@Danielius1922 Danielius1922 marked this pull request as ready for review April 19, 2024 11:11
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

@Danielius1922 Danielius1922 force-pushed the adam/feature/dps-multiple-endpoints branch from 8d72034 to 049474e Compare April 19, 2024 11:50
@@ -23,3 +23,4 @@ weight: 2
- **&#x2610; Initial device configuration:** This planned feature aims to provide users with a mechanism to perform the initial configuration of devices during the provisioning process.
- **&#x2610; Blacklisting and whitelisting devices:** With this feature, users will have the ability to blacklist or whitelist specific devices for enhanced access control.
- **&#x2610; Manual approval for device configuration:** This planned feature enables a mechanism where devices require manual approval from the user in order to receive configuration settings. Instead of automatic configuration, users will have control over granting permission for device configuration.
- **&#x2610; Verify Common Name:** Verify that the Common Name of DPS endpoint certificate matches the name of the selected endpoint.
Copy link
Member

Choose a reason for hiding this comment

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

This is needed in dps-client not in dps-service:
Verify Common Name:** Verify that the Common Name of DPS endpoint certificate matches the name of the selected endpoint by dps client.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

@@ -29,6 +29,8 @@ The configuration can be changed by the `plgd_dps_set_retry_configuration` funct

Provisioning consists of 3 main steps:
Copy link
Member

Choose a reason for hiding this comment

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

5 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.

Fixed

@@ -29,6 +29,8 @@ The configuration can be changed by the `plgd_dps_set_retry_configuration` funct

Provisioning consists of 3 main steps:

* synchronization of time
* requesting and set of device owner
* sending of signing certificate request
* requesting and applying of ACLs
* requesting and applying of plgd hub connection configuration
Copy link
Member

Choose a reason for hiding this comment

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

move up before signing certificate.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@Danielius1922 Danielius1922 force-pushed the adam/feature/dps-multiple-endpoints branch from b01f841 to e11e68f Compare April 22, 2024 15:02
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Moreover, once the retry counter reaches higher value than the maximal index of the configuration array, not only is the counter reset back to zero, but the library attempts to change the selected DPS endpoint. If the are more than one DPS endpoint servers configured, then the selected endpoint is changed to the next in the list (the list is considered circular, so the next endpoint after the last endpoint is the first endpoint).

To set up a custom retry action use `plgd_dps_set_schedule_action`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comma for clarity in the instruction.

- To set up a custom retry action use `plgd_dps_set_schedule_action`.
+ To set up a custom retry action, use `plgd_dps_set_schedule_action`.

This correction improves the readability of the instruction.


Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
To set up a custom retry action use `plgd_dps_set_schedule_action`.
To set up a custom retry action, use `plgd_dps_set_schedule_action`.

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@jkralik jkralik merged commit 0dd2363 into main Apr 23, 2024
12 checks passed
@jkralik jkralik deleted the adam/feature/dps-multiple-endpoints branch April 23, 2024 13:09
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