Skip to content

[AAP-78702] Add CleanTextMixin to serializers - #1660

Draft
daphnemaeve wants to merge 6 commits into
ansible:mainfrom
daphnemaeve:aap-78702-add-mixin-to-serializers
Draft

[AAP-78702] Add CleanTextMixin to serializers#1660
daphnemaeve wants to merge 6 commits into
ansible:mainfrom
daphnemaeve:aap-78702-add-mixin-to-serializers

Conversation

@daphnemaeve

@daphnemaeve daphnemaeve commented Aug 26, 2026

Copy link
Copy Markdown

Jira ticket: https://redhat.atlassian.net/browse/AAP-78702

Applies CleanTextMixin (from django-ansible-base) to EDA API serializers so that free-text input (name, description, and similar CharField/TextField values) is validated against the shared allowlist/blocklist rules before being persisted

Wires the mixin into the write-path serializers across activation, credential_input_source, credential_type, decision_environment, eda_credential, event_stream, organization, project, team, and user. Each validate() override now chains to super().validate(...) so the mixin's checks actually run. Fields that legitimately contain non-plain-text content (e.g. extra_var/injectors Jinja2 templates, inputs/metadata credential payloads, token secrets) are excluded via excluded_fields so they aren't rejected as unsafe.

ATF tests: https://gitlab.cee.redhat.com/ansible/testing/eda-test-suite/-/merge_requests/142

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant