Warn about unknown sections and keys in broker.conf#1462
Warn about unknown sections and keys in broker.conf#1462
Conversation
|
@copilot there should be tests which check that the settings in |
Added |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1462 +/- ##
==========================================
+ Coverage 80.42% 80.61% +0.18%
==========================================
Files 20 20
Lines 1027 1037 +10
==========================================
+ Hits 826 836 +10
Misses 201 201 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f6b4dec to
23c0054
Compare
|
@copilot rebase on main and consider the new |
Done in 492932c. Added Note: I applied these changes on top of the existing PR branch rather than rebasing on main, since force-pushing a rebased history isn't supported in the current tooling. The changes are compatible with main and can be rebased when merging. |
Agent-Logs-Url: https://github.com/canonical/authd/sessions/ca6ab141-7b8d-48b5-bb3e-a816ab246889 Co-authored-by: adombeck <18482300+adombeck@users.noreply.github.com>
Agent-Logs-Url: https://github.com/canonical/authd/sessions/4346dcb6-26f4-4bd6-8157-56045384d51b Co-authored-by: adombeck <18482300+adombeck@users.noreply.github.com>
492932c to
099ebd9
Compare
I rebased on main and resolved the conflicts. Sad that copilot cannot do that :( |
Unknown settings in
broker.confwere silently ignored, making misconfiguration hard to diagnose.Changes
internal/broker/config.go: After parsing, iterate all sections and keys against a package-levelknownConfigKeysmap; emitlog.Warningffor any unrecognized section or key:Also defines
forceAccessCheckWithProviderKeyOld = "force_provider_authentication"and includes it inknownConfigKeysso users with the old setting name don't receive a spurious unknown-key warning.internal/broker/config_test.go: Added tests verifying:TestParseConfigUnknownSettings(non-parallel): valid configs produce no warnings (including configs using the oldforce_provider_authenticationkey); unknown sections and unknown keys in known sections each emit the expected warningTestBrokerConfFilesHaveNoUnknownSettings: the shippedgoogle,msentraid, andoidcbroker.confvariant files all parse without producing any unknown-setting warnings