fix(api): stop loading storefront routes via manager connector#401
Open
Ibochkarev wants to merge 4 commits into
Open
fix(api): stop loading storefront routes via manager connector#401Ibochkarev wants to merge 4 commits into
Ibochkarev wants to merge 4 commits into
Conversation
Index and Router now share manager-only route loading so /api/v1 is served only through api.php, not connector.php with TokenMiddleware.
Collapse ManagerConnectorRouteLoader into Router::loadManagerRoutes() and loadWebRoutes() with testable route plans, removing path-policy drift.
Align storefront 404 and other early failures with http_response_code, not only the JSON code field.
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.
Описание
Processors\Api\Index(Vue Manager черезconnector.php) подключалweb.phpиms3.routes.d/web/. Storefront/api/v1/*шёл через TokenMiddleware без mgr Auth / PermissionMiddleware — шире, чем уProcessors\Api\Router.Index и Router грузят только manager-роуты через
Router::loadManagerRoutes(). Запросы сroute=/api/v1…отклоняются до dispatch (Router::isStorefrontRoute()). Storefront —api.php+Router::loadWebRoutes().Тип изменений
Связанные Issues
Closes #384
Как это было протестировано?
Конфигурация тестирования:
fix/issue-384-index-manager-routes-onlyКоманды (exit 0):
php -lна затронутых PHPphp tests/RouterRoutePlansTest.php— behavioral:managerRoutePlan/webRoutePlandisjoint, storefront detect, wiringtests/*.phpРучной сценарий
connector.php?route=/api/v1/cart/getна стенде не гоняли.Скриншоты (если применимо)
Чеклист
Дополнительные заметки
Router::managerRoutePlan()/webRoutePlan()— один source of truth.ManagerConnectorRouteLoaderудалён;forbiddenPathSuffixesне нужен (positive allowlist в plan)./api/v1/*, ответ 404 с текстом проapi.php.