Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Handle the audit config being null #4664

Merged
merged 1 commit into from
Aug 19, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public class DynamicConfigFactory implements Initializable, ConfigurationChangeL
private static SecurityDynamicConfiguration<TenantV7> staticTenants = SecurityDynamicConfiguration.empty();
private static final WhitelistingSettings defaultWhitelistingSettings = new WhitelistingSettings();
private static final AllowlistingSettings defaultAllowlistingSettings = new AllowlistingSettings();
private static final AuditConfig defaultAuditConfig = AuditConfig.from(Settings.EMPTY);

static void resetStatics() {
staticRoles = SecurityDynamicConfiguration.empty();
Expand Down Expand Up @@ -323,7 +324,7 @@ public void onChange(Map<CType, SecurityDynamicConfiguration<?>> typeToConfig) {
eventBus.post(whitelist == null ? defaultWhitelistingSettings : whitelist);
eventBus.post(allowlist == null ? defaultAllowlistingSettings : allowlist);
if (cr.isAuditHotReloadingEnabled()) {
eventBus.post(audit);
eventBus.post(audit == null ? defaultAuditConfig : audit);
}

initialized.set(true);
Expand Down
Loading