You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/04/11 11:49:47 UTC
[GitHub] [dubbo] zhaoguhong opened a new issue, #9910: metadata-report is not support a separate configuration password
zhaoguhong opened a new issue, #9910:
URL: https://github.com/apache/dubbo/issues/9910
### Environment
* Dubbo version: 2.7.15
* Operating System version: mac os 10.15.7
* Java version: java 8
### config
good
```bash
dubbo.metadata-report.address=redis://default:123456@11.6.0.4:6379
```
bad
```bash
dubbo.metadata-report.address=redis://11.6.0.4:6379
dubbo.metadata-report.username=default
dubbo.metadata-report.password=123456
```
error
```bash
Caused by: redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required.
```
### How to Fix?
https://github.com/apache/dubbo/blob/master/dubbo-common/src/main/java/org/apache/dubbo/config/ConfigCenterConfig.java
#### current
![image](https://user-images.githubusercontent.com/28058794/162732942-109288e0-8db0-4bf5-af11-31003f7629be.png)
#### After Fix
```java
public URL toUrl() throws IllegalArgumentException {
String address = this.getAddress();
if (isEmpty(address)) {
throw new IllegalArgumentException("The address of metadata report is invalid.");
}
Map<String, String> map = new HashMap<String, String>();
URL url = URL.valueOf(address);
// Issue : https://github.com/apache/dubbo/issues/6491
// Append the parameters from address
map.putAll(url.getParameters());
// Append or overrides the properties as parameters
appendParameters(map, this);
// Normalize the parameters
map.putAll(convert(map, null));
// put the protocol of URL as the "metadata"
map.put("metadata", url.getProtocol());
return new URL("metadata",
url.getUsername() == null ? this.getUsername() : url.getUsername(),
url.getPassword() == null ? this.getPassword() : url.getPassword(),
url.getHost(),
url.getPort(this.getPort()),
url.getPath(), map);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
[GitHub] [dubbo] AlbumenJ closed issue #9910: metadata-report is not support a separate configuration password
Posted by GitBox <gi...@apache.org>.
AlbumenJ closed issue #9910: metadata-report is not support a separate configuration password
URL: https://github.com/apache/dubbo/issues/9910
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org