@Test public void testHiddenKey() { assertTrue(GlobalConfiguration.isSensitive("password123")); assertTrue(GlobalConfiguration.isSensitive("123pasSword")); assertTrue(GlobalConfiguration.isSensitive("PasSword")); assertTrue(GlobalConfiguration.isSensitive("Secret")); assertFalse(GlobalConfiguration.isSensitive("Hello")); }
public static boolean isSensitive(String key) { Preconditions.checkNotNull(key, "key is null"); final String keyInLower = key.toLowerCase(); for (String hideKey : SENSITIVE_KEYS) { if (keyInLower.length() >= hideKey.length() && keyInLower.contains(hideKey)) { return true; } } return false; }
GlobalConfiguration { public static boolean isSensitive(String key) { Preconditions.checkNotNull(key, "key is null"); final String keyInLower = key.toLowerCase(); for (String hideKey : SENSITIVE_KEYS) { if (keyInLower.length() >= hideKey.length() && keyInLower.contains(hideKey)) { return true; } } return false; } }
GlobalConfiguration { public static boolean isSensitive(String key) { Preconditions.checkNotNull(key, "key is null"); final String keyInLower = key.toLowerCase(); for (String hideKey : SENSITIVE_KEYS) { if (keyInLower.length() >= hideKey.length() && keyInLower.contains(hideKey)) { return true; } } return false; } private  GlobalConfiguration(); }
GlobalConfiguration { public static boolean isSensitive(String key) { Preconditions.checkNotNull(key, "key is null"); final String keyInLower = key.toLowerCase(); for (String hideKey : SENSITIVE_KEYS) { if (keyInLower.length() >= hideKey.length() && keyInLower.contains(hideKey)) { return true; } } return false; } private  GlobalConfiguration(); static Configuration loadConfiguration(); static Configuration loadConfiguration(Configuration dynamicProperties); static Configuration loadConfiguration(final String configDir); static Configuration loadConfiguration(final String configDir, @Nullable final Configuration dynamicProperties); static boolean isSensitive(String key); }
GlobalConfiguration { public static boolean isSensitive(String key) { Preconditions.checkNotNull(key, "key is null"); final String keyInLower = key.toLowerCase(); for (String hideKey : SENSITIVE_KEYS) { if (keyInLower.length() >= hideKey.length() && keyInLower.contains(hideKey)) { return true; } } return false; } private  GlobalConfiguration(); static Configuration loadConfiguration(); static Configuration loadConfiguration(Configuration dynamicProperties); static Configuration loadConfiguration(final String configDir); static Configuration loadConfiguration(final String configDir, @Nullable final Configuration dynamicProperties); static boolean isSensitive(String key); static final String FLINK_CONF_FILENAME; static final String HIDDEN_CONTENT; }