Commit Graph

790 Commits

Author SHA1 Message Date
chenhao26
de5ec356cc
import config file auth fail (#8844)
* import config file auth fail

* run ci

* run ci2
2022-08-01 16:48:55 +08:00
liqipeng
e97b695db2
[ISSUE #8345] Check cluster name in server-side when registerInstance (#8724)
* Check cluster name in server-side when register ephemeral instance

* Check cluster name in server-side when register persistent instance

* add unit test for register instance

* add unit test for NamingHttpClientProxy

* remove catching NacosException to throw NacosRuntimeException
2022-07-25 09:57:43 +08:00
Cherish 蔡梦缘
837b1c13d9
[ISSUE #7039] Temporary fix encryptedContent bug. (#8463)
* fix(#7039): Temporary fix encryptedContent bug.

* fix(#7039): optimization the 2.x Temporary fix.

* cr(#7039): getConfigAndSignListener get a decryptContent.

* test(#7039): fix getConfigAndSignListener test.
2022-07-19 13:11:19 +08:00
ZhangShenao
e1ef9839e0
Remove Duplicated Check in Method com.alibaba.nacos.client.naming.cache.ServiceInfoHolder#isChangedServiceInfo (#8746)
* Use Fail-Fast in Method `com.alibaba.nacos.naming.core.ServiceManager#createServiceIfAbsent`

* Modify Comments

* Remove Duplicated Check in com.alibaba.nacos.client.naming.cache.ServiceInfoHolder#isChangedServiceInfo
2022-07-19 10:28:38 +08:00
onewe
704210e0c4
[ISSUES #8622] Add NacosEnvironment and add some unit tests (#8680)
* [ISSUES #8622] Add NacosEnvironment and add some unit tests

- remove magic number
- refactor all of them
- add some unit tests for env
- modify search rule and reformat
- fix search order
- fix p3c error

* fix ci error

* add some type converters

- enhance search method
- default_setting.properties is renamed nacos_default_setting.properties

* the property key of system environment replace dot with underscore

* add some default values and enhance SystemEnvPropertySource

* add the copyright information
2022-07-11 10:05:33 +08:00
chenhao26
b52fc22d37
batch register add some unit tests (#8702)
* add some junit for batch register

* code syle
2022-07-08 11:53:58 +08:00
MajorHe1
68b521679c
[ISSUE #8709] check serverList size before reconnect to server (#8710)
* [ISSUE #8709] check serverList size before reconnect to server

* use CollectionUtils.isEmpty to judge whether server list  is empty

Co-authored-by: Oliver <wqdyxnbd@163.com>

Co-authored-by: Oliver <wqdyxnbd@163.com>
2022-07-08 11:52:11 +08:00
chenhao26
073f9e09ed
[ISSUE#5863]add nacos client batchRegitserInstance request (#8675)
* add nacos client batchRegitserInstance request

* adjustment code

* fix word and do not remove indent
2022-07-07 10:56:22 +08:00
liqipeng
ff7bebac53
[ISSUE #8345] Check cluster name in client when registerInstance (#8618)
* Check cluster name in client when registerInstance

* Use `Pattern.compile` to check number to avoid performance lost.
2022-07-01 11:07:55 +08:00
liqipeng
b53827bcb9
fix typo (#8591) 2022-06-20 10:16:49 +08:00
Oliver
01fb64fb58
Fix typo (#8567) 2022-06-17 11:06:43 +08:00
Cherish 蔡梦缘
703925a84f
feat(#8472): [Dependency Governance] Remove useless dependencies. (#8472) (#8473) 2022-06-13 10:31:11 +08:00
david6969xin
b8b34b81cc
[ISSUE#8533] remove redundant signHeaders empty judgment (#8534) 2022-06-10 09:58:56 +08:00
david6969xin
ce41075de6
[ISSUE#8485] (module-client) replace the type specification in this constructor call with the diamond operator ("<>") (#8498) 2022-06-06 10:35:14 +08:00
Sivyer
e66a1903f3
optimize. config request monitor collect right request code. (#7770)
Co-authored-by: wangdong <wangdong@cdfinance.com.cn>
2022-06-04 14:25:57 +08:00
liqipeng
f7a28105b2
[ISSUE #8428] fix naming subscribe bug when multiple NamingService (#8433) 2022-05-27 14:05:05 +08:00
胡俊
e9094835cb
Solve the problem of adding logback listener repeatedly. (#8454) 2022-05-27 13:36:28 +08:00
drgnchan
50d7b204ff
change logging order by logging after invoking getSnapshot (#8094) 2022-05-18 11:20:41 +08:00
Oliver
dbcdbb725d
[ISSUE #8372] Fix https connection (#8380)
* Fix #8372

* add unit test and remove set serverAddrsStr null

* restore judgement and UT

* add UT

* split UT
2022-05-18 10:52:21 +08:00
david6969xin
5938b7f50f
[ISSUE#8358] make this anonymous inner class a lambda (client module) (#8367) 2022-05-16 10:18:57 +08:00
hutt
c68956b179
Add comments about config client failover (#8327) (#8343) 2022-05-12 19:28:27 +08:00
rui.zhang
4d8a7626aa
Hotfix issue 8350 (#8351)
* optimization: in this case, renamed the variable definition

* optimization: in this case, renamed the variable definition

* optimization: revert the VipServer to Vipserver

* optimization: reverse vipServer changes

* optimization: recover renamed vipServer
2022-05-12 18:16:12 +08:00
訾明华
dc33cf2c8f
增加对状态码为404的判断 (#7984)
由于目前调用GET: /nacos/v1/cs/configs,当配置不存在时,会返回状态码为404。此处无法识别错误,导致日志看不出来
2022-05-06 11:48:11 +08:00
drgnchan
7dc1c82166
use getEncryptDataKeySnapshot instead of getEncryptDataKeyFailover (#8096) 2022-05-06 11:47:22 +08:00
onewe
8980a960aa
[ISSUE #7487] Add generics for the CacheBuilder. (#7490) 2022-04-27 13:52:49 +08:00
胡俊
98d1221b9e
[ISSUE#6999] Solve the problem that Nacos client does not support logback overload log configuration (#8229)
* Revert "[ISSUE#6999]Logback overrides the automatic refresh of application logback . issu… (#7596)"

This reverts commit 7bb6cf2d13.

* bak

* suport logback update

* 。

* 。

* Revert "。"

This reverts commit b5f7a698c149b8a95328aa72f5b30b84d19fa0e2.

* suport logback update

* suport logback update

* 修改style

* 添加注释
2022-04-27 13:50:10 +08:00
nov.lzf
2e9c09d367
fix different client worker share same localsnapshot bug ,add properties to control whether load snaoshot content on startup in CacheData (#8202) 2022-04-24 13:33:28 +08:00
Oliver
a9e2cbd4d8
Set interrupted flag to caller (#8116) 2022-04-20 10:49:00 +08:00
Oliver
8838ae1417
Override hashCode and equals to avoid repeated item (#8207) 2022-04-20 10:00:39 +08:00
shalk(xiao kun)
69bad6f447
add rollover with date for log4j2 with JM.LOG.RETAIN.DURATION.OFF and JM.LOG.RETAIN.DURATION (#8134) 2022-04-18 11:34:24 +08:00
liqipeng
f0104c0ea0
[ISSUE #8144] add volatile modifier to ServerListManager.serversFromEndpoint(2.x) (#8146)
* add volatile modifier to `ServerListManager.serversFromEndpoint`

* optimize `onReceiveChecksums` in race condition

* judge responsible server in same localAddress; add `volatile` modifier for `EnvUtil.localAddress`
2022-04-18 11:33:08 +08:00
胡俊
da563d7734
Revert "[ISSUE#6999]Logback overrides the automatic refresh of application logback . issu… (#7596)" (#8173)
This reverts commit 7bb6cf2d13.
2022-04-18 11:25:49 +08:00
lmw0509
d3264546ad
Replace redundant code with lambda expression (#8074) 2022-04-06 10:47:28 +08:00
chenhao26
b4cc3fcddb
Optimize HTTP constants (#7998)
* Optimize HTTP constants

* check nacos style

* check nacos style2

* check nacos style3

* deleet Unused constants in UtilAndComs
2022-03-25 16:05:42 +08:00
李晓双 Li Xiao Shuang
88fb26cfc6
[ISSUE #5695] Add config encrypt spi for nacos server. (#7934)
* [ISSUE#5695] Add a plugin SPI for configuration encryption and decryption for Nacos 2.0 (#6655)

* Defines the interface

* 增加aes实现

* 客户端、服务端加解密实现

* 客户端、服务端加解密实现

* fix code quality (#6727)

* [ISSUE#5695] Add a plugin SPI for configuration encryption and decryption for Nacos 2.0, EncryptedDataKey is persisted (#6740)

* Defines the interface

* 增加aes实现

* 客户端、服务端加解密实现

* 客户端、服务端加解密实现

* 秘钥持久化

* 秘钥持久化

* [ISSUE#5695] Summer2021 Cache encryptedDataKey  (#6878)

* Defines the interface

* 增加aes实现

* 客户端、服务端加解密实现

* 客户端、服务端加解密实现

* 秘钥持久化

* 秘钥持久化

* 秘钥缓存到内存中

* 解决冲突

* 修改filter继承AbstractConfigFilter (#6879)

* [ISSUE#5695] Summer2021   EncryptedDataKey is persisted to Derby (#6882)

* [ISSUE#5695] Add a plugin SPI for configuration encryption and decryption for Nacos 2.0 (#6655)

* Defines the interface

* 增加aes实现

* 客户端、服务端加解密实现

* 客户端、服务端加解密实现

* fix code quality (#6727)

* # This is a combination of 6 commits.tree cf7a399f99c4d81b8667c8de06f5ceb8c79fb6f0
parent 8024ecf31bf23a9edab416be8a3bfd1c0e48ce5e
author 李晓双 Li Xiao Shuang <644968328@qq.com> 1630028256 +0800
committer lixiaoshuang <644968328@qq.com> 1631804378 +0800

# This is a combination of 3 commits.
# This is the 1st commit message:

[ISSUE#5695] Add a plugin SPI for configuration encryption and decryption for Nacos 2.0, EncryptedDataKey is persisted (#6740)

* Defines the interface

* 增加aes实现

* 客户端、服务端加解密实现

* 客户端、服务端加解密实现

* 秘钥持久化

* 秘钥持久化
# This is the commit message #2:

[ISSUE#5695] Summer2021 Cache encryptedDataKey  (#6878)

* Defines the interface

* 增加aes实现

* 客户端、服务端加解密实现

* 客户端、服务端加解密实现

* 秘钥持久化

* 秘钥持久化

* 秘钥缓存到内存中

* 解决冲突
# This is the commit message #3:

修改filter继承AbstractConfigFilter (#6879)


# This is the commit message #6:

客户端、服务端加解密实现

* parent 8024ecf31bf23a9edab416be8a3bfd1c0e48ce5e
author 李晓双 Li Xiao Shuang <644968328@qq.com> 1630028256 +0800
committer lixiaoshuang <644968328@qq.com> 1631805204 +0800

parent 8024ecf31bf23a9edab416be8a3bfd1c0e48ce5e
author 李晓双 Li Xiao Shuang <644968328@qq.com> 1630028256 +0800
committer lixiaoshuang <644968328@qq.com> 1631804378 +0800

[ISSUE#5695] Add a plugin SPI for configuration encryption and decryption for Nacos 2.0, EncryptedDataKey is persisted (#6740)

* 配置加解密插件

* derby支持秘钥存储

* 克隆功能兼容配置加解密 (#6913)

* [ISSUE#5695] Summer2021 Import/export compatible with configuration encryption and decryption (#6956)

* 克隆功能兼容配置加解密

* 导入导出兼容配置加解密

* 秘钥base64编码、更换AES加密模式 (#6974)

* [ISSUE#5695] Summer2021 add unit test for ConfigCryptoFilter (#6991)

* add unit test for ConfigCryptoFilter

* add unit test for ConfigCryptoFilter

* [ISSUE#5695] Summer2021 add unit test for CryptoExecutor (#6990)

* add unit test for CryptoExecutor

* add Copyright

* [ISSUE#5695] Summer2021  add unit test for CryptoManager (#6989)

* add unit test for CryptoManager

* add unit test for CryptoManager

* [ISSUE#5695] Summer2021 add unit test for AesCrypto (#6988)

* add unit test for AesCrypto

* update AesCryptoTest

* Increased iv randomness

* add default Iv

* fix javadoc

* fix unit test

* defining plugin intergace

* Replace the client encryption and decryption actuator

* Replace the server encryption and decryption actuator

* add unit test

* add unit test

* remove old code

* fix NacosConfigServiceTest

* Encryption and decryption to achieve migration

Co-authored-by: 杨翊 SionYang <263976490@qq.com>
2022-03-16 10:54:11 +08:00
胡俊
2e07c6a0c1
Package scan (#7917)
* PayloadRegistry update use spi

* PayloadRegistry update use spi

* PayloadRegistry update use spi

* PayloadRegistry update use spi

* add test

* update comment

* remove code
rename code
2022-03-11 15:50:44 +08:00
胡俊
fdf90133a2
[ISSUE#7886]Feature package scan (#7895)
* for #7886

* nacos style

* nacos style

* code style

* .

* scan nacos style

* class reader

* class reader

* class reader

* class reader

* add comment

* update dependency

* update dependency

* rat update
check style update

* package change

* pdm exclude

* pdm update

* comment

* comment

* change pkg  final

* code structure update

* code style

* code style update
2022-03-08 20:11:21 +08:00
realJackSun
a4ce82221f [#7904] Bad smell code in ClientWorker.java 2022-03-08 10:43:50 +08:00
胡俊
9a26a65bc5
[ISSUE#7738]Client code should use enabled to pass parameters (#7756)
* use enabled

* add var
2022-02-16 10:25:46 +08:00
胡俊
4c45a3afd3
fix by zero error (#7724)
* fix by zero error

* fix by zero error --unit test
2022-02-07 10:38:37 +08:00
KomachiSion
32d7ce3b66 Repackage some class 2022-01-24 15:35:45 +08:00
KomachiSion
135ab364fe Move client spi to nacos-auth-plugin module 2022-01-21 15:40:02 +08:00
KomachiSion
4e98013f8e Solve conflicts. 2022-01-12 17:02:20 +08:00
KomachiSion
78de31dbdd Merge remote-tracking branch 'upstream/develop' into issue#5696-merge-develop
# Conflicts:
#	auth/src/main/java/com/alibaba/nacos/auth/common/AuthConfigs.java
#	client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java
#	client/src/main/java/com/alibaba/nacos/client/naming/NacosNamingMaintainService.java
#	client/src/main/java/com/alibaba/nacos/client/naming/remote/AbstractNamingClientProxy.java
#	client/src/main/java/com/alibaba/nacos/client/naming/remote/NamingClientProxyDelegate.java
#	client/src/test/java/com/alibaba/nacos/client/naming/remote/AbstractNamingClientProxyTest.java
2022-01-12 16:52:14 +08:00
胡俊
7bb6cf2d13
[ISSUE#6999]Logback overrides the automatic refresh of application logback . issu… (#7596)
* Logback overrides the automatic refresh of application logback . issue #6999

* Logback overrides the automatic refresh of application logback . issue #6999
2022-01-11 16:58:06 +08:00
pengten
626f79ad51
Optimize code style and fix bugs (#7469) 2022-01-09 22:28:27 +08:00
胡俊
cdd83e2117
optimize NotifySubscriberRequest (#7545) 2022-01-07 18:08:22 +08:00
胡俊
a17098df24
The configuration cannot be updated in the case of single core (#7561)
* The configuration cannot be updated in the case of single core

* client threadPool

* log

* update style
2022-01-06 16:16:56 +08:00
李晓双 Li Xiao Shuang
f5ef53ee2e
Merge pull request #7551 from KomachiSion/develop-issue#7550
[ISSUE#7550] Add judgement for is subscribe services.
2022-01-04 19:31:17 +08:00
KomachiSion
d3c76ceb0b Fix Unit test. 2022-01-04 18:04:17 +08:00