Skip to content

Commit

Permalink
[INLONG-7931][DataProxy] Optimize common.properties related control m…
Browse files Browse the repository at this point in the history
…echanism (#7942)
  • Loading branch information
gosonzhang committed Apr 30, 2023
1 parent bed95a3 commit d0eb134
Show file tree
Hide file tree
Showing 24 changed files with 601 additions and 532 deletions.
Expand Up @@ -18,12 +18,9 @@
package org.apache.inlong.dataproxy.config;

import org.apache.inlong.common.util.BasicAuth;
import org.apache.inlong.dataproxy.consts.ConfigConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

public class AuthUtils {

private static final Logger LOG = LoggerFactory.getLogger(AuthUtils.class);
Expand All @@ -32,10 +29,9 @@ public class AuthUtils {
* Generate http basic auth credential from configured secretId and secretKey
*/
public static String genBasicAuth() {
Map<String, String> properties = ConfigManager.getInstance().getCommonProperties();
String secretId = properties.get(ConfigConstants.MANAGER_AUTH_SECRET_ID);
String secretKey = properties.get(ConfigConstants.MANAGER_AUTH_SECRET_KEY);
return BasicAuth.genBasicAuthCredential(secretId, secretKey);
return BasicAuth.genBasicAuthCredential(
CommonConfigHolder.getInstance().getManagerAuthSecretId(),
CommonConfigHolder.getInstance().getManagerAuthSecretKey());
}

}

0 comments on commit d0eb134

Please sign in to comment.