-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[ISSUE #12017] Split console authentication #12474
[ISSUE #12017] Split console authentication #12474
Conversation
* Git Test
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.
It seems no relative with auth?
* Fix Git Test
* Add ApiType annotations * Update configuration file to add fields * Update console authentication status fetch * Update `application.properties` - Reuse `nacos.core.auth.enabled` and add `nacos.core.auth.console.enabled` * Update `AuthConfigs` - Modify `isAuthEnabled()` to manage plugin initialization * Update `AbstractProtocolAuthService` - Implement `isAuthEnabled()` method for `Secured` annotation and configuration-based authentication * Update `RemoteRequestAuthFilter` - Use `authConfigs.isAuthEnabled()` for initialization and `protocolAuthService.authEnabled(secured)` for authentication checks
This one is for testing commits, I'll fix this change |
@@ -57,6 +58,17 @@ public boolean enableAuth(Secured secured) { | |||
return false; | |||
} | |||
|
|||
@Override | |||
public boolean authEnabled(Secured secured) { |
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.
和上述的enableAuth区别是什么?
是不是应该放到NacosAuthPluginService的enableAuth里?
* @param secured secured information | ||
* @return {@code true} if auth is open, otherwise {@code false} | ||
*/ | ||
boolean authEnabled(Secured secured); |
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.
和上一个enable auth看起来重复,让插件开发和摸不着头脑
/** | ||
* console API. | ||
*/ | ||
ADMIN_API("ADMIN_API"), |
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.
我想了一下, 这里可能改叫CONSOLE_API比较好
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.
因为之后可能会单独出maintainer sdk访问admin api,同时拆分部署后console访问server的api可能才叫ADMIN API
所以我想目前的叫CONSOLE_API
当然之后统一改也可以
@@ -115,6 +115,10 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha | |||
} | |||
|
|||
Secured secured = method.getAnnotation(Secured.class); | |||
if (!protocolAuthService.authEnabled(secured)) { |
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.
和前面描述的一样,不再赘述
* Update the location of the authentication judgment
Please do not create a Pull Request without creating an issue first.
What is the purpose of the change
For #12017
Split console authentication.
Brief changelog
Add ApiType annotations
Update configuration file to add fields
Update console authentication status fetch
Update
application.properties
- Reusenacos.core.auth.enabled
and addnacos.core.auth.console.enabled
Update
AuthConfigs
- ModifyisAuthEnabled()
to manage plugin initializationUpdate
AbstractProtocolAuthService
- ImplementisAuthEnabled()
method forSecured
annotation and configuration-based authenticationUpdate
RemoteRequestAuthFilter
- UseauthConfigs.isAuthEnabled()
for initialization andprotocolAuthService.authEnabled(secured)
for authentication checksVerifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily:
[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.