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

feat(secret): Secret analyzer initialization using config object #2748

Closed
wants to merge 3 commits into from

Conversation

ankk13
Copy link
Contributor

@ankk13 ankk13 commented Aug 19, 2022

Description

Secret Analyzer initializes Scanner only via config file path only. This commit allows to initialize scanner if config is handy in memory

Related PRs

  • #XXX
  • #YYY

Remove this section if you don't have related PRs.

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@ankk13 ankk13 requested a review from knqyf263 as a code owner August 19, 2022 12:11
@@ -39,6 +39,7 @@ var (

type ScannerOption struct {
ConfigPath string
Config *secret.Config
}

// SecretAnalyzer is an analyzer for secrets
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can just export scanner in SecretAnalyzer. You can initialize SecretAnalyzer with your scanner rather than calling RegisterSecretAnalyzer.

Moniseeta added a commit to Moniseeta/trivy that referenced this pull request Sep 1, 2022
removed the config initialization with unit tests
@knqyf263
Copy link
Collaborator

In favor of #2835

@knqyf263 knqyf263 closed this Sep 12, 2022
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.

None yet

2 participants