Skip to content

[Dubbo-2017]Fix redis auth problem for RedisProtocol#2018

Merged
chickenlj merged 7 commits intoapache:masterfrom
ningyu1:fix-redisProtocol-noauth
Jul 31, 2018
Merged

[Dubbo-2017]Fix redis auth problem for RedisProtocol#2018
chickenlj merged 7 commits intoapache:masterfrom
ningyu1:fix-redisProtocol-noauth

Conversation

@ningyu1
Copy link
Copy Markdown
Contributor

@ningyu1 ningyu1 commented Jul 3, 2018

What is the purpose of the change

Access redis using a password. #2017

Brief changelog

Fix redis auth problem for RedisProtocol, add parameter db.index for url.

Verifying this change

modify: RedisProtocol.java
modify: RedisRegistry.java
add UT: RedisProtocolTest.testAuthRedis
add UT: RedisProtocolTest.testWrongAuthRedis

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a GITHUB_issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn clean install -DskipTests & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 3, 2018

Codecov Report

Merging #2018 into master will increase coverage by 1.91%.
The diff coverage is 83.33%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2018      +/-   ##
============================================
+ Coverage     52.14%   54.06%   +1.91%     
- Complexity     4902     5148     +246     
============================================
  Files           562      570       +8     
  Lines         25216    25600     +384     
  Branches       4449     4506      +57     
============================================
+ Hits          13150    13840     +690     
+ Misses        10060     9691     -369     
- Partials       2006     2069      +63
Impacted Files Coverage Δ Complexity Δ
...apache/dubbo/rpc/protocol/redis/RedisProtocol.java 60.97% <100%> (+0.97%) 7 <0> (+1) ⬆️
...org/apache/dubbo/registry/redis/RedisRegistry.java 32.76% <66.66%> (-0.11%) 16 <0> (ø)
.../remoting/transport/netty4/NettyClientHandler.java 58.33% <0%> (-14.09%) 5% <0%> (ø)
...ache/dubbo/remoting/p2p/support/AbstractGroup.java 45.45% <0%> (-11.37%) 7% <0%> (-1%)
...apache/dubbo/rpc/protocol/rest/BaseRestServer.java 88.88% <0%> (-11.12%) 7% <0%> (-1%)
...ubbo/common/compiler/support/AdaptiveCompiler.java 77.77% <0%> (-11.12%) 3% <0%> (-1%)
...le/src/main/java/com/alibaba/dubbo/rpc/Result.java 22.22% <0%> (-11.12%) 0% <0%> (ø)
...he/dubbo/remoting/transport/netty/NettyClient.java 72.88% <0%> (-10.17%) 12% <0%> (-1%)
...onfig/spring/extension/SpringExtensionFactory.java 75% <0%> (-9.62%) 10% <0%> (+2%)
...ubbo/rpc/protocol/dubbo/ChannelWrappedInvoker.java 41.66% <0%> (-4.17%) 3% <0%> (ø)
... and 70 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b5b430...1f6bc11. Read the comment docs.

@chickenlj chickenlj added this to the 2.6.3 milestone Jul 9, 2018
final JedisPool jedisPool = new JedisPool(config, url.getHost(), url.getPort(DEFAULT_PORT),
url.getParameter(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT));
if (StringUtils.isBlank(url.getPassword())) {
jedisPool = new JedisPool(config, url.getHost(), url.getPort(DEFAULT_PORT),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use StringUtils.isBlank(url.getPassword())?: style to replace if style, reduce reduplicated codes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kimmking You're right. thank you.
done

@chickenlj chickenlj modified the milestones: 2.6.3, 2.6.4 Jul 23, 2018
@diecui1202
Copy link
Copy Markdown

LGTM.

&READY-TO-MERGE&

@diecui1202
Copy link
Copy Markdown

BTW, need to merge to 2.6.x? @ningyu1

@ningyu1
Copy link
Copy Markdown
Contributor Author

ningyu1 commented Jul 24, 2018

@diecui1202 Yes

@ningyu1
Copy link
Copy Markdown
Contributor Author

ningyu1 commented Jul 27, 2018

@diecui1202 merge to 2.6.x PR: #2146

@chickenlj chickenlj merged commit 7f48cd0 into apache:master Jul 31, 2018
carryxyh pushed a commit to carryxyh/incubator-dubbo that referenced this pull request Aug 2, 2018
@diecui1202 diecui1202 modified the milestones: 2.6.4, 2.7.0 Sep 5, 2018
@ningyu1 ningyu1 deleted the fix-redisProtocol-noauth branch November 5, 2019 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants