Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions system/jlib/jptree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9307,6 +9307,7 @@ static std::tuple<std::string, IPropertyTree *, IPropertyTree *> doLoadConfigura
absConfigFilename.append(config);

Owned<IPropertyTree> configGlobal;
Owned<IPropertyTree> configAuthnVaults;
Owned<IPropertyTree> delta;
if (optConfig)
{
Expand All @@ -9318,6 +9319,7 @@ static std::tuple<std::string, IPropertyTree *, IPropertyTree *> doLoadConfigura
{
delta.setown(loadConfiguration(absConfigFilename, componentTag, true, altNameAttribute));
configGlobal.setown(loadConfiguration(absConfigFilename, "global", false, altNameAttribute));
configAuthnVaults.setown(loadConfiguration(absConfigFilename, "vaults/authn", false, altNameAttribute));
}
}
else
Expand All @@ -9332,6 +9334,21 @@ static std::tuple<std::string, IPropertyTree *, IPropertyTree *> doLoadConfigura
delta.setown(mapper(delta));
}

// Merge authn vaults into global config so they are accessible to all components
if (configAuthnVaults)
{
if (!newGlobalConfig)
newGlobalConfig.setown(createPTree("global"));
IPropertyTree *existingVaults = newGlobalConfig->queryPropTree("vaults");
if (!existingVaults)
existingVaults = newGlobalConfig->addPropTree("vaults", createPTree("vaults"));
IPropertyTree *existingAuthn = existingVaults->queryPropTree("authn");
if (existingAuthn)
mergeConfiguration(*existingAuthn, *configAuthnVaults);
else
existingVaults->addPropTree("authn", LINK(configAuthnVaults));
}

if (configGlobal)
{
if (newGlobalConfig)
Expand Down
Loading