54 Commits

Author SHA1 Message Date
杨翊 SionYang 605a3fd2e4 [ISSUE #14804] Add shared AI resource search APIs (#15745)
* [ISSUE #14804] Add shared AI resource search APIs

Expose generic and resource-specific client search APIs backed by the shared AI Resource Search Core, with auth routing, specifications, and integration coverage.

Assisted-by: Claude Code

* [ISSUE #14804] Cover AI search authorization scenarios

Register the generic resource search and MCP client controllers in the authorization integration-test matrix.

Assisted-by: Claude Code
2026-08-21 13:39:28 +08:00
杨翊 SionYang ba35d1fdee fix(console): forward caller identity to remote server (#15742)
Assisted-by: Claude Code
2026-08-20 19:08:07 +08:00
杨翊 SionYang 645f9a13ef Deprecate legacy plugin compatibility paths (#15614)
Continuous Integration / ci (push) Has been cancelled
Frontend Continuous Integration / frontend-ci (push) Has been cancelled
Frontend Continuous Integration / check-min-release-age (push) Has been cancelled
Assisted-by: Claude Code
2026-07-30 15:18:06 +08:00
sai 07a0ff15f8 [ISSUE #15541] Add Agentic Resource Discovery support (#15542)
* Add ARD search API contract

* Implement local ARD search service

* Add ARD search service tests

* Implement ARD P0 persistent indexing

* Add ARD PostgreSQL schema and cursor pagination

* Add ARD skill content and LLM index enhancement

* Rebuild latest ARD index on skill version changes

* Support dedicated ARD pgvector storage

# Conflicts:
#	plugin-default-impl/nacos-default-datasource-plugin/nacos-datasource-plugin-mysql/src/main/resources/META-INF/mysql-schema.sql

* Improve ARD search ranking

* Limit ARD pgvector search in SQL

* Make ARD pgvector embeddings extensible

* Enhance ARD source content for prompt and MCP

* Align ARD search protocol response

* Expose ARD resource artifact URLs

* Support ARD field path filters

* Add ARD agents endpoint

* Add ARD explore endpoint

* Add internal ARD catalog endpoint

* Add ARD catalog list explore DTOs

* Complete local ARD protocol endpoints

* Cover ARD catalog list explore artifacts

* Extract ARD index enhancement prompt

* Make ARD catalog host metadata configurable

* Add ARD vector index SPI

* Add default PostgreSQL ARD vector plugin

* Route ARD vector indexing through plugins

# Conflicts:
#	api/src/main/java/com/alibaba/nacos/api/plugin/PluginType.java

* Extract ARD index enhancement prompt

* refactor: flatten ARD enhancement search phrases

* refactor: split ARD enhancement search chunks

* feat: return complete skill packages from ARD

* test: cover ARD skill package URLs

* Add ARD well-known catalog endpoint

* Simplify ARD catalog base URL configuration

* Tighten ARD catalog base URL semantics

* Align ARD well-known catalog semantics

* Fix ARD namespace authorization parsing

* Clean up ARD index content storage

* Add ARD index backfill

* Add ARD global feature switch

* Move ARD protocol contracts to registry adaptor

* Align ARD vector plugin with unified loading

* Document ARD protocol adaptor ownership

* Decouple ARD protocol and storage concerns

* Fix AI vector plugin discovery

* Fix ARD endpoint authentication

* Fix PostgreSQL ARD vector schema isolation

* Fix ARD protocol compatibility and artifact routing

Pin the upstream ARD contract, align response and error models, and serve complete Skill artifacts from the adaptor web context.

* Move ARD discovery logic into AI module

* Make ARD index maintenance durable

Persist coalesced resource-level index tasks with leased retry, make relational and default PostgreSQL vector replacement transactional, and reconcile stale or orphaned indexes periodically.

* Fix ARD schema fixture RAT exclusion

Use a module-independent path pattern so the pinned upstream JSON Schema is excluded when RAT runs from either the repository root or the adaptor module.

* Refine ARD search architecture and compatibility

* Fix ARD release blockers

Align ARD authentication, catalog URLs and identifiers with the pinned protocol contract. Bound discovery/index queries, complete namespace catalogs, and document the three-table migration path.

* Fix ARD authentication in adaptor context

* Fix PluginType spotless formatting
2026-07-29 09:49:47 +08:00
杨翊 SionYang bd33453a99 [ISSUE #15475] Make plugin discovery conflicts deterministic (#15592)
* Remove reflective EnvUtil access from visibility plugin

Assisted-by: Claude Code

* Use first-wins plugin registration and definition normalization

Assisted-by: Claude Code
2026-07-28 12:07:09 +08:00
yijie zhao b46aae5484 [ISSUE #15510] Reject invalid credential before anonymous fallback (#15526)
* fix: reject invalid credential before anonymous fallback

* fix: harden anonymous auth fallback

* style: format identity context api

* style: format auth filter test

* style: apply spotless formatting
2026-07-22 19:31:05 +08:00
杨翊 SionYang a66d928bc6 Unify plugin configuration SPI contracts (#15555)
Assisted-by: Claude Code
2026-07-22 13:38:59 +08:00
杨翊 SionYang 30c1398ab9 [ISSUE #15475] Standardize plugin state and AI pipeline lifecycle (#15537)
Centralize plugin execution capabilities and separate core module gates from plugin state. Migrate AI pipeline services to direct PluginConfigSpec lifecycle management with unified runtime ordering and legacy configuration compatibility.

Assisted-by: Claude Code
2026-07-20 17:51:59 +08:00
杨翊 SionYang 007fe68cb2 Fix config namespace isolation for ID-based operations (#15498)
* Fix config namespace isolation for delete and export

Scope config export-by-ids and batch delete-by-ids to the requested namespace across admin, console, and maintainer SDK paths.

Update specs and IT scenario coverage for namespace-scoped storage ID operations.

Assisted-by: Claude Code

* Document config storage ID selector deprecation

Assisted-by: Claude Code

* Fix config clone namespace isolation

Ensure config clone resolves source IDs within the requested source namespace before writing to the target namespace. Update console and maintainer SDK paths plus API/SDK test specs.

Assisted-by: Claude Code

* Refine config clone service coverage

Extract shared clone logic into ConfigCloneService and move clone behavior coverage from controller tests into service-level tests.

Assisted-by: Claude Code

* Refine config clone source authorization

Add source namespace READ authorization for config clone paths and keep auth identity/resource context available for diagnostics.

Assisted-by: Claude Code

* Refresh legacy console clone namespace assets

Assisted-by: Claude Code

* Fix datasource export namespace isolation tests

* Cover datasource export namespace isolation tests

* Fix auth admin filter test header stubbing

* Stabilize clone source auth checker tests

* Apply spotless to clone auth checker
2026-07-13 15:31:00 +08:00
杨翊 SionYang 0b932e8367 Improve plugin module unit test coverage (#15219)
* Improve plugin module unit test coverage

Assisted-by: Claude Code

* Improve plugin SPI coverage

Assisted-by: Claude Code
2026-05-22 13:57:41 +08:00
杨翊 SionYang f7d86cb901 test: improve plugin module unit test coverage (#15209)
* test: improve plugin module coverage

* test: make tps metrics test timezone independent
2026-05-21 20:39:26 +08:00
cxhello f8237f314f [ISSUE #14815] build(style): apply Spotless formatting to plugin module (#15106)
Signed-off-by: cxhello <caixiaohuichn@gmail.com>
2026-05-09 17:04:55 +08:00
Sunrisea 94dcef9815 feat(auth,ai) support auth ai resource subtype parse (#14847)
* feat(auth,ai) support auth ai resource subtype parse

* fix(auth): update AiHttpResourceParserTest for aiType property

Update testGetProperties to expect 2 properties (ACTION + AI_TYPE)
after getProperties() now sets aiType based on URL path.

Add test cases for all AI resource types: a2a, skill, prompt, agentSpec.

Assisted-by: Kiro AI
2026-04-03 14:29:20 +08:00
KomachiSion e77f987774 Merge remote-tracking branch 'refs/remotes/upstream/develop' into develop-skill-pipeline-sync-develop
# Conflicts:
#	ai/src/main/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImpl.java
#	ai/src/test/java/com/alibaba/nacos/ai/service/skills/SkillOperationServiceImplTest.java
#	plugin/datasource/src/main/java/com/alibaba/nacos/plugin/datasource/constants/TableConstant.java
2026-03-26 14:06:24 +08:00
Eric Wang c87f888fc6 feat(client): add OIDC client-side authentication support via Client Credentials Flow (#14696)
- Add OidcClientAuthServiceImpl as AbstractClientAuthService SPI implementation
  - Add OidcTokenHolder for token lifecycle management with proactive refresh window (20-30s before expiry)
  - Add OidcClientContext for configuration loading and OIDC Discovery support
  - Add OidcClientConstants for client-side config key definitions
  - Extract shared protocol-level constants into OidcProtocolConstants (plugin/auth module) to be reused by both client and server
  - Migrate server-side OidcConstants usages to OidcProtocolConstants where applicable
  - Remove unused OidcSessionManager dead code
  - Register OidcClientAuthServiceImpl in SPI META-INF/services
2026-03-23 19:28:02 +08:00
杨翊 SionYang 17c68e431a Add skill updateScope console api and do some refactor for skill api and ai authentication. (#14697)
* refactor(auth): unify anonymous AI access config keys and usage.

* refactor(auth): use constant for identity ID parameter in auth plugin.

* refactor(skills): rename and refactor skill admin model classes to SkillMeta and SkillSummary.

* feat(skill): add update skill visibility scope API.
2026-03-23 15:57:57 +08:00
杨翊 SionYang 283ef5c312 Skill support data level access and visibility Phase 2. (#14672)
* feat(ai-filter): implement default AI data filter service for permission control.

* For checkstyle.
2026-03-20 16:07:10 +08:00
Eric Wang bb26607ffb [ISSUE #14077] Implement SPI-based plugin discovery and management API (#14082)
* feat(plugin): implement SPI-based plugin discovery and management API

Refactor plugin discovery to use SPI pattern and add REST API for plugin control:

SPI-based Discovery:
 - Replace hard-coded plugin discovery with PluginProvider SPI pattern
 - Add comprehensive tests for UnifiedPluginManager and PluginStatePersistence
 - Enable automatic plugin registration for better extensibility

Management API:
 - Add PluginControllerV3 with 5 endpoints (list, detail, status, config, availability)
 - Create PluginInfoVO and PluginDetailVO for API responses
 - Create PluginStatusForm and PluginConfigForm for API requests
 - Integrate plugin state checking into all plugin managers
 - Add getAllPlugins() methods to expose plugin registries
 - Fix core module dependency name for custom-environment-plugin

* fix: UT failed

* fix: UT failed

* refactor(plugin): extract PluginStatePersistence to interface-based design

* fix(plugin): remove auth plugin from critical list to allow custom auth

* feat(plugin): implement config-driven default status for exclusive plugins
2026-01-09 10:41:08 +08:00
Eric Wang 7d48d1605b [ISSUE #14048] Refactor datasource plugins structure and enhance PostgreSQL capabilities (#14056)
* feat(plugin): centralize datasource plugin management

* feat(plugin): Migrate datasource dialect and enum implementations to plugin-default-impl
 - Migrate DatabaseDialect implementations (5 files) using git mv
 - Migrate Enum classes (5 files) using git mv
 - Migrate related tests (19 files) using git mv
 - Update DatabaseDialectManager to use SPI-loaded dialects
 - Update SPI service file paths
 - Update import statements in mapper implementations
 - Preserve git history for all migrated files

* fix: Fix missing SPI registration and test compilation issues

* fix(console): decouple console module from nacos-default-auth-plugin

* feat(datasource): add PostgreSQL schema and dependency integration

- Add PostgreSQL schema file `pg-schema.sql` with initial table structures and constraints.
- Include PostgreSQL JDBC dependency in project and module `pom.xml` files.

* fix(test): resolve core-test compilation failure after auth plugin migration

* fix(test): mock MapperManager in NamespacePersistService tests

* fix(test): add test scope dependency

* feat(datasource): implement PostgreSQL datasource mappers and schema

1. Schema Support:
   - Update PostgreSQL table schema in pg-schema.sql.

2. Mapper Implementations:
   - Implement GroupCapacityMapperByPostgresql and TenantCapacityMapperByPostgresql.
   - Implement ConfigTagsRelationMapperByPostgresql with fuzzy search support.
   - Add ConfigInfoGrayMapperByPostgresql and ConfigMigrateMapperByPostgresql.
   - Register new mappers in META-INF/services SPI file.
2025-12-29 11:12:54 +08:00
icarus 7f0e9310fb 【Fix issue #13600】 auth error when non-admin users clone config (#13674)
* Fix #13600 auth error when non-admin users clone config

* Fix #13600 auth error when non-admin users clone config

* Fix #13600 auth error when non-admin users clone config

* Fix #13600 auth error when non-admin users clone config
2025-08-05 19:16:04 +08:00
杨翊 SionYang c5aebb0246 [#13445] Maintainer Client support aliyun ram auth plugin. (#13456)
* Fix naming maintainer sdk auth plugin.

* Fix config maintainer sdk auth plugin.

* Add AI builder to RequestResource.

* Set empty string replace null resource for config module.

* Set empty string replace null resource for naming module.

* Fix NPE for mcp create remote mcp server.

* Support ai mcp request aliyun ram auth.
2025-06-03 13:55:31 +08:00
杨翊 SionYang 3074951434 [ISSUE#13246] Add MCP(Model Context Protocol) Server And Support basic MCP(Model Context Protocol) operation console apis to Nacos. (#13247)
* Add AI MCP console api.

* Add AI MCP resource parser.

* Add mcp server console api inner implementation without tool operation.

* Add endpoint Specification for mcp api.

* Abstract some remote relative server spec into McpServerRemoteServiceConfig.

* Support handle mcp server tool.

* Support handle mcp server endpoint and fix some tools bug.
2025-04-14 11:41:14 +08:00
杨翊 SionYang c3b79cf15a V3.0 develop auth plugin (#13215)
* Change auth plugin return boolean to AuthResult.

* set AuthContext result as AuthResult.

* Refactor to remove using AuthConfigs, replaced with NacosAuthConfig.

* Refactor to remove using AuthConfigs, replaced with NacosAuthConfig.

* Move AuthConfigs to default auth plugin impl module.
2025-03-31 16:10:01 +08:00
杨翊 SionYang cf691fa06c Change some console api from public api to identity check only api. (#13208) 2025-03-26 14:34:30 +08:00
杨翊 SionYang 6ccdd58e5e Specified nacos-client and dependencies to java 8. (#13052) 2025-01-17 17:08:54 +08:00
杨翊 SionYang 1775037721 Fix some 3.0 admin api problem. (#13049)
* Fix v3 admin api list instances problem.

* Fix admin api auth failed.
2025-01-17 11:42:37 +08:00
shalk(xiao kun) cd7de01ffc [ISSUE #12962]Feat develop 3.0 dlock (#12981)
* add simple Distributed lock

# Conflicts:
#	pom.xml

* add lock unit test.

* add lock unit test.

* add lock unit test.

* update lock instance

* add javadoc

* add nacoslock snapshot.

* add property.

* update property.

* add lock auth.

* fix lock auth.

* add lockInfo DTO.

* improve log and memory lack.

* merge 'develop' into lock

* add lock query count and rt metrics

* fix compile and test

---------

Co-authored-by: 985492783 <985492783@qq.com>
2025-01-02 12:00:39 +08:00
杨翊 SionYang 05362b0b90 V3.0 develop starting listening enhance & fix console auth invalid problem. (#13001)
* Enhance StartingApplicationListener to reduce duplicate operation.

* Fix console auth invalid problem.
2024-12-30 17:51:49 +08:00
KomachiSion 6f3940735a Merge remote-tracking branch 'refs/remotes/upstream/develop' into v3.0-develop-sync-develop
# Conflicts:
#	config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigQueryRequestHandler.java
#	config/src/test/java/com/alibaba/nacos/config/server/controller/v2/ConfigControllerV2Test.java
#	config/src/test/java/com/alibaba/nacos/config/server/remote/ConfigQueryRequestHandlerTest.java
#	console-ui/src/pages/ConfigurationManagement/ConfigurationManagement/ConfigurationManagement.js
#	console/src/main/resources/static/console-ui/public/js/main.js
#	console/src/main/resources/static/index.html
#	console/src/main/resources/static/js/main.js
2024-12-09 14:43:41 +08:00
misakacoder 7651eb3915 [ISSUE #12257] client auth plugin support refreshing server list (#12920) 2024-12-05 17:21:35 +08:00
KomachiSion dccecd3b76 Merge remote-tracking branch 'refs/remotes/upstream/develop' into v3.0-develop-sync-develop
# Conflicts:
#	console/src/main/resources/application.properties
#	core/src/main/java/com/alibaba/nacos/core/auth/AuthFilter.java
2024-11-21 15:19:08 +08:00
lucky8987 fb68b7e54c [ISSUE #12719] refresh the client's access token (#12765)
* [ISSUE #12719] Interval refresh the client's access token.

* Safely obtaining LoginIdentityContext
2024-11-15 16:39:36 +08:00
杨翊 SionYang d75b1a2a9a [Refactor] Deprecated old api and default disabled old console api. (#12830)
* Add old API Compatibility annotation logic and control namespace api.

* Add Compatibility annotation for old console module API.

* Add Compatibility annotation for old core module API.

* Add Compatibility annotation for old naming module API.

* Add Compatibility annotation for old config module API.

* Add Compatibility annotation for old default auth plugin module API.

* Add api compatibility configuration to application.properties.

* Add unit test for compatibility.
2024-11-07 10:34:57 +08:00
张煜坤 59858d1ebe [ISSUE #12017] Split console authentication (#12474)
* [ISSUE #12017] Git Test

* Git Test

* [ISSUE #12017] Fix Git Test

* Fix Git Test

* [ISSUE #12017] Splitting server and console authentication

* 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

* [ISSUE #12017] Update the location of the authentication judgment

* Update the location of the authentication judgment
2024-08-27 15:59:37 +08:00
张煜坤 95e9a22f2c [ISSUE #12017] Add console backend configuration handling (#12420)
* 提交测试

* [ISSUE #12017] Add console backend configuration handling with proxy and handler layers

* Add ConfigHandler interface for defining configuration operations

* Add ConfigInnerHandler to handle internal configuration logic

* Add ConfigProxy to delegate configuration tasks based on deployment type

* Add ConfigController to utilize ConfigProxy for configuration operations

* Update ConsoleConfig to get development type

* [ISSUE #12017] Fix checkstyle format

* Fix checkstyle format

* Add configuration file fields

* [ISSUE #12017] Update ConsoleConfigController route

* Update ConsoleConfigController route

* [ISSUE #12017] Fix CI PMD violation

* Delete unnecessary comments

* [ISSUE #12017] Update ConsoleConfigController return format

* Update ConsoleConfigController return format

* [ISSUE #12017] Update ConsoleConfigController publishConfig

* Update ConsoleConfigController publishConfig

* [ISSUE #12017] Updated the backend of the console's config section

* Added parameter validation and return value encapsulation to the Controller section

* Put business operations into the handler layer

* A total of 9 APIs are involved in the config section.

* [ISSUE #12017] Updating the config section backend methods

* Updating the config section backend methods

* [ISSUE #12017] Add unit tests for the config section

* Add unit tests for the config section

* Update uri of query method

* [ISSUE #12017] Delete redundant error codes

* Delete redundant error codes

---------

Co-authored-by: rickonzhang <2239164929@qq.com>
2024-08-21 13:53:08 +08:00
shalk(xiao kun) 21bfac76e7 upgrade module naocs-plugin from junit4 to junit5 (#12229) 2024-06-17 14:08:09 +08:00
hth 992f10a1d6 [ISSUE #11957] AuthModule add admin exist (#12066)
* AuthModule add admin exist

* test fix

* fix state

* add state cache

* rename to auth_admin_request

* test fix

* auth_admin_request default value fix

* fix admin request
2024-05-24 10:14:40 +08:00
杨翊 SionYang b3b5236cd4 Develop synced from 2.2.2 (#10307)
* Fix dynamic change token to illegal value will use old token.

* Add description in pom for release.

* Upgrade to 2.2.2

* Upgrade to 2.3.0-SNAPSHOT
2023-04-11 17:34:06 +08:00
杨翊 SionYang 5fffde5bde [ISSUE#10153] Add auth state into /state api and add announcement api. (#10203)
* Add ModuleState and use ModuleState replace ServerStateController.

* Add AuthModuleStateBuilder

* state接口使用ModuleState.

* Add announcement api.

* skip rat scan for announcement.conf

* default plugin open login page when auth.enabled=true.
2023-03-27 19:00:22 +08:00
云野 332dc1d348 fix #9819 (#9850) 2023-01-28 10:35:57 +08:00
gongzhongqiang 708387c277 fix:replace nacos website url to https. (#9797) 2023-01-10 09:47:52 +08:00
hth 0e346f0024 Code optimization, remove useless code. (#9620)
* Code optimization, remove useless code.

* code optimization
2022-11-25 14:50:44 +08:00
KomachiSion e6d2c0d70b Add UT for nacos-auth-plugin module 2022-07-08 11:45:49 +08:00
郭江富 9b077d4656 For #8479, Fix the problem that some singleton classes construction method not private (#8508) 2022-06-07 15:35:03 +08:00
onewe 767238ef59 [ISSUE #8214] Add ldap auth plugin (#8216)
* [ISSUE #8214] Add ldap auth plugin

- move the config of ldap from NacosAuthConfig to LdapAuthConfig

Close #8214

* [ISSUE #8214] Resolve CI error

* [ISSUE #8214] The constants of Ldap move to the plugin-impl module
2022-04-25 18:02:13 +08:00
KomachiSion 7623bb82b2 Add requestClass to resource properties for grpc resource parser. 2022-03-23 11:47:54 +08:00
杨翊 SionYang 47506c57ab [ISSUE#5696] Secured annotation add tags field. (#7878)
* Add tags in Secured and inject tags into resource properties.

* For checkstyle.
2022-03-03 15:20:27 +08:00
KomachiSion eeb5268282 auth plugin add enableAuth method to switch auth more precisely. 2022-02-15 14:21:31 +08:00
杨翊 SionYang 64dcc0ed0a [ISSUE#5696] IdentityContext build from resource and remote ip. (#7745)
* validateIdentity add Resource input for extension.

* IdentityContext parse remoteIp.
2022-02-09 17:57:39 +08:00
KomachiSion 49d19b17b0 Fix unit test. 2022-01-26 15:21:02 +08:00