Skip to content

Fix case-insensitive and YAML-colon matching in PlaintextMask#148

Open
fmount wants to merge 1 commit into
openstack-k8s-operators:mainfrom
fmount:more-hardening
Open

Fix case-insensitive and YAML-colon matching in PlaintextMask#148
fmount wants to merge 1 commit into
openstack-k8s-operators:mainfrom
fmount:more-hardening

Conversation

@fmount

@fmount fmount commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

gen_regex only matched = as the key-value separator, missing YAML-style key: value lines. _applyRegex was also case-sensitive.

  • Broaden gen_regex separator from = to [=:]
  • Add re.IGNORECASE flag in _applyRegex
  • Add tests to cover this enhancement (mixed-case keys and YAML-colon keys)

@openshift-ci openshift-ci Bot requested review from Akrog and gibizer July 6, 2026 07:41
@fmount fmount requested review from abays and stuggi and removed request for Akrog and gibizer July 6, 2026 07:41

@abays abays left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Jul 6, 2026
gen_regex only matched `=` as the key-value separator, missing
YAML-style `key: value` lines. _applyRegex was also case-sensitive,
so keys like `Password` or `PASSWORD` slipped through unmasked.

- Broaden gen_regex separator from `=` to `[=:]`
- Add re.IGNORECASE flag in _applyRegex
- Add regression tests for mixed-case keys and YAML-colon keys

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Francesco Pantano <fpantano@redhat.com>
@openshift-ci openshift-ci Bot removed the lgtm label Jul 6, 2026
@openshift-ci

openshift-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from abays. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@stuggi stuggi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants