Skip to content

SecretScanner extra_patterns are added to the shared default patterns - #35

Merged
sergiobe-itx merged 2 commits into
InditexTech:mainfrom
Lostmanu:fix/secret-scanner-default-patterns
Nov 2, 2026
Merged

sergiobe-itx merged 2 commits into
InditexTech:mainfrom
Lostmanu:fix/secret-scanner-default-patterns

Conversation

@Lostmanu

Copy link
Copy Markdown
Contributor

Summary

SecretScanner appended extra_patterns to the shared DEFAULT_SECRET_PATTERNS list, so they leaked into every default SecretScanner. It now copies the defaults first, as PiiScanner does. Two new tests in test_scanner.py cover a default scanner created before another one with extra patterns, and the same extra pattern passed to two scanners.

Fixes #34

Checklist

Additional context

pytest in packages/cerbia-core: 792 tests pass with the change. Without it, the two new tests fail and the other 790 pass.

Signed-off-by: Manuel Beardo Campo <210421738+Lostmanu@users.noreply.github.com>
@Lostmanu
Lostmanu requested a review from a team as a code owner October 29, 2026 22:45
@signoff-validator

Copy link
Copy Markdown

Contribution License Agreement - Valid 🟢

All commits contain valid signoff. As a confirmation, remember that you are agreeing to our Contribution License Agreement.

@sergiobe-itx sergiobe-itx self-assigned this Nov 2, 2026
@sergiobe-itx sergiobe-itx added the skip-release Do not publish a release for this change. label Nov 2, 2026
@sergiobe-itx sergiobe-itx changed the title fix(core): copy the default secret patterns before adding extra patterns SecretScanner extra_patterns are added to the shared default patterns Nov 2, 2026
Signed-off-by: Sergio Bugallo Enjamio <sergiobe@inditex.com>

@m4rii0 m4rii0 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for your contribution!

@sergiobe-itx
sergiobe-itx merged commit 4ac199e into InditexTech:main Nov 2, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-release Do not publish a release for this change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SecretScanner extra_patterns are added to the shared default patterns

3 participants