Skip to content

[INS-228] Add ignorePattern configuration support to Postgres and Sqlserver detectors#4612

Merged
mustansir14 merged 3 commits intotrufflesecurity:mainfrom
mustansir14:INS-228-Add-ignorePattern-configuration-support-to-Postgres-and-SQLServer-detectors
Feb 4, 2026
Merged

[INS-228] Add ignorePattern configuration support to Postgres and Sqlserver detectors#4612
mustansir14 merged 3 commits intotrufflesecurity:mainfrom
mustansir14:INS-228-Add-ignorePattern-configuration-support-to-Postgres-and-SQLServer-detectors

Conversation

@mustansir14
Copy link
Copy Markdown
Contributor

Description:

This PR adds ignorePattern configuration support to the Postgres and Sqlserver detectors. It closely follows the implementation for JDBC detector

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@mustansir14 mustansir14 requested a review from a team December 22, 2025 07:56
@mustansir14 mustansir14 requested a review from a team as a code owner December 22, 2025 07:56
Copy link
Copy Markdown
Contributor

@camgunz camgunz left a comment

Choose a reason for hiding this comment

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

I see that a couple other detectors have New methods, but I can't find where that's called. Do you know where that is?

@mustansir14
Copy link
Copy Markdown
Contributor Author

I see that a couple other detectors have New methods, but I can't find where that's called. Do you know where that is?

Not really. My assumption was that enterprise calls it at some point, but I guess that's not the case?

As mentioned in the description, I closely followed JDBC detector's implementation here, which also has this New method.

@camgunz
Copy link
Copy Markdown
Contributor

camgunz commented Jan 16, 2026

I found it; you're right it's in EE.

Copy link
Copy Markdown
Contributor

@camgunz camgunz left a comment

Choose a reason for hiding this comment

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

This looks good! I just want to make sure this works OK if we don't call .New, because that's a separate change we'll have to make in EE, so the change I'm requesting here is to add a couple tests where we don't call .New and things work OK.

@mustansir14
Copy link
Copy Markdown
Contributor Author

mustansir14 commented Jan 19, 2026

This looks good! I just want to make sure this works OK if we don't call .New, because that's a separate change we'll have to make in EE, so the change I'm requesting here is to add a couple tests where we don't call .New and things work OK.

I have added tests for SqlServer that don't call New and directly create the detector. For Postgres, these tests already exist.

@mustansir14 mustansir14 requested a review from camgunz January 19, 2026 09:57
@mustansir14 mustansir14 merged commit 7f4e37d into trufflesecurity:main Feb 4, 2026
14 checks passed
zacharyyun pushed a commit to zacharyyun/trufflehog that referenced this pull request Feb 5, 2026
…server detectors (trufflesecurity#4612)

* add ignorePattern configuration support to postgres and sqlserver detectors

* add test for sqlserver detector that doesn't use New
peterfraedrich pushed a commit to peterfraedrich/trufflehog that referenced this pull request Mar 15, 2026
…server detectors (trufflesecurity#4612)

* add ignorePattern configuration support to postgres and sqlserver detectors

* add test for sqlserver detector that doesn't use New
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.

3 participants