* [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
* [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>
* Fix Skill storage provider routing
Honor the provider persisted with each Skill version for read and delete operations while keeping nacos_config as the legacy fallback.
Assisted-by: Claude Code
* Add global AI storage provider selection
Keep resource-specific provider properties as compatibility overrides and clarify optional storage builder discovery.
Assisted-by: Claude Code
* Keep AI resource storage routing stable
Use each persisted version provider for reads, draft replacements, and deletes, and skip existing Prompt versions before migration writes.
Assisted-by: Claude Code
* test: align AgentSpec concurrent save reflection
Pass the persisted storage provider argument when invoking the concurrent AgentSpec save helper from tests.
Assisted-by: Claude Code
* test: complete Prompt storage descriptor fixture
Include the persisted file list required by the strict storage cleanup path after rebasing the provider routing changes.
Assisted-by: Claude Code
* Fix ARD filter compatibility
* Remove ARD naming from AI search internals
* Document durable AI resource index enhancement
Assisted-by: Claude Code
* Extend AI resource index task schemas
Assisted-by: Claude Code
* Make AI resource index enhancement durable
Assisted-by: Claude Code
* Fix AI resource index task consumer injection
Assisted-by: Claude Code
* Refactor durable AI resource task model
Generalize the durable search-index task contract with versioned payload and result data while preserving lease, retry, and revision fencing semantics.
Assisted-by: Claude Code
* Update AI resource task schemas
Replace the search-index-specific task table with the generic AI resource task schema across supported databases and align Derby persistence test resources.
Assisted-by: Claude Code
* Use epoch millis for AI resource task scheduling
Assisted-by: Claude Code
* Improve AI resource index convergence
Harden task fencing, lease handling, reconciliation, vector readiness, and ARD filter compatibility.
Assisted-by: Claude Code
* fix: use latest published MCP version by default
Resolve omitted MCP versions through latestPublishedVersion so draft versions do not trigger repeated index reconciliation. Add unit and Admin API regression coverage.
Assisted-by: Claude Code
* fix: fence AI resource task leases
Preserve active leases across coalesced lifecycle schedules and use a monotonic lease token to fence stale workers from renewing, completing, retrying, or releasing newer work.
Assisted-by: Claude Code
* test: align MCP latest published version lookup
Assisted-by: Claude Code
* feat: ai-visibility grant api
* fix: add User existence verification and fix test
* fix: Modify naming to remove AI semantics
* feat: retain at most one visibility role
* feat: keep the authorization chain as identity -> role -> permission
* feat: expand 'resource' to 512
* feat: mark the new visibility APIs as ADMIN_API
* feat: remove list api
* feat: Complete the 512-character schema and upgrade delivery
* feat: Align the API contract and specifications
* feat: complete focused tests for the new authorization model
* feat: remove the grant-list-only indexes
* feat: fix md
* feat: revert the role-wide cache reload changes
* fix: add @NacosApi
* fix: codecov
* fix: add EnvUtil MockEnvironment
---------
Co-authored-by: 杨翊 SionYang <xiweng.yy@alibaba-inc.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
* [ISSUE #15475] Integrate AI resource importer plugin configuration
Unify AI resource importer builders with plugin configuration management and remove the redundant source abstraction.
Assisted-by: Claude Code
* [ISSUE #15475] Align AI importer OpenAPI error assertions
Update the focused admin and console API integration tests to match the unified plugin lookup error message.\n\nAssisted-by: Claude Code
Apply trace plugin state when dispatching events and retain disabled subscribers for runtime re-enablement. Prevent configurable visibility plugins from receiving the deprecated legacy initialization callback, while preserving compatibility for older implementations.
Assisted-by: Claude Code
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
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>
Complete unified plugin state enforcement for runtime-routed plugin families.
Add static configuration refresh snapshots, source resolver registry, restart-only field isolation, and shared plugin type capabilities before production plugins adopt PluginConfigSpec.
Assisted-by: Claude Code
* 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
Move built-in MCP registry and Skill well-known importers into a default AI importer plugin.\n\nAdd source provider SPI and nacos.plugin.ai.importer preset configuration.\n\nUpdate import plugin specs and tests.\n\nAssisted-by: Claude Code
Route missing config change source types to unknown pointcuts instead of treating them as RPC, and use remove pointcuts for delete operations.
Assisted-by: Codex
* [ISSUE #15183] Add AI resource import SPI models
Add the AI resource import plugin type, public import API DTOs, and plugin importer SPI/model contracts for source-based search, validate, and execute flows.
Assisted-by: Claude Code
* [ISSUE #15183] Refine AI resource import models
Remove the unsupported dependency import abstraction from the initial API and SPI contract, align importer models with Spotless formatting, and add JSON serialization coverage for the public import DTOs.
Assisted-by: Claude Code
- Change lineWrappingIndentation from 0 to 4 to match continuation_indentation=1
- Change arrayInitIndent from 8 to 4 to match continuation_indentation_for_array_initializer=1
- Remove all // @formatter:off/on workarounds (no longer needed)
- Re-format modules affected by continuation_indentation_for_array_initializer change
- Add checkstyle:check and spotless:check to CI check step
Signed-off-by: cxhello <caixiaohuichn@gmail.com>
DiskUtils.readFile streams the file in 4096-byte chunks and decodes each
chunk with a CharsetDecoder. After draining the chars from each chunk the
loop calls buffer.clear(). When a multi-byte UTF-8 character straddles
the 4096-byte boundary the decoder reports UNDERFLOW and leaves the
leading bytes of that character in the buffer; clear() then discards
them. The next read starts on an orphaned UTF-8 continuation byte, the
decoder reports malformed input, and the rest of the file is silently
truncated.
Concretely, a file laid out as 4094 ASCII bytes + '中' (3-byte CJK,
E4 B8 AD) + 200 ASCII bytes round-trips back as just 4094 ASCII chars
with the trailing '中' and 200 ASCII bytes lost.
Replace buffer.clear() with buffer.compact() so any unconsumed trailing
bytes survive into the next read, and finalize the stream after EOF
with decoder.decode(buffer, ..., true) + decoder.flush(charBuffer) so
the decoder also drains any state it is holding for the very last
character of the file.
The new testReadFileWithMultiByteUtf8AcrossChunkBoundary builds the
file layout above, asserts the byte indices of '中' against the buffer
boundary, and asserts the exact round-trip. It fails deterministically
on upstream/develop and passes only after the fix.
Builds on the per-call CharsetDecoder change merged in #15065.
Assisted-by: Claude Code
The previous implementation shared a single static CharsetDecoder across
all callers of DiskUtils.readFile. CharsetDecoder is documented as not
safe for concurrent use, and it also retains internal state across decode
invocations. As a result, concurrent calls (for example LocalDiskRuleStorage
loading multiple TPS rule files at once) could corrupt each other's output,
and even sequential calls could observe leftover state from a previous read.
Move the decoder into the readFile method so each call operates on a fresh,
isolated instance. Add tests covering concurrent reads of distinct files,
sequential reads on the same file, and a UTF-8 multi-byte regression.
Assisted-by: Claude Code
* feat(visibility): add support to enable or disable visibility plugin via config.
* feat(visibility): add support to enable or disable visibility plugin via config.
* 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
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.
* feat(pipeline): Update configuration format for plugin-based pipeline support
Change-Id: I8bd95ca1bd44e9c723a179293da206e0d16ce89c
* feat: Update visibility constants and improve test assertions for skill operations
Change-Id: I139d8d8f4dfb5f55cc953b10ec6db5040ddc9497
* 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 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
* 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.