Skip to content

Commit

Permalink
[Backport 2.x] Handle the audit config being null (opensearch-project…
Browse files Browse the repository at this point in the history
…#4664)

Signed-off-by: Merlin <na@notaccessible.xyz>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 89ca6a8 commit 59c737a
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit 59c737a

Please sign in to comment.