Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nsion settings bwcPluginMode

Signed-off-by: scosta <[email protected]>
  • Loading branch information
samuelcostae committed Jul 4, 2023
1 parent 4eef662 commit 2fc41ed
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
import org.opensearch.indices.SystemIndexDescriptor;
import org.opensearch.indices.breaker.CircuitBreakerService;
import org.opensearch.plugins.ClusterPlugin;
import org.opensearch.plugins.ExtensionAwarePlugin;
import org.opensearch.plugins.MapperPlugin;
import org.opensearch.repositories.RepositoriesService;
import org.opensearch.rest.RestController;
Expand Down Expand Up @@ -191,7 +192,7 @@
import org.opensearch.watcher.ResourceWatcherService;
// CS-ENFORCE-SINGLE

public final class OpenSearchSecurityPlugin extends OpenSearchSecuritySSLPlugin implements ClusterPlugin, MapperPlugin {
public final class OpenSearchSecurityPlugin extends OpenSearchSecuritySSLPlugin implements ClusterPlugin, MapperPlugin, ExtensionAwarePlugin {

private static final String KEYWORD = ".keyword";
private static final Logger actionTrace = LogManager.getLogger("opendistro_security_action_trace");
Expand Down Expand Up @@ -1098,6 +1099,16 @@ public Settings additionalSettings() {
return builder.build();
}

@Override
public List<Setting<?>> getExtensionSettings() {
List<Setting<?>> extentionSettings = new ArrayList<Setting<?>>();

extentionSettings.add(Setting.boolSetting(ConfigConstants.EXTENSIONS_BWC_PLUGIN_MODE, ConfigConstants.EXTENSIONS_BWC_PLUGIN_MODE_DEFAULT, Property.ExtensionScope, Property.Final));
extentionSettings.add(Setting.listSetting(ConfigConstants.EXTENSIONS_DISTIGUISHED_NAMES, ConfigConstants.EXTENSIONS_DISTINGUISHED_NAMES_DEFAULT, Function.identity(), Property.ExtensionScope, Property.Final));

return extentionSettings;
}

@Override
public List<Setting<?>> getSettings() {
List<Setting<?>> settings = new ArrayList<Setting<?>>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,13 @@ public enum RolesMappingResolution {
public static final String TENANCY_GLOBAL_TENANT_NAME = "global";
public static final String TENANCY_GLOBAL_TENANT_DEFAULT_NAME = "";

// Extension Settings
public static final String EXTENSIONS_SETTING = "extensions";
public static final String EXTENSIONS_BWC_PLUGIN_MODE = "bwcPluginMode";
public static final boolean EXTENSIONS_BWC_PLUGIN_MODE_DEFAULT = false;
public static final String EXTENSIONS_DISTIGUISHED_NAMES = "extensionDistinguishedNames";
public static final List<String> EXTENSIONS_DISTINGUISHED_NAMES_DEFAULT = Collections.emptyList();

public static Set<String> getSettingAsSet(
final Settings settings,
final String key,
Expand Down

0 comments on commit 2fc41ed

Please sign in to comment.