fix(api): auto-mint guest token for cart/get; sync publicRoutes; lexicon Web errors#440
Open
Ibochkarev wants to merge 2 commits into
Open
fix(api): auto-mint guest token for cart/get; sync publicRoutes; lexicon Web errors#440Ibochkarev wants to merge 2 commits into
Ibochkarev wants to merge 2 commits into
Conversation
Remove cart/get from publicRoutes so TokenMiddleware mints like cart/add; sync product/get/ prefixes; keep machine-stable token error keys for ApiClient.
Ibochkarev
force-pushed
the
fix/issue-408-cart-get-public-routes
branch
from
July 24, 2026 02:17
7f88383 to
f71eccc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Описание
Guest
GET /api/v1/cart/getотдавал 401: роут числился вpublicRoutes, поэтомуTokenMiddlewareне минтил анонимный токен, аCartController::get()его требовал. Убрали/api/v1/cart/getиз public — auto-mint как уcart/add. ПрефиксыpublicRoutesприведены к реальным паттернам (/api/v1/product/get/и др.). В Cart/Order ошибки и success remove — через лексикон; в middleware для token-ошибок остаются сырые ключиms3_err_token_*/ms3_customer_err_token_create(контрактApiClient.isTokenError).Тип изменений
Связанные Issues
Closes #408
Как это было протестировано?
Локальный CI-гейт (без MODX/MySQL), тот же набор что в
.github/workflows/ci.yml:Red-green: временно вернуть
/api/v1/cart/getвpublicRoutes→TokenMiddlewarePublicRoutesTestexit 1; после отката → exit 0.Vue не затронут —
npm run lint:ciне гоняли.composer ci:php, GitHub Actions CI)Конфигурация тестирования:
fix/issue-408-cart-get-public-routesСкриншоты (если применимо)
n/a
Чеклист
npm run lint:ciдля Vue)Дополнительные заметки
Вне scope: query-style
product/get&id=(см. #333); stubcustomer/token/refresh(см. #351); полный проход всех Web-контроллеров на литералы.Review loop: один fix — вернули сырые token-ключи в middleware после замечания про
ApiClient; inject session token в$_REQUESTпри early-return поcustomer_id.