For better UX, we should print a warning if the broker.conf contains an unknown setting.
The github.com/go-ini/ini package we use to parse the config file does not have built-in support for that, but we can implement it ourselves via:
// Print warnings for unknown sections and keys.
known := map[string][]string{
oidcSection: {
issuerKey,
clientIDKey,
clientSecret,
forceProviderAuthenticationKey,
},
usersSection: {
allowedUsersKey,
ownerKey,
homeDirKey,
sshSuffixesKey,
sshSuffixesKeyOld,
extraGroupsKey,
ownerExtraGroupsKey,
},
}
for _, section := range iniCfg.Sections() {
if _, ok := known[section.Name()]; !ok {
log.Warningf(context.Background(), "unknown section %q in config file, ignoring", section.Name())
continue
}
for _, key := range section.Keys() {
if _, ok := known[section.Name()]; !ok {
log.Warningf(context.Background(), "unknown key %q in section %q in config file, ignoring", key.Name(), section.Name())
continue
}
}
}
For better UX, we should print a warning if the broker.conf contains an unknown setting.
The github.com/go-ini/ini package we use to parse the config file does not have built-in support for that, but we can implement it ourselves via:
In our tests we should check that no warnings are printed
UDENG-8335