Skip to content

Commit

Permalink
[ISSUE#10217][ISSUE#10525] V1.x develop fix bug. (alibaba#10526)
Browse files Browse the repository at this point in the history
* Fix issue#10525. set empty role name problem.

* Fix issue#10217, not read application problem.
  • Loading branch information
KomachiSion committed May 22, 2023
1 parent 59ba327 commit 984735a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public NamingProxy(String namespaceId, String endpoint, String serverList, Prope
}
}
this.initRefreshTask();
injectRoleName();
}

private void initRefreshTask() {
Expand Down Expand Up @@ -644,7 +645,6 @@ private void injectSecurityInfo(Map<String, String> params, Header header) {
}
try {
// Inject ak/sk if exist:
injectRoleName();
String ak = getAccessKey();
String sk = getSecretKey();
params.put("app", AppNameUtils.getAppName());
Expand Down Expand Up @@ -740,8 +740,10 @@ private void injectRoleName() {
if (null != StsConfig.getInstance().getRamRoleName()) {
return;
}
String roleName = properties.getProperty(PropertyKeyConst.RAM_ROLE_NAME, "");
StsConfig.getInstance().setRamRoleName(roleName);
String roleName = properties.getProperty(PropertyKeyConst.RAM_ROLE_NAME);
if (StringUtils.isNotEmpty(roleName)) {
StsConfig.getInstance().setRamRoleName(roleName);
}
}

public String getAccessKey() {
Expand Down
2 changes: 1 addition & 1 deletion distribution/bin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ JAVA_OPT="${JAVA_OPT} -Dloader.path=${BASE_DIR}/plugins/health,${BASE_DIR}/plugi
JAVA_OPT="${JAVA_OPT} -Dnacos.home=${BASE_DIR}"
JAVA_OPT="${JAVA_OPT} -jar ${BASE_DIR}/target/${SERVER}.jar"
JAVA_OPT="${JAVA_OPT} ${JAVA_OPT_EXT}"
JAVA_OPT="${JAVA_OPT} --spring.config.additional-location=optional:${CUSTOM_SEARCH_LOCATIONS}"
JAVA_OPT="${JAVA_OPT} --spring.config.additional-location=${CUSTOM_SEARCH_LOCATIONS}"
JAVA_OPT="${JAVA_OPT} --logging.config=${BASE_DIR}/conf/nacos-logback.xml"
JAVA_OPT="${JAVA_OPT} --server.max-http-header-size=524288"

Expand Down

0 comments on commit 984735a

Please sign in to comment.