-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
feature: support server authentication blacklist configuration #4052
base: 2.x
Are you sure you want to change the base?
Conversation
core/src/main/java/io/seata/core/constants/ConfigurationKeys.java
Outdated
Show resolved
Hide resolved
* @return the boolean | ||
*/ | ||
boolean regTransactionManagerCheckAuth(RegisterTMRequest request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The RegisterTMRequest parameter needs to be reserved. The parameter is used to verify the validity of client information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add blacklist
configuration in https://github.com/seata/seata/blob/develop/server/src/main/resources/application.example.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
@@ Coverage Diff @@
## 2.0.0 #4052 +/- ##
============================================
- Coverage 49.46% 49.42% -0.04%
- Complexity 3756 3757 +1
============================================
Files 700 701 +1
Lines 23608 23640 +32
Branches 2913 2917 +4
============================================
+ Hits 11678 11685 +7
- Misses 10738 10762 +24
- Partials 1192 1193 +1
|
import io.seata.config.ConfigurationChangeListener; | ||
import io.seata.config.ConfigurationFactory; | ||
|
||
public class Blacklist { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么不是BlackList
@Override | ||
public boolean doRegTransactionManagerCheck(RegisterTMRequest request) { | ||
public boolean doRegTransactionManagerCheck(RegisterTMRequest request, ChannelHandlerContext ctx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
写个动态代理,代理DefaultCheckAuthHandler吧,避免在代码里出现大量横切性问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
按照我的理解,jdk或cglib动态代理DefaultCheckAuthHandler后,会变为spi加载获得对象A,进一步通过动态代理获得增强的对象B,这样对于上层使用DefaultCheckAuthHandler会不会逻辑有些复杂。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果把横切代码提取成方法,虽然横切问题还会存在,但代码会简洁一点,这样是否可行。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果把横切代码提取成方法,虽然横切问题还会存在,但代码会简洁一点,这样是否可行。
可以
|
Ⅰ. Describe what this PR did
Support server authentication blacklist configuration
Ⅱ. Does this pull request fix one issue?
fixes #3747
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews