Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable skipping of particular key IDs #930

Merged
merged 2 commits into from Nov 18, 2022
Merged

Conversation

dustin-decker
Copy link
Contributor

@dustin-decker dustin-decker commented Nov 18, 2022

Ideally we would have separate detect+verify calls to apply this logic, but we don't, and the use case is fairly limited, so just configuring it at initialization time right now.
Another option is just to run this detector twice with verify=false and verify=true.

@dustin-decker dustin-decker requested review from a team as code owners November 18, 2022 16:44
@@ -72,6 +97,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
resIDMatch := strings.TrimSpace(idMatch[1])

if s.skipIDs != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit (optional): I think s.skipIDs is always non-nil since it's initialized in New()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's probably not needed now since I made the struct not exported.

@dustin-decker dustin-decker merged commit b18edef into main Nov 18, 2022
@dustin-decker dustin-decker deleted the OC-169-skip-tokens branch November 18, 2022 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants