Выравнивание ACL каталога на Fenom и hardening токенов - #757
Open
Ibochkarev wants to merge 3 commits into
Open
Ibochkarev wants to merge 3 commits into
Ibochkarev wants to merge 3 commits into
Conversation
Member-aware resource-group visibility for storefront snippets matches Web API, revoked session tokens are not reused, query-string ms3_token no longer elevates ACL, reset denies inactive accounts, and unsafe snippet sortby parts are dropped.
Replace ?? on $modx->resource with isset so nullCoalesce.initializedProperty does not fire on the typed modx property.
PHPStan flags isset()/?? on CatalogResourceGroupVisibility::$modx. Read resource into a local and guard with is_object instead.
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.
Описание
После v1.13.0-beta1 сниппеты витрины оставались на анонимном RG-гейте, а Web API уже поднимал member-каталог.
token/getотдавал отозванный токен из сессии,ResetPasswordменял пароль inactive-клиенту, catalog API принималms3_tokenиз query, а&sortby=на сниппете мог уходить в ORDER BY без whitelist.Этот PR выравнивает Fenom с Web API через
buildWhereFragmentForRequest/isVisibleForRequest, валидирует session-токен против БД, вешает TokenMiddleware наtoken/get, закрывает query-token elevation, проверяетisPasswordResetDeniedна reset, дропает небезопасные части sortby до inject menuindex/options, инвалидирует facet/page ACL cache при смене групп. Для member-запросов страница получаетcacheable=0, чтобы HTML не попал в общий ключ кэша ресурса.Тип изменений
Связанные Issues
Closes #755
Как это было протестировано?
composer ci:php/composer test,npm run lint:ci,composer stan/ GitHub Actions CI)Конфигурация тестирования:
fix/issue-755-catalog-acl-tokens(beta)Скриншоты (если применимо)
Не применимо (API / сниппеты / сервисы).
Чеклист
composer stan/ CI jobPHPStan)npm run lint:ciдля Vue)Дополнительные заметки
[[!ms3_products]]/[[!ms3_gallery]]при member RG ACL (описано в setting lexicon).