Skip to content

Commit

Permalink
[PLAT-14156][PLAT-14323]: Move all UI Driven flags to INTERNAL and re…
Browse files Browse the repository at this point in the history
…move YBM key as its not used

Summary:
Our aim to have just 2 flags moving forward INTERNAL and PUBLIC, as part of the effort, we are
1. Remove runtime conf tag YBM from managed repo as it is not used anywhere
2. Move all UI Driven flags to INTERNAL

Test Plan: Tests passed

Reviewers: #yba-api-review!, vbansal, svarshney, asharma

Reviewed By: vbansal

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D36629
  • Loading branch information
rajmaddy89 committed Jul 24, 2024
1 parent cdd97f8 commit 2813d78
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ public static List<ConfKeyTags> parseTagsList(String s) {
} catch (Exception e) {
throw new PlatformServiceException(
BAD_REQUEST,
"Not a valid list of tags."
+ "All possible tags are "
+ "PUBLIC, UIDriven, BETA, INTERNAL, YBM");
"Not a valid list of tags." + "All possible tags are " + "PUBLIC, BETA, INTERNAL");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ public enum ConfKeyTags {
PUBLIC,
// Keys hidden from the UI
INTERNAL,
// YBM Keys
YBM,
// Keys for which we do not have metadata yet
BETA,
// Keys with dedicated UI
UIDriven,
// Feature flag keys. Only allowed data type: boolean.
// These can be viewed without authorising. Should only be set at global scope.
FEATURE_FLAG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,71 +80,71 @@ public class GlobalConfKeys extends RuntimeConfigKeysModule {
"Use OAUTH",
"Hidden because this key has dedicated UI",
ConfDataType.BooleanType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<String> ybSecurityType =
new ConfKeyInfo<>(
"yb.security.type",
ScopeType.GLOBAL,
"YB Security Type",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Boolean> displayJWTToken =
new ConfKeyInfo<>(
"yb.security.showJWTInfoOnLogin",
ScopeType.GLOBAL,
"Display JWT Token on Login Screen",
"Display JWT Token on Login Screen",
ConfDataType.BooleanType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<String> ybClientID =
new ConfKeyInfo<>(
"yb.security.clientID",
ScopeType.GLOBAL,
"YB Client ID",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<String> ybSecuritySecret =
new ConfKeyInfo<>(
"yb.security.secret",
ScopeType.GLOBAL,
"YB Security Secret",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<String> discoveryURI =
new ConfKeyInfo<>(
"yb.security.discoveryURI",
ScopeType.GLOBAL,
"Discovery URI",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<String> oidcProviderMetadata =
new ConfKeyInfo<>(
"yb.security.oidcProviderMetadata",
ScopeType.GLOBAL,
"Provider Metadata from discoveryURI",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<String> oidcScope =
new ConfKeyInfo<>(
"yb.security.oidcScope",
ScopeType.GLOBAL,
"OIDC Scope",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<String> oidcEmailAttribute =
new ConfKeyInfo<>(
"yb.security.oidcEmailAttribute",
ScopeType.GLOBAL,
"OIDC Email Attribute",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Boolean> ssh2Enabled =
new ConfKeyInfo<>(
"yb.security.ssh2_enabled",
Expand Down Expand Up @@ -485,127 +485,127 @@ public class GlobalConfKeys extends RuntimeConfigKeysModule {
"Use LDAP",
"Hidden because this key has dedicated UI",
ConfDataType.BooleanType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<String> ldapUrl =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_url",
ScopeType.GLOBAL,
"LDAP URL",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<String> ldapPort =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_port",
ScopeType.GLOBAL,
"LDAP Port",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<String> ldapBaseDn =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_basedn",
ScopeType.GLOBAL,
"LDAP Base DN",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<String> ldapDnPrefix =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_dn_prefix",
ScopeType.GLOBAL,
"LDAP DN Prefix",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<String> ldapCustomerUUID =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_customeruuid",
ScopeType.GLOBAL,
"LDAP Customer UUID",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<String> ldapServiceAccountDistinguishedName =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_service_account_distinguished_name",
ScopeType.GLOBAL,
"LDAP Service Account Username",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<String> ldapServiceAccountPassword =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_service_account_password",
ScopeType.GLOBAL,
"LDAP Service Account Password",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<Boolean> enableLdap =
new ConfKeyInfo<>(
"yb.security.ldap.enable_ldaps",
ScopeType.GLOBAL,
"Enable LDAPS",
"TODO - Leave this for feature owners to fill in",
ConfDataType.BooleanType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<Boolean> enableLdapStartTls =
new ConfKeyInfo<>(
"yb.security.ldap.enable_ldap_start_tls",
ScopeType.GLOBAL,
"Enable LDAPS start TLS",
"Hidden because this key has dedicated UI",
ConfDataType.BooleanType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<Boolean> ldapUseSearchAndBind =
new ConfKeyInfo<>(
"yb.security.ldap.use_search_and_bind",
ScopeType.GLOBAL,
"Use Search and Bind",
"Hidden because this key has dedicated UI",
ConfDataType.BooleanType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<String> ldapSearchAttribute =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_search_attribute",
ScopeType.GLOBAL,
"LDAP Search Attribute",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<String> ldapGroupSearchFilter =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_group_search_filter",
ScopeType.GLOBAL,
"LDAP Group Search Filter Query",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<SearchScope> ldapGroupSearchScope =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_group_search_scope",
ScopeType.GLOBAL,
"LDAP group search scope in case of filter query",
"Hidden because this key has dedicated UI",
ConfDataType.LdapSearchScopeEnum,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<String> ldapGroupSearchBaseDn =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_group_search_base_dn",
ScopeType.GLOBAL,
"LDAP group search base DN in case of filter query",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<String> ldapGroupMemberOfAttribute =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_group_member_of_attribute",
ScopeType.GLOBAL,
"memberOf attribute in user LDAP entry to be used for group memberships",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<Boolean> ldapGroupUseQuery =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_group_use_query",
Expand All @@ -614,31 +614,31 @@ public class GlobalConfKeys extends RuntimeConfigKeysModule {
+ "for establishing LDAP group membership",
"Hidden because this key has dedicated UI",
ConfDataType.BooleanType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<Boolean> ldapGroupUseRoleMapping =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_group_use_role_mapping",
ScopeType.GLOBAL,
"Whether to use ldap group to role mapping",
"Hidden because this key has dedicated UI",
ConfDataType.BooleanType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<Role> ldapDefaultRole =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_default_role",
ScopeType.GLOBAL,
"LDAP Default Role",
"Which role to use in case role cannot be discerned via LDAP",
ConfDataType.UserRoleEnum,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<TlsProtocol> ldapTlsProtocol =
new ConfKeyInfo<>(
"yb.security.ldap.ldap_tls_protocol",
ScopeType.GLOBAL,
"Which TLS protocol to use for StartTLS or LDAPS",
"Hidden because this key has dedicated UI",
ConfDataType.LdapTlsProtocol,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static ConfKeyInfo<Boolean> ldapsEnforceCertVerification =
new ConfKeyInfo<>(
"yb.security.ldap.enforce_server_cert_verification",
Expand Down Expand Up @@ -1271,7 +1271,7 @@ public class GlobalConfKeys extends RuntimeConfigKeysModule {
"OIDC default role",
"Which role to use incase group memberships are not found",
ConfDataType.UserRoleEnum,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Boolean> enableReleasesRedesign =
new ConfKeyInfo<>(
"yb.releases.use_redesign",
Expand Down Expand Up @@ -1311,15 +1311,15 @@ public class GlobalConfKeys extends RuntimeConfigKeysModule {
"LDAP Search Filter",
"Hidden because this key has dedicated UI",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<String> oidcRefreshTokenEndpoint =
new ConfKeyInfo<>(
"yb.security.oidcRefreshTokenEndpoint",
ScopeType.GLOBAL,
"Endpoint for fetching the access token",
"YBA will fetch the access token using the refresh token if specified from the endpoint",
ConfDataType.StringType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Duration> oidcRefreshTokenInterval =
new ConfKeyInfo<>(
"yb.security.oidcRefreshTokenInterval",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ public class UniverseConfKeys extends RuntimeConfigKeysModule {
"Enable Rollback Support",
"Enable Yugabyte DB Rollback support",
ConfDataType.BooleanType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Boolean> allowGFlagsOverrideDuringPreFinalize =
new ConfKeyInfo<>(
"yb.gflags.allow_during_prefinalize",
Expand Down Expand Up @@ -940,15 +940,15 @@ public class UniverseConfKeys extends RuntimeConfigKeysModule {
"Configure YSQL DB API",
"Allow users to configure YSQL DB API from UI",
ConfDataType.BooleanType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Boolean> allowConfigureYCQL =
new ConfKeyInfo<>(
"yb.configure_db_api.ycql",
ScopeType.UNIVERSE,
"Configure YCQL DB API",
"Allow users to configure YCQL DB API from UI",
ConfDataType.BooleanType,
ImmutableList.of(ConfKeyTags.UIDriven));
ImmutableList.of(ConfKeyTags.INTERNAL));
public static final ConfKeyInfo<Duration> waitForReplicationDrainTimeout =
new ConfKeyInfo<>(
"yb.xcluster.transactional.wait_for_replication_drain_timeout",
Expand Down
2 changes: 1 addition & 1 deletion managed/src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ yb {
gcp.default_volume_size_gb = 100
azure.default_volume_size_gb = 100

runtime_conf_ui.tag_filter = ["PUBLIC","BETA","INTERNAL","UIDriven","YBM"]
runtime_conf_ui.tag_filter = ["PUBLIC","BETA","INTERNAL"]
}

ybc {
Expand Down
2 changes: 1 addition & 1 deletion managed/src/main/resources/swagger-strict.json
Original file line number Diff line number Diff line change
Expand Up @@ -3859,7 +3859,7 @@
},
"tags" : {
"items" : {
"enum" : [ "PUBLIC", "INTERNAL", "YBM", "BETA", "UIDriven", "FEATURE_FLAG" ],
"enum" : [ "PUBLIC", "INTERNAL", "BETA", "FEATURE_FLAG" ],
"type" : "string"
},
"type" : "array"
Expand Down
2 changes: 1 addition & 1 deletion managed/src/main/resources/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3894,7 +3894,7 @@
},
"tags" : {
"items" : {
"enum" : [ "PUBLIC", "INTERNAL", "YBM", "BETA", "UIDriven", "FEATURE_FLAG" ],
"enum" : [ "PUBLIC", "INTERNAL", "BETA", "FEATURE_FLAG" ],
"type" : "string"
},
"type" : "array"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ public class ConfDataTypeTest {

@Test
public void tagListParse() {
List<ConfKeyTags> list =
new ArrayList<>(Arrays.asList(ConfKeyTags.PUBLIC, ConfKeyTags.BETA, ConfKeyTags.UIDriven));
assertTrue(list.equals(parseTagsList("[\"PUBLIC\",\"BETA\",\"UIDriven\"]")));
List<ConfKeyTags> list = new ArrayList<>(Arrays.asList(ConfKeyTags.PUBLIC, ConfKeyTags.BETA));
assertTrue(list.equals(parseTagsList("[\"PUBLIC\",\"BETA\"]")));
// Strings should be enclosed within double quotes
assertPlatformException(() -> parseTagsList("[Three,Sample,String]"));
assertPlatformException(() -> parseTagsList("[\"Invalid\",\"tags\"]"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,7 @@ public void dataValidationTest() {
assertValue(
rJson,
"error",
"Not a valid list of tags."
+ "All possible tags are "
+ "PUBLIC, UIDriven, BETA, INTERNAL, YBM");
"Not a valid list of tags." + "All possible tags are " + "PUBLIC, BETA, INTERNAL");
}

@Test
Expand Down

0 comments on commit 2813d78

Please sign in to comment.