Skip to content

Commit

Permalink
https://telecominfraproject.atlassian.net/browse/WIFI-7831
Browse files Browse the repository at this point in the history
Signed-off-by: stephb9959 <[email protected]>
  • Loading branch information
stephb9959 committed Sep 13, 2023
1 parent 3dadc19 commit 4b78e64
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/OpenRoamin_GlobalReach.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <Poco/TemporaryFile.h>
#include <Poco/JSON/Object.h>
#include <Poco/JSON/Parser.h>

#include <framework/RESTAPI_Handler.h>
#include <framework/MicroServiceFuncs.h>
#include <StorageService.h>

Expand Down Expand Up @@ -74,6 +74,7 @@ namespace OpenWifi {
if (Response.getStatus() == Poco::Net::HTTPResponse::HTTP_OK) {
Poco::JSON::Parser P;
auto Result = P.parse(is).extract<Poco::JSON::Object::Ptr>();
RESTAPI::
NewCertificate.csr = Result->get("csr").toString();
NewCertificate.certificate = Result->get("certificate").toString();
NewCertificate.name = Result->get("name").toString();
Expand Down Expand Up @@ -121,12 +122,10 @@ namespace OpenWifi {
if (Response.getStatus() == Poco::Net::HTTPResponse::HTTP_OK) {
Poco::JSON::Parser P;
auto Result = P.parse(is).extract<Poco::JSON::Object::Ptr>();
NewCertificate.csr = Result->get("csr").toString();
NewCertificate.certificate = Result->get("certificate").toString();
NewCertificate.name = Result->get("name").toString();
NewCertificate.certificateChain = Result->get("certificate_chain").toString();
NewCertificate.certificateId = Result->get("certificate_id").toString();
NewCertificate.expiresAt = Result->get("expires_at");
RESTAPIHandler::AssignIfPresent(Result,"certificate",NewCertificate.certificate);
RESTAPIHandler::AssignIfPresent(Result,"certificate_chain",NewCertificate.certificateChain);
RESTAPIHandler::AssignIfPresent(Result,"certificate_id",NewCertificate.certificateId);
RESTAPIHandler::AssignIfPresent(Result,"expires_at",NewCertificate.expiresAt);
std::cout << Response.getStatus() << " : ";
Result->stringify(std::cout);
std::cout << std::endl;
Expand Down

0 comments on commit 4b78e64

Please sign in to comment.