make whether SSO is enabled a switchable config value
Some checks are pending
/ build_macos (push) Waiting to run
/ build_windows (push) Waiting to run
/ build_ubuntu (push) Waiting to run

This commit is contained in:
Grant Limberg 2025-08-20 17:07:56 -07:00
commit 2833d0e4f4
2 changed files with 159 additions and 153 deletions

View file

@ -53,6 +53,7 @@ using ItemStream = std::vector<Item>;
CentralDB::CentralDB(const Identity& myId, const char* path, int listenPort, CentralDB::ListenerMode mode, ControllerConfig* cc)
: DB()
, _listenerMode(mode)
, _controllerConfig(cc)
, _pool()
, _myId(myId)
, _myAddress(myId.address())
@ -391,6 +392,7 @@ void CentralDB::nodeIsOnline(const uint64_t networkId, const uint64_t memberId,
AuthInfo CentralDB::getSSOAuthInfo(const nlohmann::json& member, const std::string& redirectURL)
{
if (_controllerConfig->ssoEnabled) {
auto provider = opentelemetry::trace::Provider::GetTracerProvider();
auto tracer = provider->GetTracer("CentralDB");
auto span = tracer->StartSpan("CentralDB::getSSOAuthInfo");
@ -572,6 +574,8 @@ AuthInfo CentralDB::getSSOAuthInfo(const nlohmann::json& member, const std::stri
}
return info; // std::string(authenticationURL);
}
return AuthInfo();
}
void CentralDB::initializeNetworks()

View file

@ -26,6 +26,7 @@ struct PubSubConfig;
struct PostgresNotifyConfig;
struct ControllerConfig {
bool ssoEnabled;
RedisConfig* redisConfig;
PubSubConfig* pubSubConfig;
PostgresNotifyConfig* postgresNotifyConfig;
@ -91,6 +92,7 @@ class CentralDB : public DB {
enum OverrideMode { ALLOW_PGBOUNCER_OVERRIDE = 0, NO_OVERRIDE = 1 };
ListenerMode _listenerMode;
ControllerConfig* _controllerConfig;
std::shared_ptr<ConnectionPool<PostgresConnection> > _pool;
const Identity _myId;