Skip to content

refactor(core): replace lib curl calls with urlHelper#218

Open
Lakshmi97-velampati wants to merge 4 commits into
mainfrom
mvelam850/dev/BARTON-330
Open

refactor(core): replace lib curl calls with urlHelper#218
Lakshmi97-velampati wants to merge 4 commits into
mainfrom
mvelam850/dev/BARTON-330

Conversation

@Lakshmi97-velampati
Copy link
Copy Markdown
Contributor

In CertifierOperationalCredentialsIssuer replaced the lib curl calls with the urlHelper functions to get the benefits of the DEBUGFUNCTION opt.

Refs: BARTON-330

In CertifierOperationalCredentialsIssuer replaced the lib curl calls with the urlHelper functions to get the benefits of the DEBUGFUNCTION opt.

Refs: BARTON-330
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors CertifierOperationalCredentialsIssuer to stop using direct libcurl calls and instead perform the certifier HTTP request through urlHelper, aligning the Matter operational credentials flow with the project’s shared HTTP utility (and enabling the DEBUGFUNCTION benefits noted in the PR description).

Changes:

  • Removed libcurl dependency/typedefs from the issuer header.
  • Reworked the NOC fetch path to build an icLinkedList of HTTP headers and execute the POST via urlHelperExecuteRequestHeaders.
  • Updated response handling to use the returned body buffer and the HTTP status code from urlHelper.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
core/src/subsystems/matter/delegates/default/CertifierOperationalCredentialsIssuer.hpp Removes libcurl include and CurlEasy alias to decouple the interface from libcurl.
core/src/subsystems/matter/delegates/default/CertifierOperationalCredentialsIssuer.cpp Replaces the libcurl-based HTTP POST with urlHelperExecuteRequestHeaders, including header construction and response handling.

@Lakshmi97-velampati Lakshmi97-velampati changed the title refactor(core) : replace lib curl calls with urlHelper refactor(core): replace lib curl calls with urlHelper May 13, 2026
@Lakshmi97-velampati Lakshmi97-velampati marked this pull request as draft May 13, 2026 11:46
@Lakshmi97-velampati Lakshmi97-velampati marked this pull request as ready for review May 14, 2026 04:42
@Lakshmi97-velampati Lakshmi97-velampati marked this pull request as draft May 14, 2026 04:58
@Lakshmi97-velampati Lakshmi97-velampati marked this pull request as ready for review May 18, 2026 07:44
Copilot AI review requested due to automatic review settings May 18, 2026 07:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

tleacmcsa
tleacmcsa previously approved these changes May 19, 2026
Copy link
Copy Markdown
Contributor

@tleacmcsa tleacmcsa left a comment

Choose a reason for hiding this comment

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

Looks good to me. How was it tested? You out C++'d me in some spots :-D

@Lakshmi97-velampati
Copy link
Copy Markdown
Contributor Author

Looks good to me. How was it tested? You out C++'d me in some spots :-D

Just ran integration tests which will cover the commissioning flow.

kfundecmcsa
kfundecmcsa previously approved these changes May 26, 2026
long httpCode;
curl_easy_getinfo(curl.get(), CURLINFO_RESPONSE_CODE, &httpCode);

if (httpCode >= 400)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor thought: we might be able to get a bit more value out of httpCode (e.g. distinguishing 4xx vs 5xx) to better understand whether failures are coming from our request vs the server.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@cleithner-comcast
Copy link
Copy Markdown
Contributor

Looks good to me. How was it tested? You out C++'d me in some spots :-D

Just ran integration tests which will cover the commissioning flow.

It does not in this case. This module is for "production" or "real device" use. For development and the test suite, we use SelfSignedCertifierOperationalCredentialsIssuer to avoid reaching out to a pki server in tests. To test this properly, you need to commission a real matter device (or a locally findable matter sample app would be fine) on an activated installation. Because this default module particularly hits the comcast xpki server, and I believe that server demands an xbo correlated mac and account id, I think your easiest path of testing would be with a real gateway.

…ntialsIssuer

Log client errors (4xx) and server errors (5xx) separately to make it
easier to determine whether NOC request failures originate from a bad
request on our side or a problem on the certifier server.
Copilot AI review requested due to automatic review settings May 27, 2026 02:38
@Lakshmi97-velampati Lakshmi97-velampati dismissed stale reviews from tleacmcsa and kfundecmcsa via 2022c4f May 27, 2026 02:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment on lines 63 to 65
private:
using CurlEasy = std::unique_ptr<CURL, decltype(&curl_easy_cleanup)>;
using Pkcs7 = std::unique_ptr<PKCS7, decltype(&PKCS7_free)>;

@Lakshmi97-velampati
Copy link
Copy Markdown
Contributor Author

Looks good to me. How was it tested? You out C++'d me in some spots :-D

Just ran integration tests which will cover the commissioning flow.

It does not in this case. This module is for "production" or "real device" use. For development and the test suite, we use SelfSignedCertifierOperationalCredentialsIssuer to avoid reaching out to a pki server in tests. To test this properly, you need to commission a real matter device (or a locally findable matter sample app would be fine) on an activated installation. Because this default module particularly hits the comcast xpki server, and I believe that server demands an xbo correlated mac and account id, I think your easiest path of testing would be with a real gateway.

Sure will test and update.

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.

5 participants