Skip to content

Commit

Permalink
Merge pull request #2135 from theonefx/master
Browse files Browse the repository at this point in the history
support ak/sk authentication when using serverAddr
  • Loading branch information
theonefx authored Jul 2, 2021
2 parents bfabf9e + c5949a5 commit d22f415
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,14 @@ public NacosDataSource getObject() throws Exception {
properties.setProperty(PropertyKeyConst.SERVER_ADDR, this.serverAddr);
}
else {
properties.setProperty(PropertyKeyConst.ENDPOINT, this.endpoint);
}

if (!StringUtils.isEmpty(this.accessKey)) {
properties.setProperty(PropertyKeyConst.ACCESS_KEY, this.accessKey);
}
if (!StringUtils.isEmpty(this.secretKey)) {
properties.setProperty(PropertyKeyConst.SECRET_KEY, this.secretKey);
properties.setProperty(PropertyKeyConst.ENDPOINT, this.endpoint);
}
if (!StringUtils.isEmpty(this.namespace)) {
properties.setProperty(PropertyKeyConst.NAMESPACE, this.namespace);
Expand Down

0 comments on commit d22f415

Please sign in to comment.