mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-01 19:17:47 +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") {
|
if(Endpoint.Type=="orion") {
|
||||||
PoolEntry.set("radsecPoolType","orion");
|
PoolEntry.set("radsecPoolType","orion");
|
||||||
auto Servers = OpenRoaming_Orion()->GetServers();
|
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") {
|
} else if(Endpoint.Type=="radsec") {
|
||||||
PoolEntry.set("radsecPoolType","radsec");
|
PoolEntry.set("radsecPoolType","radsec");
|
||||||
|
for(const auto &Server:Endpoint.RadsecServers) {
|
||||||
|
|
||||||
|
}
|
||||||
} else if(Endpoint.Type=="radius") {
|
} else if(Endpoint.Type=="radius") {
|
||||||
PoolEntry.set("radsecPoolType","generic");
|
PoolEntry.set("radsecPoolType","generic");
|
||||||
|
auto Servers = OpenRoaming_GlobalReach()->GetServers();
|
||||||
|
for(const auto &Server:Servers) {
|
||||||
|
|
||||||
|
}
|
||||||
} else if(Endpoint.Type=="globalreach") {
|
} else if(Endpoint.Type=="globalreach") {
|
||||||
PoolEntry.set("radsecPoolType","globalreach");
|
PoolEntry.set("radsecPoolType","globalreach");
|
||||||
auto Servers = OpenRoaming_GlobalReach()->GetServers();
|
auto Servers = OpenRoaming_GlobalReach()->GetServers();
|
||||||
}
|
}
|
||||||
RadiusPools.add(PoolEntry);
|
RadiusPools.add(PoolEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
Poco::JSON::Object RadiusConfig;
|
Poco::JSON::Object RadiusConfig;
|
||||||
RadiusConfig.set("pools", RadiusPools);
|
RadiusConfig.set("pools", RadiusPools);
|
||||||
|
RadiusConfig.stringify(std::cout,4,2);
|
||||||
RadiusPools.stringify(std::cout,4,2);
|
|
||||||
|
|
||||||
AppServiceRegistry().Set("radiusEndpointLastUpdate", Utils::Now());
|
AppServiceRegistry().Set("radiusEndpointLastUpdate", Utils::Now());
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user