Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: add jwt authentication for RegisterXXRequests #6317

Open
wants to merge 21 commits into
base: 2.x
Choose a base branch
from

Conversation

ggbocoder
Copy link
Contributor

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

implements JwtCheckAuthHandler for RegisterTMRequest and RegisterRMRequest

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

# Conflicts:
#	changes/en-us/2.x.md
#	changes/zh-cn/2.x.md
# Conflicts:
#	changes/zh-cn/2.x.md
# Conflicts:
#	core/src/main/java/org/apache/seata/core/auth/JwtAuthManager.java
#	core/src/main/java/org/apache/seata/core/rpc/RegisterCheckAuthHandler.java
#	core/src/main/java/org/apache/seata/core/rpc/netty/AbstractNettyRemotingClient.java
#	core/src/main/java/org/apache/seata/core/rpc/netty/NettyPoolableFactory.java
#	core/src/main/java/org/apache/seata/core/rpc/netty/TmNettyRemotingClient.java
#	core/src/main/java/org/apache/seata/core/rpc/processor/server/RegRmProcessor.java
#	core/src/main/java/org/apache/seata/core/rpc/processor/server/RegTmProcessor.java
#	server/src/main/java/org/apache/seata/server/auth/AbstractCheckAuthHandler.java
#	server/src/main/java/org/apache/seata/server/auth/DefaultCheckAuthHandler.java
#	server/src/main/java/org/apache/seata/server/auth/JwtCheckAuthHandler.java
#	server/src/main/resources/META-INF/services/io.seata.core.rpc.RegisterCheckAuthHandler
Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

当一个陌生的连接,未认证通过,应该不进行任何处理,直接返回一个未认证的response。
When an unfamiliar connection, unauthenticated, passes, it should be left unprocessed and an unauthenticated response should be returned directly.

@ggbocoder
Copy link
Contributor Author

ggbocoder commented Feb 4, 2024

当一个陌生的连接,未认证通过,应该不进行任何处理,直接返回一个未认证的response。 When an unfamiliar connection, unauthenticated, passes, it should be left unprocessed and an unauthenticated response should be returned directly.

Currently, unauthenticated or failed authentication requests or unfamiliar requests will be immediately closed, without further execution of the channel.

@codecov-commenter
Copy link

Codecov Report

Attention: 179 lines in your changes are missing coverage. Please review.

Comparison is base (ee6f660) 52.07% compared to head (8e9002c) 51.75%.
Report is 10 commits behind head on 2.x.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6317      +/-   ##
============================================
- Coverage     52.07%   51.75%   -0.33%     
+ Complexity     5199     5188      -11     
============================================
  Files           921      923       +2     
  Lines         32140    32341     +201     
  Branches       3869     3906      +37     
============================================
+ Hits          16737    16738       +1     
- Misses        13779    13962     +183     
- Partials       1624     1641      +17     
Files Coverage Δ
...ava/org/apache/seata/common/ConfigurationKeys.java 0.00% <ø> (ø)
.../apache/seata/core/protocol/RegisterRMRequest.java 100.00% <100.00%> (ø)
...ava/org/apache/seata/core/protocol/ResultCode.java 100.00% <100.00%> (ø)
...he/seata/core/rpc/netty/TmNettyRemotingClient.java 71.84% <88.88%> (+0.55%) ⬆️
...zer/seata/protocol/AbstractResultMessageCodec.java 75.00% <78.57%> (-2.78%) ⬇️
...he/seata/server/auth/AbstractCheckAuthHandler.java 18.18% <0.00%> (-6.82%) ⬇️
...che/seata/server/auth/DefaultCheckAuthHandler.java 28.57% <25.00%> (-4.77%) ⬇️
...boot/autoconfigure/properties/SeataProperties.java 31.37% <0.00%> (-4.19%) ⬇️
.../seata/protocol/AbstractIdentifyResponseCodec.java 66.66% <72.72%> (+6.66%) ⬆️
...ta/core/rpc/netty/AbstractNettyRemotingClient.java 30.27% <27.27%> (+1.90%) ⬆️
... and 7 more

... and 31 files with indirect coverage changes

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.

3 participants