Skip to content

Commit

Permalink
Remove Identity FeatureFlag
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <cwperx@amazon.com>
  • Loading branch information
cwperks committed Sep 20, 2024
1 parent f0ea056 commit eca36ff
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class IdentityAuthenticationIT extends HttpSmokeTestCase {
protected Settings nodeSettings(int nodeOrdinal) {
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(FeatureFlags.IDENTITY, "true")
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ protected FeatureFlagSettings(

public static final Set<Setting<?>> BUILT_IN_FEATURE_FLAGS = Set.of(
FeatureFlags.EXTENSIONS_SETTING,
FeatureFlags.IDENTITY_SETTING,
FeatureFlags.TELEMETRY_SETTING,
FeatureFlags.DATETIME_FORMATTER_CACHING_SETTING,
FeatureFlags.TIERED_REMOTE_INDEX_SETTING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ public class FeatureFlags {
*/
public static final String EXTENSIONS = "opensearch.experimental.feature.extensions.enabled";

/**
* Gates the functionality of identity.
*/
public static final String IDENTITY = "opensearch.experimental.feature.identity.enabled";

/**
* Gates the functionality of telemetry framework.
*/
Expand Down Expand Up @@ -82,8 +77,6 @@ public class FeatureFlags {

public static final Setting<Boolean> EXTENSIONS_SETTING = Setting.boolSetting(EXTENSIONS, false, Property.NodeScope);

public static final Setting<Boolean> IDENTITY_SETTING = Setting.boolSetting(IDENTITY, false, Property.NodeScope);

public static final Setting<Boolean> TELEMETRY_SETTING = Setting.boolSetting(TELEMETRY, false, Property.NodeScope);

public static final Setting<Boolean> DATETIME_FORMATTER_CACHING_SETTING = Setting.boolSetting(
Expand Down Expand Up @@ -138,7 +131,6 @@ public class FeatureFlags {
private static final List<Setting<Boolean>> ALL_FEATURE_FLAG_SETTINGS = List.of(
REMOTE_STORE_MIGRATION_EXPERIMENTAL_SETTING,
EXTENSIONS_SETTING,
IDENTITY_SETTING,
TELEMETRY_SETTING,
DATETIME_FORMATTER_CACHING_SETTING,
TIERED_REMOTE_INDEX_SETTING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* Identity and access control for OpenSearch
*
* @opensearch.experimental
* @opensearch.api
* */
public class IdentityService {
private static final Logger log = LogManager.getLogger(IdentityService.class);
Expand Down
6 changes: 1 addition & 5 deletions server/src/main/java/org/opensearch/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,7 @@ protected Node(
FeatureFlags.initializeFeatureFlags(settings);

final List<IdentityPlugin> identityPlugins = new ArrayList<>();
if (FeatureFlags.isEnabled(FeatureFlags.IDENTITY)) {
// If identity is enabled load plugins implementing the extension point
logger.info("Identity on so found plugins implementing: " + pluginsService.filterPlugins(IdentityPlugin.class).toString());
identityPlugins.addAll(pluginsService.filterPlugins(IdentityPlugin.class));
}
identityPlugins.addAll(pluginsService.filterPlugins(IdentityPlugin.class));

final Set<DiscoveryNodeRole> additionalRoles = pluginsService.filterPlugins(Plugin.class)
.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import static org.opensearch.common.util.FeatureFlags.DATETIME_FORMATTER_CACHING;
import static org.opensearch.common.util.FeatureFlags.EXTENSIONS;
import static org.opensearch.common.util.FeatureFlags.IDENTITY;

public class FeatureFlagTests extends OpenSearchTestCase {

Expand All @@ -40,7 +39,7 @@ public void testNonBooleanFeatureFlag() {
}

public void testBooleanFeatureFlagWithDefaultSetToFalse() {
final String testFlag = IDENTITY;
final String testFlag = EXTENSIONS;
FeatureFlags.initializeFeatureFlags(Settings.EMPTY);
assertNotNull(testFlag);
assertFalse(FeatureFlags.isEnabled(testFlag));
Expand All @@ -49,15 +48,13 @@ public void testBooleanFeatureFlagWithDefaultSetToFalse() {
public void testBooleanFeatureFlagInitializedWithEmptySettingsAndDefaultSetToFalse() {
final String testFlag = DATETIME_FORMATTER_CACHING;
FeatureFlags.initializeFeatureFlags(Settings.EMPTY);
assertNotNull(testFlag);
assertFalse(FeatureFlags.isEnabled(testFlag));
}

public void testInitializeFeatureFlagsWithExperimentalSettings() {
FeatureFlags.initializeFeatureFlags(Settings.builder().put(IDENTITY, true).build());
assertTrue(FeatureFlags.isEnabled(IDENTITY));
FeatureFlags.initializeFeatureFlags(Settings.builder().put(EXTENSIONS, true).build());
assertTrue(FeatureFlags.isEnabled(EXTENSIONS));
assertFalse(FeatureFlags.isEnabled(DATETIME_FORMATTER_CACHING));
assertFalse(FeatureFlags.isEnabled(EXTENSIONS));
// reset FeatureFlags to defaults
FeatureFlags.initializeFeatureFlags(Settings.EMPTY);
}
Expand Down

0 comments on commit eca36ff

Please sign in to comment.