Web API: публичный Customer DTO и allowlist полей профиля - #475
Open
Ibochkarev wants to merge 2 commits into
Open
Web API: публичный Customer DTO и allowlist полей профиля#475Ibochkarev wants to merge 2 commits into
Ibochkarev wants to merge 2 commits into
Conversation
Ibochkarev
force-pushed
the
feat/issue-424-customer-public-dto
branch
from
July 29, 2026 11:31
dc9c86c to
3a7afcc
Compare
Replace blacklist-based profile updates with an explicit allowlist and serialize all Web customer responses through CustomerPublicDto.
Address #424 review findings: - Extract CustomerExtraFieldRegistry from CustomerPublicDto for the msExtraField DB lookup; CustomerPublicDto now delegates to it - fromCustomer() requires modX + ms3 (remove silent null mode that returned no extra keys) - update() supports partial updates: validate only core rules for fields present in $data instead of rejecting when any core field is missing - Replace grep-only CustomerAuthProcessorsDtoTest with a behavior test that exercises fromCustomer() serialization (extra-field allowlist + secret/system fields never leak); update ProfileQuickUpdateForbiddenTest to assert partial-update contract
Ibochkarev
force-pushed
the
feat/issue-424-customer-public-dto
branch
from
July 29, 2026 17:33
4f2314e to
bfc1865
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.
Описание
Единый публичный контракт покупателя для Web API и явный allowlist редактируемых полей вместо blacklist по fieldMeta.
CustomerPublicDto— allowlist ответа (PUBLIC_FIELDS+ activemsExtraField), core editable fields иeditableFieldKeys()с dynamic extra columnsPOST /customer/addиPUT /customer/profileпринимают только allowlist; системные/GDPR поля отклоняютсяCustomerPublicDto::fromCustomer()Closes #424
Тип изменений
Breaking: в ответах login/register/verify вместо
customer.email_verified: boolтеперьemail_verified_atв составе полного public DTO. Расширен payload (stats, timestamps) — без секретов.Связанные Issues
Closes #424
Как это было протестировано?
composer ci:php,npm run lint:ci/ GitHub Actions CI)Конфигурация тестирования:
Скриншоты (если применимо)
Чеклист
npm run lint:ciдля Vue) — Vue не затронутДополнительные заметки
msExtraFieldдляmsCustomerпопадают в public JSON и в editable allowlist (если колонка есть в map)PUT /profileпо-прежнему требует все 4 core поля; forbidden keys отсекаются до validationCustomerProfileFieldPolicyиз DTO (structural review); runtime integration tests с mock modX