[BUG] auth_path mapper queries non-existent namespace_id column (broken if invoked)
- Dominant language
- Java
- Stars
- 8.8k
- Forks
- 3.1k
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 85
Description
- severity: Medium
- files: `shenyu-admin/src/main/resources/mappers/auth-path-sqlmap.xml:48-63`; `shenyu-admin/src/main/resources/sql-script/h2/schema.sql:211-220`; `shenyu-admin/src/main/java/org/apache/shenyu/admin/mapper/AuthPathMapper.java:89,97`
- description: `findByNamespaceId` / `findByNamespaceIds` issue `WHERE namespace_id = #{...}`, but the `auth_path` table definition in the shipped H2 schema has no `namespace_id` column (columns: id, auth_id, app_name, path, enabled, date_created, date_updated). The `Base_Column_List`, resultMap, `save`, and `batchSave` also never reference namespace_id. The mapper methods have no Java callers (AppAuthServiceImpl resolves paths via `findByAuthIdList`), so this is latent.
- impact: Runtime SQL failure if the methods are ever wired up; indicates auth_path was never namespace-ported consistently.
- suggested_fix: Either drop the methods, or add a real `namespace_id` column to the `auth_path` schema and populate it on `save`/`batchSave`.
- confidence: High
- related_existing: none. Distinct from #6161 (Oracle schema DDL).
---
_Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.md)._
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with auth-path-sqlmap.xml, schema.sql, and AuthPathMapper.java at the listed locations; compare the namespace-based methods with the table definition and existing save paths. Check AppAuthServiceImpl and its findByAuthIdList usage before choosing whether the methods should be removed or namespace_id should be added consistently. Done means the mapper methods no longer issue invalid SQL and the schema, result mapping, and save operations agree.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100