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

Add Spring Security Plugin #11418

Merged
merged 39 commits into from Feb 8, 2023
Merged

Add Spring Security Plugin #11418

merged 39 commits into from Feb 8, 2023

Conversation

jojocodeX
Copy link
Contributor

Add Spring Security Plugin


package org.apache.dubbo.config;

public class SecureConfig extends AbstractConfig{
Copy link
Member

Choose a reason for hiding this comment

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

What is the purpose of defining this class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

到时考虑到一些安全的配置,现阶段暂时不需要,已经移出

Comment on lines 44 to 47
public static List<FilterConditionMatcher> conditionMatchers = new ArrayList<>();

static{
conditionMatchers.add(new FilterConditionMatcherOnClass(SECURITY_CONTEXT_HOLDER_CLASS_NAME){
Copy link
Member

Choose a reason for hiding this comment

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

Prevent use static in Dubbo for multi instance status purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

检查在加载时就已经决定了,没有必要实例化过程中检查

@codecov-commenter
Copy link

codecov-commenter commented Feb 5, 2023

Codecov Report

Merging #11418 (f065180) into 3.2 (ffe4a24) will decrease coverage by 0.08%.
The diff coverage is 49.13%.

❗ Current head f065180 differs from pull request most recent head 847383f. Consider uploading reports for the commit 847383f to get more accurate results

@@             Coverage Diff              @@
##                3.2   #11418      +/-   ##
============================================
- Coverage     64.88%   64.80%   -0.08%     
  Complexity       14       14              
============================================
  Files          1506     1511       +5     
  Lines         62752    62834      +82     
  Branches       9164     9169       +5     
============================================
+ Hits          40715    40720       +5     
- Misses        17798    17878      +80     
+ Partials       4239     4236       -3     
Impacted Files Coverage Δ
...ilter/AuthenticationExceptionTranslatorFilter.java 0.00% <0.00%> (ø)
...lter/ContextHolderAuthenticationPrepareFilter.java 0.00% <0.00%> (ø)
...ter/ContextHolderAuthenticationResolverFilter.java 0.00% <0.00%> (ø)
...ContextHolderParametersSelectedTransferFilter.java 0.00% <0.00%> (ø)
...dubbo/spring/security/utils/ObjectMapperCodec.java 0.00% <0.00%> (ø)
...apache/dubbo/common/extension/ExtensionLoader.java 81.18% <72.03%> (+0.32%) ⬆️
...dubbo/common/status/support/LoadStatusChecker.java 41.66% <0.00%> (-16.67%) ⬇️
...nt/metadata/ServiceInstanceHostPortCustomizer.java 63.63% <0.00%> (-6.07%) ⬇️
...bo/remoting/zookeeper/AbstractZookeeperClient.java 81.60% <0.00%> (-3.45%) ⬇️
...apache/dubbo/rpc/protocol/dubbo/DubboProtocol.java 62.93% <0.00%> (-3.15%) ⬇️
... and 13 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment on lines 26 to 32
private static final ObjectMapper mapper = new ObjectMapper();

static{
mapper.registerModule(new CoreJackson2Module());
}

private ObjectMapperCodec(){}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
private static final ObjectMapper mapper = new ObjectMapper();
static{
mapper.registerModule(new CoreJackson2Module());
}
private ObjectMapperCodec(){}
private final ObjectMapper mapper = new ObjectMapper();
public ObjectMapperCodec(){
mapper.registerModule(new CoreJackson2Module());
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@sonarcloud
Copy link

sonarcloud bot commented Feb 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 18 Code Smells

56.9% 56.9% Coverage
2.0% 2.0% Duplication

@AlbumenJ AlbumenJ merged commit a11e639 into apache:3.2 Feb 8, 2023
@jojocodeX jojocodeX deleted the spring-security branch February 9, 2023 02:26
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.

None yet

3 participants