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

feature: support server authentication blacklist configuration #4052

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

Conversation

YSF-A
Copy link
Contributor

@YSF-A YSF-A commented Sep 30, 2021

  • I have registered the PR changes.

Ⅰ. 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

* @return the boolean
*/
boolean regTransactionManagerCheckAuth(RegisterTMRequest request);
Copy link
Member

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.

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

slievrly
slievrly previously approved these changes Oct 9, 2021
Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

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

LGTM

@slievrly slievrly added this to the 2.0.0 milestone Oct 9, 2021
@slievrly
Copy link
Member

slievrly commented Oct 9, 2021

image

@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2021

Codecov Report

Merging #4052 (1ffee93) into 2.0.0 (a39d03b) will decrease coverage by 0.03%.
The diff coverage is 18.42%.

❗ Current head 1ffee93 differs from pull request most recent head d2f315c. Consider uploading reports for the commit d2f315c to get more accurate results
Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
...ava/io/seata/core/constants/ConfigurationKeys.java 0.00% <ø> (ø)
...ata/core/rpc/DefaultServerMessageListenerImpl.java 0.00% <0.00%> (ø)
...eata/core/rpc/processor/server/RegRmProcessor.java 0.00% <0.00%> (ø)
...eata/core/rpc/processor/server/RegTmProcessor.java 0.00% <0.00%> (ø)
...io/seata/server/auth/AbstractCheckAuthHandler.java 25.00% <0.00%> (ø)
.../io/seata/server/auth/DefaultCheckAuthHandler.java 20.00% <14.28%> (-13.34%) ⬇️
.../src/main/java/io/seata/server/auth/Blacklist.java 23.80% <23.80%> (ø)
...oconfigure/properties/server/ServerProperties.java 28.57% <25.00%> (-0.60%) ⬇️

import io.seata.config.ConfigurationChangeListener;
import io.seata.config.ConfigurationFactory;

public class Blacklist {
Copy link
Contributor

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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

写个动态代理,代理DefaultCheckAuthHandler吧,避免在代码里出现大量横切性问题

Copy link
Contributor Author

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会不会逻辑有些复杂。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

如果把横切代码提取成方法,虽然横切问题还会存在,但代码会简洁一点,这样是否可行。

Copy link
Contributor

Choose a reason for hiding this comment

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

如果把横切代码提取成方法,虽然横切问题还会存在,但代码会简洁一点,这样是否可行。

可以

@YSF-A YSF-A changed the base branch from develop to 2.0.0 December 28, 2021 05:56
@YSF-A YSF-A dismissed slievrly’s stale review December 28, 2021 05:56

The base branch was changed.

@YSF-A YSF-A requested a review from funky-eyes December 29, 2021 06:05
@CLAassistant
Copy link

CLAassistant commented Dec 12, 2022

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ slievrly
❌ YSF-A
You have signed the CLA already but the status is still pending? Let us recheck it.

@funky-eyes funky-eyes modified the milestones: 2.0.0, 2.x Backlog Nov 4, 2023
@slievrly slievrly changed the base branch from 2.0.0 to 2.x November 20, 2023 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Summer 2021] Enhance application protection capability of Seata-Server
5 participants