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

upgrade springboot version to 3.4.0 #12927

Open
wants to merge 235 commits into
base: v3.0-develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
235 commits
Select commit Hold shift + click to select a range
8d6f0cd
Upgrade dependencies version of spring, springboot, httpclient, servl…
MoritzArena Jul 12, 2024
302e8d9
Upgrade nacos-auth of jakarta.servlet
MoritzArena Jul 12, 2024
24d8231
Upgrade nacos-core to springboot 3
MoritzArena Jul 12, 2024
224bcba
Upgrade nacos-auth test module to springboot 3
MoritzArena Jul 12, 2024
3251f93
Upgrade nacos-config module to springboot 3
MoritzArena Jul 12, 2024
48aeba9
Upgrade nacos-cmdb module to springboot 3
MoritzArena Jul 13, 2024
afa4de2
Upgrade default-auth-plugin module to springboot 3
MoritzArena Jul 13, 2024
3912254
Upgrade nacos-client pom dependency version
MoritzArena Jul 13, 2024
a8a29ea
Upgrade nacos-naming module to springboot 3
MoritzArena Jul 15, 2024
e7c45c4
Upgrade nacos-common to support httpclient 5.2
MoritzArena Jul 16, 2024
70dc69b
Fix default-auth-plugin pmd
MoritzArena Jul 16, 2024
15b3d24
Upgrade nacos-naming module to springboot 3
MoritzArena Jul 16, 2024
c89f687
Upgrade nacos-prometheus module to springboot 3
MoritzArena Jul 16, 2024
9e462dd
Upgrade nacos-common test module to support httpclient 5.2
MoritzArena Jul 16, 2024
87dc3aa
Upgrade nacos-console to support springboot 3
MoritzArena Jul 16, 2024
9776d35
Upgrade nacos-address to support springboot 3
MoritzArena Jul 16, 2024
d4a5613
Fix nacos-consistency test module
MoritzArena Jul 16, 2024
79f43fa
Upgrade javax.servlet to jakarta.servlet
MoritzArena Jul 16, 2024
7109e47
Update httpclient 5 syntax
MoritzArena Jul 16, 2024
4d2443c
Update nacos-test to support springboot 3
MoritzArena Jul 16, 2024
87c6191
Update test module to support springboot 3
MoritzArena Jul 16, 2024
afab8ce
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
f12a172
Fix actuator issues
MoritzArena Jul 17, 2024
2666e37
Upgrade logback level syntax
MoritzArena Jul 17, 2024
eeca0b1
Fix prometheus errors
MoritzArena Jul 18, 2024
b073a63
Fallback to use for instead of iterator
MoritzArena Jul 18, 2024
9958c77
Fix logback output useless log
MoritzArena Jul 18, 2024
e11cd10
Upgrade pmd plugin
MoritzArena Jul 19, 2024
0974c04
Upgrade maven shade plugin to support JDK 17
MoritzArena Jul 19, 2024
b9585a8
Upgrade p3c-pmd plugin to support JDK 17
MoritzArena Jul 19, 2024
97ac1c3
Fix pmd grammar error
MoritzArena Jul 19, 2024
09ace26
Upgrade grpc dependency version to support maven-shade-plugin
MoritzArena Jul 19, 2024
fb6d360
Append grpc-inprocess dependency
MoritzArena Jul 19, 2024
d0b50ea
Fix default logback config
MoritzArena Jul 20, 2024
6d55517
Fix auth error
MoritzArena Jul 20, 2024
38d22ff
Upgrade nacos-common to support httpclient 5.2
MoritzArena Jul 16, 2024
e11b6a8
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
c55d646
Fallback to use for instead of iterator
MoritzArena Jul 18, 2024
0fe4cbf
Fix auth error
MoritzArena Jul 20, 2024
194d459
Update default application.properties
MoritzArena Jul 22, 2024
ac0326a
Upgrade nacos-common to support httpclient 5.2
MoritzArena Jul 16, 2024
c623ab6
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
e22ee05
Fix actuator issues
MoritzArena Jul 17, 2024
3f61e46
Fallback to use for instead of iterator
MoritzArena Jul 18, 2024
873947d
Upgrade grpc dependency version to support maven-shade-plugin
MoritzArena Jul 19, 2024
d449934
Append grpc-inprocess dependency
MoritzArena Jul 19, 2024
78fd774
Fix auth error
MoritzArena Jul 20, 2024
2f5ec5b
Upgrade nacos-common to support httpclient 5.2
MoritzArena Jul 16, 2024
68da271
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
f24bbc6
Fallback to use for instead of iterator
MoritzArena Jul 18, 2024
f999189
Upgrade grpc dependency version to support maven-shade-plugin
MoritzArena Jul 19, 2024
f276801
Append grpc-inprocess dependency
MoritzArena Jul 19, 2024
1dafa84
Fix auth error
MoritzArena Jul 20, 2024
2b4ee45
Update test module
MoritzArena Jul 22, 2024
1bec865
Remove duplicate grpc-util.
MoritzArena Jul 22, 2024
05f8e36
Update test unit for fixing jdk 17 reflect changes
MoritzArena Jul 23, 2024
eec3f20
Remove useless remark
MoritzArena Jul 23, 2024
1c24899
Remove useless remark
MoritzArena Jul 29, 2024
5a60346
Upgrade nacos-common to support httpclient 5.2
MoritzArena Jul 16, 2024
0c278c5
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
b31e891
Upgrade grpc dependency version to support maven-shade-plugin
MoritzArena Jul 19, 2024
c4f5db1
Append grpc-inprocess dependency
MoritzArena Jul 19, 2024
db1a867
Fix auth error
MoritzArena Jul 20, 2024
3f882b6
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
12a7f86
Fix auth error
MoritzArena Jul 20, 2024
3d9d5d0
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
10e954a
Fix actuator issues
MoritzArena Jul 17, 2024
b59c853
Upgrade grpc dependency version to support maven-shade-plugin
MoritzArena Jul 19, 2024
9265fe0
Append grpc-inprocess dependency
MoritzArena Jul 19, 2024
0a28434
Fix auth error
MoritzArena Jul 20, 2024
24f82a7
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
5f51dc6
Upgrade grpc dependency version to support maven-shade-plugin
MoritzArena Jul 19, 2024
8294065
Append grpc-inprocess dependency
MoritzArena Jul 19, 2024
64bac12
Fix auth error
MoritzArena Jul 20, 2024
acc11c8
Remove duplicate grpc-util.
MoritzArena Jul 22, 2024
da63511
Re-divide the indicators of nacos_monitor
MoritzArena Aug 1, 2024
51819d8
Fallback to use micrometer 1.12.8
MoritzArena Aug 1, 2024
246bce2
Upgrade dependencies version of spring, springboot, httpclient, servl…
MoritzArena Jul 12, 2024
7003cdd
Upgrade nacos-core to springboot 3
MoritzArena Jul 12, 2024
9118e36
Upgrade nacos-common to support httpclient 5.2
MoritzArena Jul 16, 2024
a3f01ef
Upgrade javax.servlet to jakarta.servlet
MoritzArena Jul 16, 2024
e538a2e
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
4610eb8
Fix prometheus errors
MoritzArena Jul 18, 2024
6c70c74
Upgrade pmd plugin
MoritzArena Jul 19, 2024
e111058
Upgrade p3c-pmd plugin to support JDK 17
MoritzArena Jul 19, 2024
c5f1ffc
Append grpc-inprocess dependency
MoritzArena Jul 19, 2024
05f870f
Fix auth error
MoritzArena Jul 20, 2024
71dc03e
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
7100391
Fix auth error
MoritzArena Jul 20, 2024
e0ae542
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
f718b91
Fix actuator issues
MoritzArena Jul 17, 2024
2d999b7
Fix auth error
MoritzArena Jul 20, 2024
00d9a96
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
88f7f20
Upgrade grpc dependency version to support maven-shade-plugin
MoritzArena Jul 19, 2024
ae7c93d
Append grpc-inprocess dependency
MoritzArena Jul 19, 2024
78f3189
Fix auth error
MoritzArena Jul 20, 2024
f12776b
Update test module
MoritzArena Jul 22, 2024
dcd5e8f
Remove duplicate grpc-util.
MoritzArena Jul 22, 2024
1bdcc1d
Upgrade nacos-common to support httpclient 5.2
MoritzArena Jul 16, 2024
82350f0
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
6e0bed3
Fallback to use for instead of iterator
MoritzArena Jul 18, 2024
488e3d7
Upgrade grpc dependency version to support maven-shade-plugin
MoritzArena Jul 19, 2024
dd62a8c
Append grpc-inprocess dependency
MoritzArena Jul 19, 2024
984e63b
Fix auth error
MoritzArena Jul 20, 2024
abd72a3
Upgrade nacos-common to support httpclient 5.2
MoritzArena Jul 16, 2024
a588f19
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
335a460
Fallback to use for instead of iterator
MoritzArena Jul 18, 2024
be3336e
Fix auth error
MoritzArena Jul 20, 2024
7cc23f5
Upgrade nacos-common to support httpclient 5.2
MoritzArena Jul 16, 2024
32fa4ed
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
f403ac4
Fix actuator issues
MoritzArena Jul 17, 2024
977f2a4
Fallback to use for instead of iterator
MoritzArena Jul 18, 2024
2b74b5c
Fix auth error
MoritzArena Jul 20, 2024
171c13b
Upgrade nacos-common to support httpclient 5.2
MoritzArena Jul 16, 2024
5e7dcf7
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
8ca15e2
Fallback to use for instead of iterator
MoritzArena Jul 18, 2024
7762b17
Fix auth error
MoritzArena Jul 20, 2024
6e5550b
Remove duplicate grpc-util.
MoritzArena Jul 22, 2024
7124e6a
Remove useless remark
MoritzArena Jul 23, 2024
6147987
Re-divide the indicators of nacos_monitor
MoritzArena Aug 1, 2024
5c8de69
Fallback to use micrometer 1.12.8
MoritzArena Aug 1, 2024
9d62598
Upgrade nacos-core to springboot 3
MoritzArena Jul 12, 2024
da79811
Upgrade javax.servlet to jakarta.servlet
MoritzArena Jul 16, 2024
b671e6b
Fix prometheus errors
MoritzArena Jul 18, 2024
c86a7fa
Upgrade grpc dependency version to support maven-shade-plugin
MoritzArena Jul 19, 2024
63b6c48
Upgrade grpc dependency version to support maven-shade-plugin
MoritzArena Jul 19, 2024
2e048fa
Re-divide the indicators of nacos_monitor
MoritzArena Aug 1, 2024
cefa96b
Fallback to use micrometer 1.12.8
MoritzArena Aug 1, 2024
a78266c
Fallback to use old hessian(#12342)
MoritzArena Aug 7, 2024
dffc31f
Fix issues during upgrade to springboot 3
MoritzArena Jul 17, 2024
c6b072d
Update test module
MoritzArena Jul 22, 2024
442dd42
Upgrade to support native
MoritzArena Aug 15, 2024
93e8de4
Support native for unix
MoritzArena Aug 15, 2024
7dc556c
Support native for unix
MoritzArena Aug 15, 2024
57d051e
Support native for unix
MoritzArena Aug 15, 2024
6062320
Categorize Maven by OS
MoritzArena Aug 15, 2024
43bfa44
Upgrade for rocksdb
MoritzArena Aug 16, 2024
293af14
Fix service discover issue
MoritzArena Aug 21, 2024
5c05e45
Remove unused parameters
MoritzArena Aug 22, 2024
8cf4c5e
Fix auth plugin reflect issue
MoritzArena Aug 22, 2024
2b75813
Fix persistent instance registration issue
MoritzArena Aug 24, 2024
bb9277f
Fix listener registration issue
MoritzArena Aug 26, 2024
0667946
remove useless args for others os platform
MoritzArena Aug 26, 2024
4d1c907
update for cluster mode test
MoritzArena Sep 4, 2024
9d53f9d
update for cluster mode test
MoritzArena Sep 4, 2024
86a0c58
update for cluster mode test
MoritzArena Sep 4, 2024
e4ae245
update for cluster mode test
MoritzArena Sep 4, 2024
b8ba2a3
update for cluster mode test
MoritzArena Sep 4, 2024
7d505d2
update for cluster mode test
MoritzArena Sep 4, 2024
6596365
update for cluster mode
MoritzArena Sep 4, 2024
1c8c2c3
update for cluster mode test
MoritzArena Sep 5, 2024
85f88a0
update for cluster mode test
MoritzArena Sep 5, 2024
5007fda
update for cluster mode test
MoritzArena Sep 5, 2024
afdaeb3
debug for grpc native
MoritzArena Sep 5, 2024
ea4a222
debug for grpc native
MoritzArena Sep 5, 2024
4f0c732
debug for grpc native
MoritzArena Sep 5, 2024
99f7050
debug for grpc native
MoritzArena Sep 5, 2024
5be750d
debug for grpc native
MoritzArena Sep 5, 2024
cd00ab2
rollback for debug
MoritzArena Sep 5, 2024
5f49641
update reflection for cluster
MoritzArena Sep 5, 2024
3a1be52
debug update for rpc-grpc-impl
MoritzArena Sep 6, 2024
ca9e045
update reflection for grpc netty channel
MoritzArena Sep 6, 2024
24fd4af
update reflection for grpc netty channel
MoritzArena Sep 6, 2024
604d42a
update reflection for grpc netty channel
MoritzArena Sep 6, 2024
622c11b
update reflection for grpc netty channel
MoritzArena Sep 6, 2024
ba3cd61
update reflection for grpc netty channel
MoritzArena Sep 6, 2024
5dad5a0
debug jraft stub for nacos
MoritzArena Sep 7, 2024
21956df
debug jraft stub for nacos
MoritzArena Sep 7, 2024
bf1cc96
debug jraft stub for nacos
MoritzArena Sep 7, 2024
8d8f00d
debug jraft stub for nacos
MoritzArena Sep 7, 2024
f2898c2
debug jraft stub for nacos
MoritzArena Sep 7, 2024
e914555
debug jraft stub for nacos
MoritzArena Sep 7, 2024
e3ce4c2
debug jraft stub for nacos
MoritzArena Sep 7, 2024
1120c37
debug jraft stub for nacos
MoritzArena Sep 7, 2024
f0d1282
debug jraft stub for nacos
MoritzArena Sep 7, 2024
577c894
debug jraft stub for nacos
MoritzArena Sep 7, 2024
8d1b563
debug jraft stub for nacos
MoritzArena Sep 7, 2024
3bf2d11
update grpc native hints
MoritzArena Sep 8, 2024
3e861e5
debug for jraft core reflection
MoritzArena Sep 8, 2024
58075bc
debug for jraft core reflection
MoritzArena Sep 8, 2024
d7e0cfa
debug for jraft core reflection
MoritzArena Sep 8, 2024
69f536f
debug for cluster grpc channel
MoritzArena Sep 8, 2024
b6fa76f
debug and update for cluster grpc channel
MoritzArena Sep 8, 2024
874bb0d
debug and update for cluster grpc channel
MoritzArena Sep 8, 2024
290d5aa
debug and update for cluster grpc channel
MoritzArena Sep 8, 2024
10c939f
debug and update for cluster grpc channel
MoritzArena Sep 8, 2024
d445760
debug and update for cluster grpc channel
MoritzArena Sep 8, 2024
76648c8
debug and update for cluster grpc channel
MoritzArena Sep 8, 2024
11a4a73
resolve useless import
MoritzArena Sep 8, 2024
f94e0c4
update grpc reflection hints
MoritzArena Sep 9, 2024
49858aa
update grpc reflection hints
MoritzArena Sep 9, 2024
35845f6
Update linux native hints
MoritzArena Sep 10, 2024
72abfec
generator for debug
MoritzArena Sep 10, 2024
49fc28f
update reflections
MoritzArena Sep 10, 2024
b8aaae1
fallback reflections
MoritzArena Sep 10, 2024
d4688ea
update unix reflections
MoritzArena Sep 11, 2024
e471869
update reflections
MoritzArena Sep 11, 2024
4953e9e
update debug info
MoritzArena Sep 11, 2024
3289ed8
update unix reflections
MoritzArena Sep 11, 2024
85ee856
debug for grpc-stub
MoritzArena Sep 11, 2024
7c63c5d
debug for grpc-stub
MoritzArena Sep 11, 2024
356d8c2
debug for grpc-stub and grpc-core
MoritzArena Sep 12, 2024
8e7c018
debug for grpc-stub and grpc-core
MoritzArena Sep 12, 2024
7979a48
debug for grpc-stub and grpc-core
MoritzArena Sep 12, 2024
fd65598
debug for grpc-stub and grpc-core
MoritzArena Sep 12, 2024
c657d44
debug for grpc-stub and grpc-core
MoritzArena Sep 12, 2024
bab6fb6
debug for grpc-stub and grpc-core
MoritzArena Sep 12, 2024
395887b
debug for grpc-stub and grpc-core
MoritzArena Sep 12, 2024
2f09310
debug for grpc-stub and grpc-core
MoritzArena Sep 13, 2024
53dcdfd
debug for native nacos internal grpc-stub and grpc-core
MoritzArena Sep 13, 2024
9d9f105
debug for native nacos
MoritzArena Sep 14, 2024
a5caddb
debug for native nacos
MoritzArena Sep 15, 2024
e1d7b1d
debug for native nacos
MoritzArena Sep 15, 2024
308153e
debug for native nacos
MoritzArena Sep 15, 2024
a660692
debug for native nacos
MoritzArena Sep 15, 2024
996b740
debug for native nacos
MoritzArena Sep 15, 2024
75745d1
debug for native nacos
MoritzArena Sep 16, 2024
97eb0af
debug for native nacos
MoritzArena Sep 16, 2024
4e0167a
debug for native nacos
MoritzArena Sep 16, 2024
7331463
debug for native nacos
MoritzArena Sep 16, 2024
deddad9
debug for native nacos
MoritzArena Sep 16, 2024
24757a4
debug for native nacos
MoritzArena Sep 16, 2024
fc82ee0
debug for native nacos
MoritzArena Sep 16, 2024
bc77d0c
debug for native nacos bean processor
MoritzArena Sep 16, 2024
1de0258
debug for native nacos bean processor
MoritzArena Sep 16, 2024
6633e3c
debug for native nacos bean processor
MoritzArena Sep 16, 2024
289ddff
debug for native nacos bean processor
MoritzArena Sep 17, 2024
fb28079
remove unused import
MoritzArena Sep 17, 2024
ea2e097
add reflection hint
MoritzArena Sep 17, 2024
b1d5537
using cluster build arguments
MoritzArena Sep 17, 2024
e11099b
clean project
MoritzArena Sep 17, 2024
81b30fc
refactor script
MoritzArena Sep 24, 2024
7f780f4
update hessian version
MoritzArena Oct 28, 2024
c67bbf8
Merge pull request #12667 from DioxideCN/develop-issue#12028_native
JianweiWang Oct 29, 2024
4f6ce79
升级springboot版本为3.4.0
JianweiWang Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions address/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
</plugin>
</plugins>
</reporting>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public List<Instance> generateInstancesByIps(String serviceName, String rawProdu
}

private String[] generateIpAndPort(String ip) {
String[] result = InternetAddressUtil.splitIPPortStr(ip);
String[] result = InternetAddressUtil.splitIpPortStr(ip);
if (result.length != InternetAddressUtil.SPLIT_IP_PORT_RESULT_LENGTH) {
return new String[] {result[0], String.valueOf(AddressServerConstants.DEFAULT_SERVER_PORT)};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.web.SecurityFilterChain;

/**
Expand All @@ -34,8 +36,10 @@ public class AddressServerSecurityConfiguration {
@Order(99)
public SecurityFilterChain addressServerSecurityFilterChain(HttpSecurity http) throws Exception {
http.authorizeHttpRequests(
requestMatcherRegistry -> requestMatcherRegistry.mvcMatchers("/nacos/v1/as/**").authenticated()).csrf()
.disable().httpBasic();
requestMatcherRegistry -> requestMatcherRegistry
.requestMatchers("/nacos/v1/as/**").authenticated())
.csrf(AbstractHttpConfigurer::disable)
.httpBasic(Customizer.withDefaults());
return http.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public ResponseEntity<String> postCluster(@RequestParam(required = false) String
String serviceName = addressServerGeneratorManager.generateNacosServiceName(productName);

Result result = registerCluster(serviceName, rawProductName, clusterName, ips);
if (InternetAddressUtil.checkOK(result.getCheckResult())) {
if (InternetAddressUtil.checkOk(result.getCheckResult())) {
responseEntity = ResponseEntity
.ok("product=" + rawProductName + ",cluster=" + rawClusterName + "; put success with size="
+ result.getSize());
Expand Down Expand Up @@ -133,8 +133,8 @@ private Result registerCluster(String serviceName, String productName, String cl
clusterOperator.updateClusterMetadata(Constants.DEFAULT_NAMESPACE_ID, serviceName, clusterName, metadata);
}
String[] ipArray = addressServerManager.splitIps(ips);
String checkResult = InternetAddressUtil.checkIPs(ipArray);
if (InternetAddressUtil.checkOK(checkResult)) {
String checkResult = InternetAddressUtil.checkIps(ipArray);
if (InternetAddressUtil.checkOk(checkResult)) {
List<Instance> instanceList = addressServerGeneratorManager
.generateInstancesByIps(serviceName, productName, clusterName, ipArray);
for (Instance instance : instanceList) {
Expand Down Expand Up @@ -181,8 +181,8 @@ public ResponseEntity<String> deleteCluster(@RequestParam(required = false) Stri
}
// delete specified ip list
String[] ipArray = addressServerManager.splitIps(ips);
String checkResult = InternetAddressUtil.checkIPs(ipArray);
if (InternetAddressUtil.checkOK(checkResult)) {
String checkResult = InternetAddressUtil.checkIps(ipArray);
if (InternetAddressUtil.checkOk(checkResult)) {
List<Instance> instanceList = addressServerGeneratorManager
.generateInstancesByIps(serviceName, rawProductName, clusterName, ipArray);
for (Instance each : instanceList) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
</encoder>
</appender>

<logger name="com.alibaba.nacos.address.main" additivity="false">
<level value="INFO"/>
<logger name="com.alibaba.nacos.address.main" additivity="false" level="INFO">
<appender-ref ref="nacos-address"/>
</logger>
</included>
Expand Down
4 changes: 4 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@
<groupId>io.grpc</groupId>
<artifactId>grpc-util</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-inprocess</artifactId>
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-common-protos</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package com.alibaba.nacos.api.grpc.auto;

import io.grpc.ClientCall;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
Expand Down Expand Up @@ -202,8 +204,8 @@ protected RequestFutureStub build(io.grpc.Channel channel,
*/
public com.google.common.util.concurrent.ListenableFuture<com.alibaba.nacos.api.grpc.auto.Payload> request(
com.alibaba.nacos.api.grpc.auto.Payload request) {
return futureUnaryCall(
getChannel().newCall(getRequestMethod(), getCallOptions()), request);
return futureUnaryCall(getChannel().newCall(getRequestMethod(),
getCallOptions()), request);
}
}

Expand Down
10 changes: 5 additions & 5 deletions api/src/main/java/com/alibaba/nacos/api/naming/pojo/Cluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class Cluster implements Serializable {
/**
* Whether or not use instance port to do health check.
*/
private boolean useIPPort4Check = true;
private boolean useIpPort4Check = true;

private Map<String, String> metadata = new HashMap<>();

Expand Down Expand Up @@ -116,12 +116,12 @@ public void setDefaultCheckPort(int defaultCheckPort) {
this.defaultCheckPort = defaultCheckPort;
}

public boolean isUseIPPort4Check() {
return useIPPort4Check;
public boolean isUseIpPort4Check() {
return useIpPort4Check;
}

public void setUseIPPort4Check(boolean useIPPort4Check) {
this.useIPPort4Check = useIPPort4Check;
public void setUseIpPort4Check(boolean useIpPort4Check) {
this.useIpPort4Check = useIpPort4Check;
}

public Map<String, String> getMetadata() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ public class ServiceInfo {

private String checksum = "";

private volatile boolean allIPs = false;
private volatile boolean allIps = false;

private volatile boolean reachProtectionThreshold = false;

public ServiceInfo() {
}

public boolean isAllIPs() {
return allIPs;
public boolean isAllIps() {
return allIps;
}

public void setAllIPs(boolean allIPs) {
this.allIPs = allIPs;
public void setAllIps(boolean allIps) {
this.allIps = allIps;
}

/**
Expand Down Expand Up @@ -180,7 +180,7 @@ public void setCacheMillis(long cacheMillis) {
* @return true if validate, otherwise false
*/
public boolean validate() {
if (isAllIPs()) {
if (isAllIps()) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class NetUtils {
*
* @return local ip
*/
public static String localIP() {
public static String localIp() {
if (!StringUtils.isEmpty(localIp)) {
return localIp;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@ void testSetAndGet() {
assertEquals(Tcp.TYPE, actual.getHealthChecker().getType());
assertEquals(80, actual.getDefaultPort());
assertEquals(80, actual.getDefaultCheckPort());
assertTrue(actual.isUseIPPort4Check());
assertTrue(actual.isUseIpPort4Check());
assertTrue(actual.getMetadata().isEmpty());
actual.setName("cluster");
actual.setServiceName("group@@service");
actual.setHealthChecker(new Http());
actual.setDefaultPort(81);
actual.setDefaultCheckPort(82);
actual.setUseIPPort4Check(false);
actual.setUseIpPort4Check(false);
actual.setMetadata(Collections.singletonMap("a", "a"));
assertEquals("cluster", actual.getName());
assertEquals("group@@service", actual.getServiceName());
assertEquals(Http.TYPE, actual.getHealthChecker().getType());
assertEquals(81, actual.getDefaultPort());
assertEquals(82, actual.getDefaultCheckPort());
assertFalse(actual.isUseIPPort4Check());
assertFalse(actual.isUseIpPort4Check());
assertFalse(actual.getMetadata().isEmpty());
assertTrue(actual.getMetadata().containsKey("a"));
assertEquals("a", actual.getMetadata().get("a"));
Expand All @@ -78,30 +78,30 @@ void testJsonSerialize() throws JsonProcessingException {
actual.setHealthChecker(new Http());
actual.setDefaultPort(81);
actual.setDefaultCheckPort(82);
actual.setUseIPPort4Check(false);
actual.setUseIpPort4Check(false);
actual.setMetadata(Collections.singletonMap("a", "a"));
String json = mapper.writeValueAsString(actual);
assertTrue(json.contains("\"serviceName\":\"group@@service\""));
assertTrue(json.contains("\"name\":\"cluster\""));
assertTrue(json.contains("\"type\":\"HTTP\""));
assertTrue(json.contains("\"defaultPort\":81"));
assertTrue(json.contains("\"defaultCheckPort\":82"));
assertTrue(json.contains("\"useIPPort4Check\":false"));
assertTrue(json.contains("\"useIpPort4Check\":false"));
assertTrue(json.contains("\"metadata\":{\"a\":\"a\"}"));
}

@Test
void testJsonDeserialize() throws JsonProcessingException {
String json = "{\"serviceName\":\"group@@service\",\"name\":\"cluster\","
+ "\"healthChecker\":{\"type\":\"HTTP\",\"path\":\"\",\"headers\":\"\",\"expectedResponseCode\":200},"
+ "\"defaultPort\":81,\"defaultCheckPort\":82,\"useIPPort4Check\":false,\"metadata\":{\"a\":\"a\"}}";
+ "\"defaultPort\":81,\"defaultCheckPort\":82,\"useIpPort4Check\":false,\"metadata\":{\"a\":\"a\"}}";
Cluster actual = mapper.readValue(json, Cluster.class);
assertEquals("cluster", actual.getName());
assertEquals("group@@service", actual.getServiceName());
assertEquals(Http.TYPE, actual.getHealthChecker().getType());
assertEquals(81, actual.getDefaultPort());
assertEquals(82, actual.getDefaultCheckPort());
assertFalse(actual.isUseIPPort4Check());
assertFalse(actual.isUseIpPort4Check());
assertFalse(actual.getMetadata().isEmpty());
assertTrue(actual.getMetadata().containsKey("a"));
assertEquals("a", actual.getMetadata().get("a"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void testSerialize() throws JsonProcessingException {
assertTrue(actual.contains("\"lastRefTime\":0"));
assertTrue(actual.contains("\"checksum\":\"\""));
assertTrue(actual.contains("\"valid\":true"));
assertTrue(actual.contains("\"allIPs\":false"));
assertTrue(actual.contains("\"allIps\":false"));
assertFalse(actual.contains("jsonFromServer"));
assertFalse(actual.contains("key"));
assertFalse(actual.contains("keyEncoded"));
Expand All @@ -67,7 +67,7 @@ void testSerialize() throws JsonProcessingException {
@Test
void testDeserialize() throws IOException {
String example = "{\"name\":\"G@@testName\",\"clusters\":\"testClusters\",\"cacheMillis\":1000,\"hosts\":[],"
+ "\"lastRefTime\":0,\"checksum\":\"\",\"allIPs\":false,\"valid\":true,\"groupName\":\"\"}";
+ "\"lastRefTime\":0,\"checksum\":\"\",\"allIps\":false,\"valid\":true,\"groupName\":\"\"}";
ServiceInfo actual = mapper.readValue(example, ServiceInfo.class);
assertEquals("G@@testName", actual.getName());
assertEquals(0, actual.ipCount());
Expand All @@ -79,7 +79,7 @@ void testDeserialize() throws IOException {
assertTrue(actual.expired());
assertTrue(actual.getHosts().isEmpty());
assertTrue(actual.isValid());
assertFalse(actual.isAllIPs());
assertFalse(actual.isAllIps());
}

@Test
Expand Down Expand Up @@ -121,7 +121,7 @@ void testServiceInfoConstructorWithError() {

@Test
void testValidateForAllIps() {
serviceInfo.setAllIPs(true);
serviceInfo.setAllIps(true);
assertTrue(serviceInfo.validate());
}

Expand Down
10 changes: 5 additions & 5 deletions api/src/test/java/com/alibaba/nacos/api/utils/NetUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ void tearDown() throws Exception {
@Test
void testLocalIpWithSpecifiedIp() {
System.setProperty("com.alibaba.nacos.client.local.ip", "10.2.8.8");
assertEquals("10.2.8.8", NetUtils.localIP());
assertEquals("10.2.8.8", NetUtils.localIp());
System.setProperty("com.alibaba.nacos.client.local.ip", "10.2.8.9");
assertEquals("10.2.8.8", NetUtils.localIP());
assertEquals("10.2.8.8", NetUtils.localIp());
}

@Test
void testLocalIpWithPreferHostname() throws Exception {
InetAddress inetAddress = invokeGetInetAddress();
String hostname = inetAddress.getHostName();
System.setProperty("com.alibaba.nacos.client.local.preferHostname", "true");
assertEquals(hostname, NetUtils.localIP());
assertEquals(hostname, NetUtils.localIp());
}

@Test
void testLocalIpWithoutPreferHostname() throws Exception {
InetAddress inetAddress = invokeGetInetAddress();
String ip = inetAddress.getHostAddress();
assertEquals(ip, NetUtils.localIP());
assertEquals(ip, NetUtils.localIp());
}

@Test
Expand All @@ -75,7 +75,7 @@ void testLocalIpWithException() throws Exception {
try {
System.setProperty("java.net.preferIPv6Addresses", "aaa");
InetAddress expect = InetAddress.getLocalHost();
assertEquals(expect.getHostAddress(), NetUtils.localIP());
assertEquals(expect.getHostAddress(), NetUtils.localIp());
} finally {
field.set(null, properties);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import com.alibaba.nacos.auth.util.Loggers;
import com.alibaba.nacos.common.utils.StringUtils;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.alibaba.nacos.plugin.auth.spi.server.AuthPluginManager;
import com.alibaba.nacos.plugin.auth.spi.server.AuthPluginService;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.Map;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import com.alibaba.nacos.auth.parser.AbstractResourceParser;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

/**
* Abstract Http Resource Parser.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.alibaba.nacos.common.utils.NamespaceUtil;
import com.alibaba.nacos.common.utils.StringUtils;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import java.util.Properties;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.alibaba.nacos.common.utils.NamespaceUtil;
import com.alibaba.nacos.common.utils.StringUtils;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import java.util.Properties;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.mockito.junit.jupiter.MockitoSettings;
import org.mockito.quality.Strictness;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.junit.jupiter.api.Test;
import org.springframework.mock.env.MockEnvironment;

import java.util.Optional;

import static org.junit.jupiter.api.Assertions.assertEquals;

class AuthConfigsTest {
Expand Down Expand Up @@ -57,10 +59,13 @@ void testUpgradeFromEvent() {
environment.setProperty("nacos.core.auth.enable.userAgentAuthWhite", String.valueOf(TEST_ENABLE_UA_WHITE));

authConfigs.onEvent(ServerConfigChangeEvent.newEvent());
assertEquals(TEST_AUTH_ENABLED, authConfigs.isAuthEnabled());
assertEquals(TEST_CACHING_ENABLED, authConfigs.isCachingEnabled());
assertEquals(Optional.of(TEST_AUTH_ENABLED).orElse(Boolean.FALSE),
Optional.of(authConfigs.isAuthEnabled()).orElse(Boolean.FALSE));
assertEquals(Optional.of(TEST_CACHING_ENABLED).orElse(Boolean.FALSE),
Optional.of(authConfigs.isCachingEnabled()).orElse(Boolean.FALSE));
assertEquals(TEST_SERVER_IDENTITY_KEY, authConfigs.getServerIdentityKey());
assertEquals(TEST_SERVER_IDENTITY_VALUE, authConfigs.getServerIdentityValue());
assertEquals(TEST_ENABLE_UA_WHITE, authConfigs.isEnableUserAgentAuthWhite());
assertEquals(Optional.of(TEST_ENABLE_UA_WHITE).orElse(Boolean.FALSE),
Optional.of(authConfigs.isEnableUserAgentAuthWhite()).orElse(Boolean.FALSE));
}
}
Loading