support ak/sk authentication when using serverAddr

pull/2135/head
theonefx 4 years ago
parent bfabf9eea7
commit c5949a5863

@ -60,9 +60,14 @@ public class NacosDataSourceFactoryBean implements FactoryBean<NacosDataSource>
properties.setProperty(PropertyKeyConst.SERVER_ADDR, this.serverAddr); properties.setProperty(PropertyKeyConst.SERVER_ADDR, this.serverAddr);
} }
else { else {
properties.setProperty(PropertyKeyConst.ENDPOINT, this.endpoint);
}
if (!StringUtils.isEmpty(this.accessKey)) {
properties.setProperty(PropertyKeyConst.ACCESS_KEY, this.accessKey); properties.setProperty(PropertyKeyConst.ACCESS_KEY, this.accessKey);
}
if (!StringUtils.isEmpty(this.secretKey)) {
properties.setProperty(PropertyKeyConst.SECRET_KEY, this.secretKey); properties.setProperty(PropertyKeyConst.SECRET_KEY, this.secretKey);
properties.setProperty(PropertyKeyConst.ENDPOINT, this.endpoint);
} }
if (!StringUtils.isEmpty(this.namespace)) { if (!StringUtils.isEmpty(this.namespace)) {
properties.setProperty(PropertyKeyConst.NAMESPACE, this.namespace); properties.setProperty(PropertyKeyConst.NAMESPACE, this.namespace);

Loading…
Cancel
Save