* [ISSUE #15710] Declare the LIKE escape clause for dialects without a default escape character
Fuzzy search parameters escape the _ wildcard with a backslash, which only
works on a database treating the backslash as the default LIKE escape
character. Derby and Oracle have no such default, so the predicate matches
the backslash literally and silently returns no row.
Report the clause through the new Mapper#getLikeEscapeClause() dialect hook,
override it for Derby and Oracle, and append it to every LIKE bound to such a
parameter, in both the shared mapper defaults and the Oracle overrides. MySQL
and PostgreSQL keep an empty clause, so their SQL is unchanged.
Assisted-by: Claude Code
Signed-off-by: wushiyuanmaimob <wushiyuanwork@outlook.com>
* [ISSUE #15710] Escape the LIKE escape character in fuzzy search arguments
Declaring ESCAPE '\' on the LIKE predicates also constrains the bound
parameter: generateLikeArgument escaped the _ wildcard but left a literal
backslash in the search value untouched, so a value such as C:\path formed
the invalid escape sequence \p. Oracle rejects it with ORA-01424 and Derby
with SQLSTATE 22025, and a value such as a\_b silently kept _ as a wildcard.
Escape the escape character itself before escaping _, keeping the Config and
AI implementations consistent, and document the required order in the
datasource dialect spec.
Add a Derby test that executes the SQL generated by the mapper with the bound
parameter, since asserting the SQL text alone cannot detect an invalid escape
sequence in the argument.
Assisted-by: Claude Code
Signed-off-by: wushiyuanmaimob <wushiyuanwork@outlook.com>
---------
Signed-off-by: wushiyuanmaimob <wushiyuanwork@outlook.com>
HistoryConfigInfoMapper#getNextHistoryInfo backs the config history
detail/diff lookup for UPDATE records. It had two defects.
The interface default SQL ends with 'ORDER BY nid LIMIT 1'. LIMIT is
MySQL/PostgreSQL syntax, and HistoryConfigInfoMapperByDerby overrode the
other row-limiting queries but not this one, so Derby inherited it and
the query failed with a syntax error. Derby is the standalone default
datasource. Add the missing Derby override using FETCH FIRST 1 ROWS
ONLY, matching the existing Oracle override.
The gray filter read grayName through getContextParameter, while both
repository implementations publish it with putWhereParameter and
MapperContext keeps those maps separate. 'AND gray_name = ?' was
therefore never emitted and gray history records of one config were not
separated by gray version. Read grayName from the where parameters and
derive both the predicate and its bound parameter from a single guard,
which also removes the isBlank/isEmpty mismatch that could emit a
placeholder without its predicate.
The existing default-mapper test only passed because it wrote grayName
into both maps; it now uses the where parameters alone, as production
does.
Assisted-by: Claude Code
Signed-off-by: wushiyuanmaimob <wushiyuanwork@outlook.com>
Honor provider order before first-wins registration, align built-in plugin routers with the same conflict policy, and remove datasource fallback to an unrelated dialect.
Make standard configuration keys authoritative by presence and enable AI resource import unless explicitly disabled. Update bilingual plugin specs and tests accordingly.
Assisted-by: Claude Code
* Remove reflective EnvUtil access from visibility plugin
Assisted-by: Claude Code
* Use first-wins plugin registration and definition normalization
Assisted-by: Claude Code
Make DatabaseDialect#isDuplicateKeyException(Throwable) the single entry point for
classifying duplicate unique-key conflicts, per the direction agreed in the issue.
The interface default walks the throwable cause chain and recognizes Spring's
DuplicateKeyException, matched by class name so the datasource plugin modules keep
their Spring-free dependency footprint. This reproduces the former database-agnostic
classification as the safe baseline and deliberately does not treat a raw vendor
SQLState such as 23505 as a duplicate on its own, preserving the #15465 rethrow
contract.
ExternalConfigInfoPersistServiceImpl now delegates duplicate-key judgement to the
active dialect, and only falls back to the inline Spring DuplicateKeyException check
when no dialect can be resolved (for example before datasource plugins are loaded).
Vendor dialects can override the SPI default to additionally inspect the original
driver exception (SQLState or vendor error code) via DatabaseDialect.super.
Update the datasource dialect plugin spec (en + zh-cn) and add regression tests: the
plugin-base default rejects non-Spring exceptions and raw SQLState, and the config
module verifies the default recognizes a wrapped Spring DuplicateKeyException.
Related issue: #15468
Related PRs: #15465, #15272, #15278
Assisted-by: Claude Code
Signed-off-by: wushiyuanmaimob <wushiyuanwork@outlook.com>
* 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
Several pagination methods in ConfigInfoMapperByMySql and
ConfigTagsRelationMapperByMySql use LIMIT without ORDER BY, causing
non-deterministic results across pages. This adds ORDER BY before
LIMIT to all affected methods, consistent with other paginated methods
in the same classes. Also adds orderBy() method to WhereBuilder.
* refactor(plugin): Rename and refactor data-filter plugin to visibility plugin.
* refactor(plugin): use new visibility plugin replace old data-filter plugin.
* refactor(skills): unify skill visibility checks and improve permission.
* refactor(auth): replace DefaultAiVisibilityService with plugin-based implementation.
* fix(plugin): temporarily return true for exclusive plugin type check.
- Add download_count column to ai_resource and ai_resource_version tables (MySQL/Derby/Oracle/PostgreSQL)
- Add SkillDownloadEvent and SkillDownloadCountManager for async event-driven counting
- Accumulate counts in memory with ConcurrentHashMap+AtomicLong, flush to DB every 10s
- Use atomic SQL (download_count = download_count + N) for cluster safety
- Publish events in downloadSkillVersion (admin path) and querySkill (client path)
- Expose downloadCount in admin detail/list API response
- Support orderBy=download_count in skill list query
- Fix AiGrpcResourceParserTest: remove deleted QuerySkillRequest references
- Fix AgentSpecUtilsPropertyTest: Java 8 compatibility (String.isBlank -> trim().isEmpty())
- Fix all SQL SELECT statements to include download_count column for RowMapper consistency
* feat(ai): add AI plugin SPI for publish pipeline and resource storage
* feature(ai): implement ai resorce storage
* feature(ai): impl ai resource meta and version persistence
* feat(ai): add skill lifecycle admin APIs
* refactor(ai/skills): remove legacy skill register/update apis
* feat(ai): add skill lifecycle functions for skill operation service
* feat(ai): add skill lifecycle functions for skill operation service
* feat(ai): support embedded storage for ai resource persistence
Add embedded Derby implementations for ai_resource and ai_resource_version persistence and gate external JDBC implementations by storage mode. Also add MySQL DDL for ai_resource tables in distribution schema.
Made-with: Cursor
* refactor: update references to TrustedPostgresqlFunctionEnum and deprecate old enum
* feat: enhance config info and tags relation mappers with md5, type, c_desc fields and optimize tag filtering for PostgreSQL
* fix: align pg-schema.sql with MySQL schema definition
* test: add unit tests for PostgreSQL mappers and TrustedPostgresqlFunctionEnum
* Oracle database plugin supports
* Oracle database plugin supports
* Mark ojdbc dependency as optional and provided in case of license conflict
* 1.change dependency and schema file location
- Add 'type' and 'md5' to findConfigInfoLike4PageFetchRows in ConfigInfoMapper.
- Add 'type' and 'md5' to findConfigInfoLike4PageFetchRows in ConfigTagsRelationMapper.
Close#14484
* 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
- Restore ConfigInfoAggrMapperByMySql.java from git history
- Restore ConfigInfoAggrMapper.java from git history
- These files are required dependencies for nacos-plugin BaseConfigInfoAggrMapper but were previously deleted from nacos core
1. Implement `MySqlDatabaseDialect` and `DerbyDatabaseDialect` to unify pagination logic across datasources.
2. Register `DatabaseDialect` SPI for MySQL, Derby, and PostgreSQL.
3. Register PostgreSQL Mappers in `Mapper` SPI.
4. Add `DatabaseTypeConstant.DERBY` and `TrustedDerbyFunctionEnum` to support Derby dialect.
5. Finalize integration of PostgreSQL plugin (migrated from nacos-plugin).
* Feat support mcp registry api (#13376)
* Support tag fuzzy search (#13387)
* support tag fuzzy search
* support tag fuzzy search
* Merge pull request #13391 from luoxiner/support-mcp-multi-version
Feat Support Mcp Registry
* Add copyright for mcp-adapter pom.
* Support version in ai maintainer sdk and fix some errors when build (#13401)
* add version for ai maintainer sdk and support display mcp server config
* fix pmd errors
* fix empty endpoint
* remote publish api
* fix tag fuzzy search sql unit test (#13402)
* Fix unit test.
---------
Co-authored-by: Xin Luo <65529035+luoxiner@users.noreply.github.com>
Co-authored-by: Sunrisea <49605583+Sunrisea@users.noreply.github.com>
Co-authored-by: luoxin.luo <luoxin.luo@alibaba-inc.com>