Aias00 opened a new issue, #6715:
URL: https://github.com/apache/shenyu/issues/6715

   - severity: Medium
   - files: 
`shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/AiProxyApiKeyController.java:75-88`;
 
`shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/AiProxyApiKeyServiceImpl.java:78-110`
   - description: In `create` (line 78), 
`selectorMapper.selectById(selectorId)` is fetched but only used to *override* 
`dto.namespaceId` when the selector exists; if `selector` is null, execution 
continues and `aiProxyApiKeyService.create(dto, selectorId)` is still called. 
The service only checks `StringUtils.isBlank(selectorId)`, never verifying the 
selector exists. Inconsistent with the `list` endpoint (line 109-112) which 
explicitly rejects a missing selector.
   - impact: Orphan AI proxy key records referencing deleted/never-existed 
selectors; `realKeyResolver` lookups return null real keys, confusing gateway 
routing of AI traffic.
   - suggested_fix: Return `AdminConstants.ID_NOT_EXIST` when `selector` is 
null (as `list` does).
   - confidence: High
   - related_existing: none.
   
   ---
   _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)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to