Repository navigation
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
A Model's provider_key_ref is resolved in render.All to the ProviderKey's current display_name (render.go#L102, #L174). Assemble decides later whether that ProviderKey is served under its new name, its old name (Retained) or not at all. The two can disagree.
Reproduce (all with the aisix v1.9.0 validator)
- A, rejected rename: ProviderKey
pserved asAis renamed toB, and the change is rejected, sopkeeps serving asA. The unchanged Modelmbecomes Retained withunknown provider key "B", and a new Modelm2is Rejected, althoughpcould serve both. - C, one valid edit:
p1(A, older) is renamed toB, whichp2uses.p1winsB, andp2's fallback entry is dropped as a duplicate. Modelm2(refp2) stays served withprovider_key: B, which is nowp1's credential. - D, one rejection plus one valid rename:
p2(older) triesB→Cand is rejected, so it keepsB.p1renamesA→B, collides withp2's kept entry and keepsA. Modelm1(refp1) is Applied,Programmed=True, onprovider_key: B, which isp2's credential.
Impact
Traffic goes upstream with another ProviderKey's api_key and possibly its api_base, while status reports success. Within one namespace.
Scores
| Reproducibility | Likelihood | Severity | Existing mitigations | Detectability | Test coverage | Fix cost vs benefit |
|---|---|---|---|---|---|---|
| 10 | 3 | 6 | 2 | 3 | 2 | 6 |
Scores are out of 10. Higher is worse for likelihood and severity. Higher is better for mitigations, detectability, test coverage and cost vs benefit (10 = cheap fix, high value).
Fix
- Keep the unresolved ref in
Renderedand resolve insideAssemble, every validation round, against the name each ProviderKey is actually served under: the current name if Applied, the served name if Retained, an error carrying its reason if Rejected. - Also re-check Models that fell back to their served entry: map the old index's names back to ProviderKeys and point the retained entry at that ProviderKey's current served name, or reject it.
- Move the owner check from render into this resolver. Share it with Semantic routers with a classifier can never be accepted #12 (
semantic.classifier). - States only move Applied → Retained → Rejected, so the existing round bound still holds.
Tests to add
Cases A, C, D, plus a rename that fails at render (missing Secret key), all through gatewayValidator.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity