Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthrough
ChangesSetting clean-text validation
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Merge Risk: ⚪ Minimal · up to The change adds the intended clean-text enforcement for eligible settings while preserving documented exclusions, with no established merge blocker. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
4c6526d to
eb619b7
Compare
|
❌ Test Results - FAILEDSummary
Pass Rate: 91.0% ❌ Failed Tests
|



SUMMARY
Apply django-ansible-base
CleanTextMixinvalidation to settings category PATCH/PUT viaSettingSingletonSerializer, closing a gap where dynamic settings fields were not covered by the same unsafe-text checks used elsewhere in the API.PlainSerializerCleanTextMixinonSettingSingletonSerializerso top-levelCharFieldsettings from the settings registry are validated whenCLEAN_TEXT_ENABLEDis on.Meta.modelstand-ins (_SettingSingletonFakeModel/_SettingSingletonFakeOpts) so audit logging and OPTIONS metadata (get_field_info) haveapp_label/object_namewithout introspecting a real Django model.CUSTOM_LOGIN_INFO(HTML),CUSTOM_LOGO(data:URIs), and all encrypted settings (passwords, tokens, PEMs).validate()so category / global registry validators run first, thensuper().validate()chains intoCleanTextMixin(previously categoryallvalidation returned early and skipped the mixin).Known limitation:
PlainSerializerCleanTextMixinonly discovers top-levelCharFieldsettings; string values nested inListField/DictFieldsettings are not validated by this path.Related JIRA: AAP-78694
ISSUE TYPE
COMPONENT NAME
STEPS TO REPRODUCE AND EXTRA INFO
With clean text enforcement enabled (
ansible_base.lib.serializers.mixins.get_settingreturning true for the clean-text flag), PATCH a registeredCharFieldsetting under a category singleton endpoint with unsafe markup (e.g.<script>x</script>). Before this change the request could succeed; after, the API returns400with field errors.Encrypted settings and
CUSTOM_LOGIN_INFOremain unchanged when sent values that would fail clean-text rules.Functional tests added in
awx/conf/tests/functional/test_api.py:test_setting_singleton_rejects_unsafe_char_fieldtest_setting_singleton_skips_encrypted_fieldstest_setting_singleton_skips_custom_login_info_htmlSummary by CodeRabbit