shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

[BUG] Administrator namespace-list requests ignore the name filter

Open Aias00 opened this issue 1 month ago • 2 comments

Current behavior

GET /namespace/list accepts a name parameter and forwards it to NamespaceServiceImpl.list(name). When SessionUtil.isAdmin() is true, that method uses namespaceMapper.selectAll() and never applies name. Non-admin users take the separate selectByNamespaceIdsAndName(namespaceIds, name) path, which does filter.

Location

Trigger / expected result

Create namespaces with distinguishable names, then as an administrator request /namespace/list?name=foo. The result should follow the endpoint's name-filter semantics and contain matching namespaces only. Currently all namespaces are returned. This is the non-paginated /list endpoint; the separate paginated query is not the claim.

Impact / evidence

P3 / Low; high confidence, source confirmed. Administrator search results ignore the requested filter. Two isolated reviewers independently traced the controller and service branches; no deployed API request was executed.

Suggested fix

Apply the same name-filter semantics to the administrator's all-namespace scope. Keep null/blank handling consistent with the non-admin branch.

Related existing work

No matching title in the complete issue baseline or live namespace/name-filter search. #6614 concerns namespace-plugin enabled mapping and #6870 concerns namespace-user insertion, not this endpoint's search behavior.

Reviewed revision

Apache ShenYu 2.7.2-SNAPSHOT, master@66d7d954ca37d651a5ad916f988a8081157a7ab4. This repository review excludes unit-test and CI issue categories.

Aias00 avatar Oct 17 '26 05:10 Aias00

I'd like to work on this issue. I plan to preserve the existing name-filter semantics for administrators and add regression tests for filtering and namespace permissions.

Neymar-10-JR avatar Oct 17 '26 07:10 Neymar-10-JR

I'd like to work on this issue. I plan to preserve the existing name-filter semantics for administrators and add regression tests for filtering and namespace permissions.

comment /assign

Aias00 avatar Oct 17 '26 07:10 Aias00