mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-21 22:03:52 -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)
|
||||
: 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()
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue