[BUG] AppAuthServiceImpl.updateDetail rebuilds auth paths with a stale appName from the first old path
- Dominant language
- Java
- Stars
- 8.8k
- Forks
- 3.1k
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 85
Description
## Description
When rebuilding auth paths, the code derives a single `appName` from the *first* old path (`oldAuthPathDOList.stream().findFirst().map(AuthPathDO::getAppName).orElse(StringUtils.EMPTY)`) and applies it to every new `AuthPathDO.create(dto.getPath(), id, appName)`, discarding `dto.getAppName()`. If the auth previously had `open=false` (no paths stored), `appName` resolves to `""`, so all newly-added paths get `appName=""`. The sibling `updateDetailPath` (line 229) does it correctly: `AuthPathDO.create(dto.getPath(), id, dto.getAppName())`.
## Location
```
shenyu-admin/.../service/impl/AppAuthServiceImpl.java:197-204
sibling updateDetailPath at :229
```
## Impact
Path `appName` silently lost/emptied; downstream gateway routing/visibility keyed on `appName` breaks.
## Suggested fix
Use `dto.getAppName()` per path, exactly as `updateDetailPath` does.
## Related existing issue(s)
None
_Identified during the 2026-08-02 audit; full list in [`docs/issue-candidates-2026-08-02.md`](docs/issue-candidates-2026-08-02.md)._
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in shenyu-admin/.../service/impl/AppAuthServiceImpl.java around lines 197-204 and compare updateDetail with the sibling updateDetailPath at line 229. Trace how paths are rebuilt for both existing and newly added auth paths, then verify that each rebuilt path preserves its DTO appName, including when no old paths exist.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100