mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-22 06:14:02 -07:00
make whether SSO is enabled a switchable config value
This commit is contained in:
parent
95224379aa
commit
2833d0e4f4
2 changed files with 159 additions and 153 deletions
|
@ -53,6 +53,7 @@ using ItemStream = std::vector<Item>;
|
||||||
CentralDB::CentralDB(const Identity& myId, const char* path, int listenPort, CentralDB::ListenerMode mode, ControllerConfig* cc)
|
CentralDB::CentralDB(const Identity& myId, const char* path, int listenPort, CentralDB::ListenerMode mode, ControllerConfig* cc)
|
||||||
: DB()
|
: DB()
|
||||||
, _listenerMode(mode)
|
, _listenerMode(mode)
|
||||||
|
, _controllerConfig(cc)
|
||||||
, _pool()
|
, _pool()
|
||||||
, _myId(myId)
|
, _myId(myId)
|
||||||
, _myAddress(myId.address())
|
, _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)
|
AuthInfo CentralDB::getSSOAuthInfo(const nlohmann::json& member, const std::string& redirectURL)
|
||||||
{
|
{
|
||||||
|
if (_controllerConfig->ssoEnabled) {
|
||||||
auto provider = opentelemetry::trace::Provider::GetTracerProvider();
|
auto provider = opentelemetry::trace::Provider::GetTracerProvider();
|
||||||
auto tracer = provider->GetTracer("CentralDB");
|
auto tracer = provider->GetTracer("CentralDB");
|
||||||
auto span = tracer->StartSpan("CentralDB::getSSOAuthInfo");
|
auto span = tracer->StartSpan("CentralDB::getSSOAuthInfo");
|
||||||
|
@ -573,6 +575,8 @@ AuthInfo CentralDB::getSSOAuthInfo(const nlohmann::json& member, const std::stri
|
||||||
|
|
||||||
return info; // std::string(authenticationURL);
|
return info; // std::string(authenticationURL);
|
||||||
}
|
}
|
||||||
|
return AuthInfo();
|
||||||
|
}
|
||||||
|
|
||||||
void CentralDB::initializeNetworks()
|
void CentralDB::initializeNetworks()
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,6 +26,7 @@ struct PubSubConfig;
|
||||||
struct PostgresNotifyConfig;
|
struct PostgresNotifyConfig;
|
||||||
|
|
||||||
struct ControllerConfig {
|
struct ControllerConfig {
|
||||||
|
bool ssoEnabled;
|
||||||
RedisConfig* redisConfig;
|
RedisConfig* redisConfig;
|
||||||
PubSubConfig* pubSubConfig;
|
PubSubConfig* pubSubConfig;
|
||||||
PostgresNotifyConfig* postgresNotifyConfig;
|
PostgresNotifyConfig* postgresNotifyConfig;
|
||||||
|
@ -91,6 +92,7 @@ class CentralDB : public DB {
|
||||||
enum OverrideMode { ALLOW_PGBOUNCER_OVERRIDE = 0, NO_OVERRIDE = 1 };
|
enum OverrideMode { ALLOW_PGBOUNCER_OVERRIDE = 0, NO_OVERRIDE = 1 };
|
||||||
|
|
||||||
ListenerMode _listenerMode;
|
ListenerMode _listenerMode;
|
||||||
|
ControllerConfig* _controllerConfig;
|
||||||
std::shared_ptr<ConnectionPool<PostgresConnection> > _pool;
|
std::shared_ptr<ConnectionPool<PostgresConnection> > _pool;
|
||||||
|
|
||||||
const Identity _myId;
|
const Identity _myId;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue