Skip to content

Commit

Permalink
Handle the audit config being null (opensearch-project#4650)
Browse files Browse the repository at this point in the history
Signed-off-by: Merlin <[email protected]>
Merlin authored Aug 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 8fdc00d commit d76bbfb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -83,6 +83,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();
@@ -314,7 +315,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);

0 comments on commit d76bbfb

Please sign in to comment.