mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-10-29 09:42:38 +00:00
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
@@ -29,20 +29,55 @@ namespace OpenWifi {
|
||||
if(Endpoint.Type=="orion") {
|
||||
PoolEntry.set("radsecPoolType","orion");
|
||||
auto Servers = OpenRoaming_Orion()->GetServers();
|
||||
Poco::JSON::Object ServerDetails;
|
||||
ServerDetails.set("methodParameters", Poco::JSON::Array() );
|
||||
ServerDetails.set("monitor", false );
|
||||
ServerDetails.set("monitorMethod", "none" );
|
||||
ServerDetails.set("strategy","random");
|
||||
Poco::JSON::Array ServerArray;
|
||||
ProvObjects::GooglOrionAccountInfo OA;
|
||||
StorageService()->OrionAccountsDB().GetRecord("id",Endpoint.RadsecServers[0].UseOpenRoamingAccount,OA);
|
||||
int i=1;
|
||||
for(const auto &Server:Servers) {
|
||||
Poco::JSON::Object AuthConfig;
|
||||
AuthConfig.set("allowSelfSigned", false);
|
||||
AuthConfig.set("ignore", false);
|
||||
AuthConfig.set("name", fmt::format("Server {}",i));
|
||||
AuthConfig.set("ip", Server.Hostname);
|
||||
AuthConfig.set("radsecPort", Server.Port);
|
||||
AuthConfig.set("radsecCert", Utils::base64encode((const u_char *)OA.certificate.c_str(),OA.certificate.size()));
|
||||
AuthConfig.set("radsecKey", Utils::base64encode((const u_char *)OA.privateKey.c_str(),OA.privateKey.size()));
|
||||
Poco::JSON::Array CaCerts;
|
||||
for(const auto &cert:OA.cacerts) {
|
||||
CaCerts.add(Utils::base64encode((const u_char *)cert.c_str(),cert.size()));
|
||||
}
|
||||
AuthConfig.set("radsecCacerts", CaCerts);
|
||||
AuthConfig.set("radsecSecret","radsec");
|
||||
i++;
|
||||
ServerArray.add(AuthConfig);
|
||||
}
|
||||
ServerDetails.set("servers",ServerArray);
|
||||
} else if(Endpoint.Type=="radsec") {
|
||||
PoolEntry.set("radsecPoolType","radsec");
|
||||
for(const auto &Server:Endpoint.RadsecServers) {
|
||||
|
||||
}
|
||||
} else if(Endpoint.Type=="radius") {
|
||||
PoolEntry.set("radsecPoolType","generic");
|
||||
auto Servers = OpenRoaming_GlobalReach()->GetServers();
|
||||
for(const auto &Server:Servers) {
|
||||
|
||||
}
|
||||
} else if(Endpoint.Type=="globalreach") {
|
||||
PoolEntry.set("radsecPoolType","globalreach");
|
||||
auto Servers = OpenRoaming_GlobalReach()->GetServers();
|
||||
}
|
||||
RadiusPools.add(PoolEntry);
|
||||
}
|
||||
|
||||
Poco::JSON::Object RadiusConfig;
|
||||
RadiusConfig.set("pools", RadiusPools);
|
||||
|
||||
RadiusPools.stringify(std::cout,4,2);
|
||||
RadiusConfig.stringify(std::cout,4,2);
|
||||
|
||||
AppServiceRegistry().Set("radiusEndpointLastUpdate", Utils::Now());
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user