-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Implement #2099,添加apollo-client的身份认证功能及accesskey管理功能 #2828
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2828 +/- ##
============================================
+ Coverage 50.4% 58.94% +8.53%
+ Complexity 2083 1219 -864
============================================
Files 414 201 -213
Lines 12672 6084 -6588
Branches 1297 649 -648
============================================
- Hits 6387 3586 -2801
+ Misses 5831 2227 -3604
+ Partials 454 271 -183
Continue to review full report at Codecov.
|
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.
This feature looks great! I left some comments above, please take a look.
Besides, we need to at least provide some unit tests for core modules like apollo-core
, apollo-client
and apollo-configservice
, so please take some time to add ut for changes in RemoteConfigLongPollService
, RemoteConfigRepository
, DefaultApplicationProvider
, HmacSha1Utils
, Signature
, HttpUtil
, AccessFilter
, AccessKeyUtil
, AccessKeyServiceWithCache
, etc so that we could ensure their logic correctness in the future.
...lo-portal/src/main/java/com/ctrip/framework/apollo/portal/component/PermissionValidator.java
Outdated
Show resolved
Hide resolved
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/AccessKeyService.java
Outdated
Show resolved
Hide resolved
...onfigservice/src/main/java/com/ctrip/framework/apollo/configservice/filter/AccessFilter.java
Outdated
Show resolved
Hide resolved
bc72383
to
4bfb0d5
Compare
79b01a4
to
57b28fa
Compare
@nobodyiam Hi, Song. Thank you for your review and for some advice. I have resolved some problems that you mentioned above, and this PR has some changes as follows:
Please take a look. Preview |
apollo-biz/src/test/java/com/ctrip/framework/apollo/biz/repository/AccessKeyRepositoryTest.java
Outdated
Show resolved
Hide resolved
...ient/src/test/java/com/ctrip/framework/apollo/internals/RemoteConfigLongPollServiceTest.java
Show resolved
Hide resolved
...lo-client/src/test/java/com/ctrip/framework/apollo/internals/RemoteConfigRepositoryTest.java
Outdated
Show resolved
Hide resolved
...java/com/ctrip/framework/apollo/portal/spi/defaultimpl/DefaultRoleInitializationService.java
Outdated
Show resolved
Hide resolved
184b1d0
to
3574bc4
Compare
@nobodyiam I have fixed the problems above, the changes are as follow:
|
I have tested in my local environment and it looked great! However, it seems it will take up to 1 minute to take effect after I enable/disable the access key. It may be a problem in some situations. Can we change the implementation of |
Yes, the cache is refreshed every minute by default. In my opinion, I don't think it is a problem because we don't change the secret often. Maybe you can tell me more details about this in some situations.
Do you mean to change the default |
Suppose the user enable the secret and just to find the applications printing error logs (because of no secret), so he decides to disable the secret temporarily. In this situation, he has to wait for up to 1 minute to see the effect, which I think will confuse the user. What I suggest is to change the implementation, e.g. find the new/updated access key by DataChange_LastTime, I think this can solve the problem. |
I have considered this implementation before, but the deletion of the access key will still take effect one minute by default. It is indeed better to use Okay, I will change the implementation this week. |
3574bc4
to
205f18a
Compare
Codecov Report
@@ Coverage Diff @@
## master #2828 +/- ##
============================================
+ Coverage 50.36% 50.64% +0.28%
- Complexity 2083 2147 +64
============================================
Files 414 425 +11
Lines 12682 13055 +373
Branches 1297 1337 +40
============================================
+ Hits 6387 6612 +225
- Misses 5841 5974 +133
- Partials 454 469 +15
Continue to review full report at Codecov.
|
205f18a
to
e4b9e13
Compare
apollo-biz/src/test/java/com/ctrip/framework/apollo/biz/repository/AccessKeyRepositoryTest.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/ctrip/framework/apollo/configservice/service/AccessKeyServiceWithCache.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/ctrip/framework/apollo/configservice/service/AccessKeyServiceWithCache.java
Outdated
Show resolved
Hide resolved
e4b9e13
to
ea1e9d9
Compare
...rc/main/java/com/ctrip/framework/apollo/configservice/service/AccessKeyServiceWithCache.java
Show resolved
Hide resolved
ea1e9d9
to
e5c479e
Compare
I have already solved all the problems you mentioned. If there are other problems, I will be happy to solve them.🙂 Happy New Year! 🎉 |
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
What's the purpose of this PR
Which issue(s) this PR fixes:
Implement #2099
Brief changelog
apollo-client
apollo.accesskey.secret
,用来做访问apollo对密钥Authorization
,Timestamp
apollo-configservice
ApolloConfigDB
添加新表AccessKey
apollo-portal & apollo-adminservice
密钥管理
功能insert select
清洗数据Featrue Preview
项目管理员可以看到
管理密钥
对菜单为每个项目配置密钥,每个环境密钥不同。选择环境添加后自动生成,默认是禁用的
Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean test
to make sure this pull request doesn't break anything.