Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Remove proto (#3489)
Bill Richabecab0d8fb9
diff --git a/pkg/analyzer/analyzers/airbrake/airbrake.go b/pkg/analyzer/analyzers/airbrake/airbrake.goindex 5575541e1..e02d40e93 100644--- a/pkg/analyzer/analyzers/airbrake/airbrake.go+++ b/pkg/analyzer/analyzers/airbrake/airbrake.go@@ -11,7 +11,6 @@ import ("github.com/jedib0t/go-pretty/table""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -21,7 +20,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_Airbrake }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeAirbrake }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {info, err := AnalyzePermissions(a.Cfg, credInfo["key"])diff --git a/pkg/analyzer/analyzers/analyzers.go b/pkg/analyzer/analyzers/analyzers.goindex f897f4fe2..06eea241f 100644--- a/pkg/analyzer/analyzers/analyzers.go+++ b/pkg/analyzer/analyzers/analyzers.go@@ -5,21 +5,23 @@ import ("encoding/json""io""net/http"+ "sort""github.com/fatih/color"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")type (Analyzer interface {- Type() analyzerpb.AnalyzerType+ Type() AnalyzerTypeAnalyze(ctx context.Context, credentialInfo map[string]string) (*AnalyzerResult, error)}+ AnalyzerType int+// AnalyzerResult is the output of analysis.AnalyzerResult struct {- AnalyzerType analyzerpb.AnalyzerType+ AnalyzerType AnalyzerTypeBindings []BindingUnboundedResources []ResourceMetadata map[string]any@@ -56,30 +58,80 @@ const (FullAccess string = "full_access")-// Sorted list of all available analyzers. Used for valid sub-commands and TUI-// selection. TODO: Change slice type to Analyzer interface when all available-// analyzers implement it.-var AvailableAnalyzers = []string{- "Airbrake",- "Asana",- "Bitbucket",- "GitHub",- "GitLab",- "HuggingFace",- "Mailchimp",- "Mailgun",- "MySQL",- "OpenAI",- "Opsgenie",- "Postgres",- "Postman",- "Sendgrid",- "Shopify",- "Slack",- "Sourcegraph",- "Square",- "Stripe",- "Twilio",+const (+ AnalyzerTypeInvalid AnalyzerType = iota+ AnalyzerTypeAirbrake+ AnalyzerTypeAsana+ AnalyzerTypeBitbucket+ AnalyzerTypeGitHub+ AnalyzerTypeGitLab+ AnalyzerTypeHuggingFace+ AnalyzerTypeMailchimp+ AnalyzerTypeMailgun+ AnalyzerTypeMySQL+ AnalyzerTypeOpenAI+ AnalyzerTypeOpsgenie+ AnalyzerTypePostgres+ AnalyzerTypePostman+ AnalyzerTypeSendgrid+ AnalyzerTypeShopify+ AnalyzerTypeSlack+ AnalyzerTypeSourcegraph+ AnalyzerTypeSquare+ AnalyzerTypeStripe+ AnalyzerTypeTwilio+ // Add new items here with AnalyzerType prefix+)++// analyzerTypeStrings maps the enum to its string representation.+var analyzerTypeStrings = map[AnalyzerType]string{+ AnalyzerTypeInvalid: "Invalid",+ AnalyzerTypeAirbrake: "Airbrake",+ AnalyzerTypeAsana: "Asana",+ AnalyzerTypeBitbucket: "Bitbucket",+ AnalyzerTypeGitHub: "GitHub",+ AnalyzerTypeGitLab: "GitLab",+ AnalyzerTypeHuggingFace: "HuggingFace",+ AnalyzerTypeMailchimp: "Mailchimp",+ AnalyzerTypeMailgun: "Mailgun",+ AnalyzerTypeMySQL: "MySQL",+ AnalyzerTypeOpenAI: "OpenAI",+ AnalyzerTypeOpsgenie: "Opsgenie",+ AnalyzerTypePostgres: "Postgres",+ AnalyzerTypePostman: "Postman",+ AnalyzerTypeSendgrid: "Sendgrid",+ AnalyzerTypeShopify: "Shopify",+ AnalyzerTypeSlack: "Slack",+ AnalyzerTypeSourcegraph: "Sourcegraph",+ AnalyzerTypeSquare: "Square",+ AnalyzerTypeStripe: "Stripe",+ AnalyzerTypeTwilio: "Twilio",+ // Add new mappings here+}++// String method to get the string representation of an AnalyzerType.+func (a AnalyzerType) String() string {+ if str, ok := analyzerTypeStrings[a]; ok {+ return str+ }+ return "Unknown"+}++// GetSortedAnalyzerTypes returns a sorted slice of AnalyzerType strings, skipping "Invalid".+func AvailableAnalyzers() []string {+ var analyzerStrings []string++ // Iterate through the map to collect all string values except "Invalid".+ for typ, str := range analyzerTypeStrings {+ if typ != AnalyzerTypeInvalid {+ analyzerStrings = append(analyzerStrings, str)+ }+ }++ // Sort the slice alphabetically.+ sort.Strings(analyzerStrings)++ return analyzerStrings}type PermissionStatus struct {diff --git a/pkg/analyzer/analyzers/asana/asana.go b/pkg/analyzer/analyzers/asana/asana.goindex 2b6f9b3a6..0df9e9735 100644--- a/pkg/analyzer/analyzers/asana/asana.go+++ b/pkg/analyzer/analyzers/asana/asana.go@@ -14,7 +14,6 @@ import ("github.com/jedib0t/go-pretty/table""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -24,7 +23,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_Asana }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeAsana }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {key, ok := credInfo["key"]diff --git a/pkg/analyzer/analyzers/bitbucket/bitbucket.go b/pkg/analyzer/analyzers/bitbucket/bitbucket.goindex 7bc4c5cd5..e146564c2 100644--- a/pkg/analyzer/analyzers/bitbucket/bitbucket.go+++ b/pkg/analyzer/analyzers/bitbucket/bitbucket.go@@ -13,7 +13,6 @@ import ("github.com/jedib0t/go-pretty/table""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -59,7 +58,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_Bitbucket }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeBitbucket }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {key, ok := credInfo["key"]@@ -79,7 +78,7 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {}result := analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_Bitbucket,+ AnalyzerType: analyzers.AnalyzerTypeBitbucket,}// add unbounded resourcesdiff --git a/pkg/analyzer/analyzers/github/github.go b/pkg/analyzer/analyzers/github/github.goindex d8b3e9c3d..40a4a7b5d 100644--- a/pkg/analyzer/analyzers/github/github.go+++ b/pkg/analyzer/analyzers/github/github.go@@ -13,7 +13,6 @@ import ("github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers/github/common""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers/github/finegrained""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -23,7 +22,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_GitHub }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeGitHub }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {info, err := AnalyzePermissions(a.Cfg, credInfo["key"])diff --git a/pkg/analyzer/analyzers/gitlab/gitlab.go b/pkg/analyzer/analyzers/gitlab/gitlab.goindex d7563ad53..7975d232d 100644--- a/pkg/analyzer/analyzers/gitlab/gitlab.go+++ b/pkg/analyzer/analyzers/gitlab/gitlab.go@@ -13,7 +13,6 @@ import ("github.com/jedib0t/go-pretty/table""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -23,7 +22,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_GitLab }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeGitLab }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {_, err := AnalyzePermissions(a.Cfg, credInfo["key"])diff --git a/pkg/analyzer/analyzers/huggingface/huggingface.go b/pkg/analyzer/analyzers/huggingface/huggingface.goindex 6de5d70d2..6cc06f981 100644--- a/pkg/analyzer/analyzers/huggingface/huggingface.go+++ b/pkg/analyzer/analyzers/huggingface/huggingface.go@@ -13,7 +13,6 @@ import ("github.com/jedib0t/go-pretty/table""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -29,7 +28,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_HuggingFace }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeHuggingFace }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {key, ok := credInfo["key"]@@ -239,7 +238,7 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {}result := analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_HuggingFace,+ AnalyzerType: analyzers.AnalyzerTypeHuggingFace,Metadata: map[string]interface{}{"username": info.Token.Username,"name": info.Token.Name,diff --git a/pkg/analyzer/analyzers/mailchimp/mailchimp.go b/pkg/analyzer/analyzers/mailchimp/mailchimp.goindex bc13fc6ca..390167fd6 100644--- a/pkg/analyzer/analyzers/mailchimp/mailchimp.go+++ b/pkg/analyzer/analyzers/mailchimp/mailchimp.go@@ -13,7 +13,6 @@ import ("github.com/jedib0t/go-pretty/table""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -25,7 +24,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_Mailchimp }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeMailchimp }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {key, ok := credInfo["key"]@@ -45,7 +44,7 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {return nil}result := analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_Mailchimp,+ AnalyzerType: analyzers.AnalyzerTypeMailchimp,Bindings: make([]analyzers.Binding, 0, len(StringToPermission)),UnboundedResources: make([]analyzers.Resource, 0, len(info.Domains.Domains)),}diff --git a/pkg/analyzer/analyzers/mailgun/mailgun.go b/pkg/analyzer/analyzers/mailgun/mailgun.goindex 62dcabf42..2c499000f 100644--- a/pkg/analyzer/analyzers/mailgun/mailgun.go+++ b/pkg/analyzer/analyzers/mailgun/mailgun.go@@ -13,7 +13,6 @@ import ("github.com/jedib0t/go-pretty/table""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -23,7 +22,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_Mailgun }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeMailgun }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {key, ok := credInfo["key"]@@ -43,7 +42,7 @@ func secretInfoToAnalyzerResult(info *DomainsJSON) *analyzers.AnalyzerResult {return nil}result := analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_Mailgun,+ AnalyzerType: analyzers.AnalyzerTypeMailgun,Bindings: make([]analyzers.Binding, len(info.Items)),}diff --git a/pkg/analyzer/analyzers/mysql/mysql.go b/pkg/analyzer/analyzers/mysql/mysql.goindex 81870af0a..173cb4305 100644--- a/pkg/analyzer/analyzers/mysql/mysql.go+++ b/pkg/analyzer/analyzers/mysql/mysql.go@@ -19,7 +19,6 @@ import ("github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -29,7 +28,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_MySQL }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeMySQL }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {uri, ok := credInfo["connection_string"]@@ -48,7 +47,7 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {return nil}result := analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_MySQL,+ AnalyzerType: analyzers.AnalyzerTypeMySQL,Metadata: nil,Bindings: []analyzers.Binding{},}diff --git a/pkg/analyzer/analyzers/openai/openai.go b/pkg/analyzer/analyzers/openai/openai.goindex 1cd40f2b5..041c2950f 100644--- a/pkg/analyzer/analyzers/openai/openai.go+++ b/pkg/analyzer/analyzers/openai/openai.go@@ -16,7 +16,6 @@ import ("github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -26,7 +25,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_OpenAI }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeOpenAI }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {info, err := AnalyzePermissions(a.Cfg, credInfo["key"])diff --git a/pkg/analyzer/analyzers/opsgenie/opsgenie.go b/pkg/analyzer/analyzers/opsgenie/opsgenie.goindex f308383ef..f63efd440 100644--- a/pkg/analyzer/analyzers/opsgenie/opsgenie.go+++ b/pkg/analyzer/analyzers/opsgenie/opsgenie.go@@ -16,7 +16,6 @@ import ("github.com/jedib0t/go-pretty/table""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -26,7 +25,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_Opsgenie }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeOpsgenie }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {key, ok := credInfo["key"]@@ -45,7 +44,7 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {return nil}result := analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_Opsgenie,+ AnalyzerType: analyzers.AnalyzerTypeOpsgenie,Metadata: nil,Bindings: make([]analyzers.Binding, len(info.Permissions)),UnboundedResources: make([]analyzers.Resource, len(info.Users)),diff --git a/pkg/analyzer/analyzers/postgres/postgres.go b/pkg/analyzer/analyzers/postgres/postgres.goindex 1eae6047d..ca4a74e20 100644--- a/pkg/analyzer/analyzers/postgres/postgres.go+++ b/pkg/analyzer/analyzers/postgres/postgres.go@@ -16,7 +16,6 @@ import ("github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -26,7 +25,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_Postgres }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypePostgres }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {uri, ok := credInfo["connection_string"]@@ -46,7 +45,7 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {return nil}result := analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_Postgres,+ AnalyzerType: analyzers.AnalyzerTypePostgres,Metadata: nil,Bindings: []analyzers.Binding{},}diff --git a/pkg/analyzer/analyzers/postman/postman.go b/pkg/analyzer/analyzers/postman/postman.goindex 98d088e0f..8eecd5a9b 100644--- a/pkg/analyzer/analyzers/postman/postman.go+++ b/pkg/analyzer/analyzers/postman/postman.go@@ -12,7 +12,6 @@ import ("github.com/jedib0t/go-pretty/table""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -22,7 +21,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_Postman }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypePostman }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {key, ok := credInfo["key"]@@ -42,7 +41,7 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {}result := analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_Postman,+ AnalyzerType: analyzers.AnalyzerTypePostman,Metadata: nil,UnboundedResources: []analyzers.Resource{},}diff --git a/pkg/analyzer/analyzers/sendgrid/sendgrid.go b/pkg/analyzer/analyzers/sendgrid/sendgrid.goindex f924d0d68..01f53254e 100644--- a/pkg/analyzer/analyzers/sendgrid/sendgrid.go+++ b/pkg/analyzer/analyzers/sendgrid/sendgrid.go@@ -15,7 +15,6 @@ import ("github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -25,7 +24,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_Sendgrid }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeSendgrid }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {key, ok := credInfo["key"]@@ -54,7 +53,7 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {}result := analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_Sendgrid,+ AnalyzerType: analyzers.AnalyzerTypeSendgrid,Metadata: map[string]any{"key_type": keyType,"2fa_required": slices.Contains(info.RawScopes, "2fa_required"),diff --git a/pkg/analyzer/analyzers/shopify/shopify.go b/pkg/analyzer/analyzers/shopify/shopify.goindex 3711baae2..b69569fe8 100644--- a/pkg/analyzer/analyzers/shopify/shopify.go+++ b/pkg/analyzer/analyzers/shopify/shopify.go@@ -15,7 +15,6 @@ import ("github.com/jedib0t/go-pretty/table""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -30,7 +29,7 @@ var (categoryOrder = []string{"Analytics", "Applications", "Assigned fulfillment orders", "Browsing behavior", "Custom pixels", "Customers", "Discounts", "Discovery", "Draft orders", "Files", "Fulfillment services", "Gift cards", "Inventory", "Legal policies", "Locations", "Marketing events", "Merchant-managed fulfillment orders", "Metaobject definitions", "Metaobject entries", "Online Store navigation", "Online Store pages", "Order editing", "Orders", "Packing slip management", "Payment customizations", "Payment terms", "Pixels", "Price rules", "Product feeds", "Product listings", "Products", "Publications", "Purchase options", "Reports", "Resource feedback", "Returns", "Sales channels", "Script tags", "Shipping", "Shop locales", "Shopify Markets", "Shopify Payments accounts", "Shopify Payments bank accounts", "Shopify Payments disputes", "Shopify Payments payouts", "Store content", "Store credit account transactions", "Store credit accounts", "Themes", "Third-party fulfillment orders", "Translations", "all_cart_transforms", "all_checkout_completion_target_customizations", "cart_transforms", "cash_tracking", "companies", "custom_fulfillment_services", "customer_data_erasure", "customer_merge", "delivery_customizations", "delivery_option_generators", "discounts_allocator_functions", "fulfillment_constraint_rules", "gates", "order_submission_rules", "privacy_settings", "shopify_payments_provider_accounts_sensitive", "validations"})-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_Shopify }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeShopify }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {key, ok := credInfo["key"]@@ -55,7 +54,7 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {return nil}result := analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_Shopify,+ AnalyzerType: analyzers.AnalyzerTypeShopify,Metadata: map[string]any{"status_code": info.StatusCode,},diff --git a/pkg/analyzer/analyzers/slack/slack.go b/pkg/analyzer/analyzers/slack/slack.goindex 9190925b6..46cde734b 100644--- a/pkg/analyzer/analyzers/slack/slack.go+++ b/pkg/analyzer/analyzers/slack/slack.go@@ -15,7 +15,6 @@ import ("github.com/jedib0t/go-pretty/table""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -25,7 +24,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_Slack }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeSlack }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {key, ok := credInfo["key"]@@ -45,7 +44,7 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {return nil}result := analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_Slack,+ AnalyzerType: analyzers.AnalyzerTypeSlack,Metadata: nil,}diff --git a/pkg/analyzer/analyzers/sourcegraph/sourcegraph.go b/pkg/analyzer/analyzers/sourcegraph/sourcegraph.goindex 71f3d05af..d9e4f95b7 100644--- a/pkg/analyzer/analyzers/sourcegraph/sourcegraph.go+++ b/pkg/analyzer/analyzers/sourcegraph/sourcegraph.go@@ -12,7 +12,6 @@ import ("github.com/fatih/color""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -22,7 +21,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_Sourcegraph }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeSourcegraph }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {key, ok := credInfo["key"]@@ -46,7 +45,7 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {permission = PermissionStrings[SiteAdminFull]}result := analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_Sourcegraph,+ AnalyzerType: analyzers.AnalyzerTypeSourcegraph,Metadata: nil,Bindings: []analyzers.Binding{{diff --git a/pkg/analyzer/analyzers/square/square.go b/pkg/analyzer/analyzers/square/square.goindex 1f72e1969..8fc237e88 100644--- a/pkg/analyzer/analyzers/square/square.go+++ b/pkg/analyzer/analyzers/square/square.go@@ -14,7 +14,6 @@ import ("github.com/jedib0t/go-pretty/table""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -24,7 +23,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_Square }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeSquare }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {key, ok := credInfo["key"]@@ -43,7 +42,7 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {return nil}result := analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_Square,+ AnalyzerType: analyzers.AnalyzerTypeSquare,UnboundedResources: []analyzers.Resource{},Metadata: map[string]any{"expires_at": info.Permissions.ExpiresAt,diff --git a/pkg/analyzer/analyzers/stripe/stripe.go b/pkg/analyzer/analyzers/stripe/stripe.goindex ba83dc49d..5fae0a649 100644--- a/pkg/analyzer/analyzers/stripe/stripe.go+++ b/pkg/analyzer/analyzers/stripe/stripe.go@@ -18,7 +18,6 @@ import ("github.com/jedib0t/go-pretty/table""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context""gopkg.in/yaml.v2")@@ -29,7 +28,7 @@ type Analyzer struct {Cfg *config.Config}-func (Analyzer) Type() analyzerpb.AnalyzerType { return analyzerpb.AnalyzerType_Stripe }+func (Analyzer) Type() analyzers.AnalyzerType { return analyzers.AnalyzerTypeStripe }func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error) {key, ok := credInfo["key"]@@ -49,7 +48,7 @@ func secretInfoToAnalyzerResult(info *SecretInfo) *analyzers.AnalyzerResult {return nil}result := &analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_Stripe,+ AnalyzerType: analyzers.AnalyzerTypeStripe,Metadata: map[string]any{"key_type": info.KeyType,"key_env": info.KeyEnv,diff --git a/pkg/analyzer/analyzers/twilio/twilio.go b/pkg/analyzer/analyzers/twilio/twilio.goindex 4270b861d..33a49cb14 100644--- a/pkg/analyzer/analyzers/twilio/twilio.go+++ b/pkg/analyzer/analyzers/twilio/twilio.go@@ -11,7 +11,6 @@ import ("github.com/fatih/color""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/analyzers""github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/config"- "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb""github.com/trufflesecurity/trufflehog/v3/pkg/context")@@ -19,8 +18,8 @@ type Analyzer struct {Cfg *config.Config}-func (a *Analyzer) Type() analyzerpb.AnalyzerType {- return analyzerpb.AnalyzerType_Twilio+func (a *Analyzer) Type() analyzers.AnalyzerType {+ return analyzers.AnalyzerTypeTwilio}func (a *Analyzer) Analyze(ctx context.Context, credentialInfo map[string]string) (*analyzers.AnalyzerResult, error) {@@ -118,7 +117,7 @@ func (a *Analyzer) Analyze(ctx context.Context, credentialInfo map[string]string}return &analyzers.AnalyzerResult{- AnalyzerType: analyzerpb.AnalyzerType_Twilio,+ AnalyzerType: analyzers.AnalyzerTypeTwilio,Bindings: bindings,}, nil}diff --git a/pkg/analyzer/cli.go b/pkg/analyzer/cli.goindex 677dbc6f1..d3f8004e4 100644--- a/pkg/analyzer/cli.go+++ b/pkg/analyzer/cli.go@@ -40,11 +40,11 @@ func Command(app *kingpin.Application) *kingpin.CmdClause {keyTypeHelp := fmt.Sprintf("Type of key to analyze. Omit to interactively choose. Available key types: %s",- strings.Join(analyzers.AvailableAnalyzers, ", "),+ strings.Join(analyzers.AvailableAnalyzers(), ", "),)// Lowercase the available analyzers.- availableAnalyzers := make([]string, len(analyzers.AvailableAnalyzers))- for i, a := range analyzers.AvailableAnalyzers {+ availableAnalyzers := make([]string, len(analyzers.AvailableAnalyzers()))+ for i, a := range analyzers.AvailableAnalyzers() {availableAnalyzers[i] = strings.ToLower(a)}analyzeKeyType = cli.Arg("key-type", keyTypeHelp).Enum(availableAnalyzers...)diff --git a/pkg/analyzer/pb/analyzerpb/analyzer.pb.go b/pkg/analyzer/pb/analyzerpb/analyzer.pb.godeleted file mode 100644index 3e73341be..000000000--- a/pkg/analyzer/pb/analyzerpb/analyzer.pb.go+++ /dev/null@@ -1,203 +0,0 @@-// Code generated by protoc-gen-go. DO NOT EDIT.-// versions:-// protoc-gen-go v1.33.0-// protoc v4.25.3-// source: analyzer.proto--package analyzerpb--import (- protoreflect "google.golang.org/protobuf/reflect/protoreflect"- protoimpl "google.golang.org/protobuf/runtime/protoimpl"- reflect "reflect"- sync "sync"-)--const (- // Verify that this generated code is sufficiently up-to-date.- _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)- // Verify that runtime/protoimpl is sufficiently up-to-date.- _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)-)--type AnalyzerType int32--const (- AnalyzerType_Invalid AnalyzerType = 0- AnalyzerType_Airbrake AnalyzerType = 1- AnalyzerType_Asana AnalyzerType = 2- AnalyzerType_Bitbucket AnalyzerType = 3- AnalyzerType_GitHub AnalyzerType = 4- AnalyzerType_GitLab AnalyzerType = 5- AnalyzerType_HuggingFace AnalyzerType = 6- AnalyzerType_Mailchimp AnalyzerType = 7- AnalyzerType_Mailgun AnalyzerType = 8- AnalyzerType_MySQL AnalyzerType = 9- AnalyzerType_OpenAI AnalyzerType = 10- AnalyzerType_Opsgenie AnalyzerType = 11- AnalyzerType_Postgres AnalyzerType = 12- AnalyzerType_Postman AnalyzerType = 13- AnalyzerType_Sendgrid AnalyzerType = 14- AnalyzerType_Shopify AnalyzerType = 15- AnalyzerType_Slack AnalyzerType = 16- AnalyzerType_Sourcegraph AnalyzerType = 17- AnalyzerType_Square AnalyzerType = 18- AnalyzerType_Stripe AnalyzerType = 19- AnalyzerType_Twilio AnalyzerType = 20-)--// Enum value maps for AnalyzerType.-var (- AnalyzerType_name = map[int32]string{- 0: "Invalid",- 1: "Airbrake",- 2: "Asana",- 3: "Bitbucket",- 4: "GitHub",- 5: "GitLab",- 6: "HuggingFace",- 7: "Mailchimp",- 8: "Mailgun",- 9: "MySQL",- 10: "OpenAI",- 11: "Opsgenie",- 12: "Postgres",- 13: "Postman",- 14: "Sendgrid",- 15: "Shopify",- 16: "Slack",- 17: "Sourcegraph",- 18: "Square",- 19: "Stripe",- 20: "Twilio",- }- AnalyzerType_value = map[string]int32{- "Invalid": 0,- "Airbrake": 1,- "Asana": 2,- "Bitbucket": 3,- "GitHub": 4,- "GitLab": 5,- "HuggingFace": 6,- "Mailchimp": 7,- "Mailgun": 8,- "MySQL": 9,- "OpenAI": 10,- "Opsgenie": 11,- "Postgres": 12,- "Postman": 13,- "Sendgrid": 14,- "Shopify": 15,- "Slack": 16,- "Sourcegraph": 17,- "Square": 18,- "Stripe": 19,- "Twilio": 20,- }-)--func (x AnalyzerType) Enum() *AnalyzerType {- p := new(AnalyzerType)- *p = x- return p-}--func (x AnalyzerType) String() string {- return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))-}--func (AnalyzerType) Descriptor() protoreflect.EnumDescriptor {- return file_analyzer_proto_enumTypes[0].Descriptor()-}--func (AnalyzerType) Type() protoreflect.EnumType {- return &file_analyzer_proto_enumTypes[0]-}--func (x AnalyzerType) Number() protoreflect.EnumNumber {- return protoreflect.EnumNumber(x)-}--// Deprecated: Use AnalyzerType.Descriptor instead.-func (AnalyzerType) EnumDescriptor() ([]byte, []int) {- return file_analyzer_proto_rawDescGZIP(), []int{0}-}--var File_analyzer_proto protoreflect.FileDescriptor--var file_analyzer_proto_rawDesc = []byte{- 0x0a, 0x0e, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,- 0x12, 0x08, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x2a, 0xa3, 0x02, 0x0a, 0x0c, 0x41,- 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x49,- 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x69, 0x72, 0x62,- 0x72, 0x61, 0x6b, 0x65, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x73, 0x61, 0x6e, 0x61, 0x10,- 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x69, 0x74, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x10, 0x03,- 0x12, 0x0a, 0x0a, 0x06, 0x47, 0x69, 0x74, 0x48, 0x75, 0x62, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06,- 0x47, 0x69, 0x74, 0x4c, 0x61, 0x62, 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x75, 0x67, 0x67,- 0x69, 0x6e, 0x67, 0x46, 0x61, 0x63, 0x65, 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09, 0x4d, 0x61, 0x69,- 0x6c, 0x63, 0x68, 0x69, 0x6d, 0x70, 0x10, 0x07, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x61, 0x69, 0x6c,- 0x67, 0x75, 0x6e, 0x10, 0x08, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x10, 0x09,- 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x70, 0x65, 0x6e, 0x41, 0x49, 0x10, 0x0a, 0x12, 0x0c, 0x0a, 0x08,- 0x4f, 0x70, 0x73, 0x67, 0x65, 0x6e, 0x69, 0x65, 0x10, 0x0b, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x6f,- 0x73, 0x74, 0x67, 0x72, 0x65, 0x73, 0x10, 0x0c, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x6f, 0x73, 0x74,- 0x6d, 0x61, 0x6e, 0x10, 0x0d, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x65, 0x6e, 0x64, 0x67, 0x72, 0x69,- 0x64, 0x10, 0x0e, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x68, 0x6f, 0x70, 0x69, 0x66, 0x79, 0x10, 0x0f,- 0x12, 0x09, 0x0a, 0x05, 0x53, 0x6c, 0x61, 0x63, 0x6b, 0x10, 0x10, 0x12, 0x0f, 0x0a, 0x0b, 0x53,- 0x6f, 0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x10, 0x11, 0x12, 0x0a, 0x0a, 0x06,- 0x53, 0x71, 0x75, 0x61, 0x72, 0x65, 0x10, 0x12, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x74, 0x72, 0x69,- 0x70, 0x65, 0x10, 0x13, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x77, 0x69, 0x6c, 0x69, 0x6f, 0x10, 0x14,- 0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74,- 0x72, 0x75, 0x66, 0x66, 0x6c, 0x65, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x74,- 0x72, 0x75, 0x66, 0x66, 0x6c, 0x65, 0x68, 0x6f, 0x67, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x6b, 0x67,- 0x2f, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x2f, 0x70, 0x62, 0x2f, 0x61, 0x6e, 0x61,- 0x6c, 0x79, 0x7a, 0x65, 0x72, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,-}--var (- file_analyzer_proto_rawDescOnce sync.Once- file_analyzer_proto_rawDescData = file_analyzer_proto_rawDesc-)--func file_analyzer_proto_rawDescGZIP() []byte {- file_analyzer_proto_rawDescOnce.Do(func() {- file_analyzer_proto_rawDescData = protoimpl.X.CompressGZIP(file_analyzer_proto_rawDescData)- })- return file_analyzer_proto_rawDescData-}--var file_analyzer_proto_enumTypes = make([]protoimpl.EnumInfo, 1)-var file_analyzer_proto_goTypes = []interface{}{- (AnalyzerType)(0), // 0: analyzer.AnalyzerType-}-var file_analyzer_proto_depIdxs = []int32{- 0, // [0:0] is the sub-list for method output_type- 0, // [0:0] is the sub-list for method input_type- 0, // [0:0] is the sub-list for extension type_name- 0, // [0:0] is the sub-list for extension extendee- 0, // [0:0] is the sub-list for field type_name-}--func init() { file_analyzer_proto_init() }-func file_analyzer_proto_init() {- if File_analyzer_proto != nil {- return- }- type x struct{}- out := protoimpl.TypeBuilder{- File: protoimpl.DescBuilder{- GoPackagePath: reflect.TypeOf(x{}).PkgPath(),- RawDescriptor: file_analyzer_proto_rawDesc,- NumEnums: 1,- NumMessages: 0,- NumExtensions: 0,- NumServices: 0,- },- GoTypes: file_analyzer_proto_goTypes,- DependencyIndexes: file_analyzer_proto_depIdxs,- EnumInfos: file_analyzer_proto_enumTypes,- }.Build()- File_analyzer_proto = out.File- file_analyzer_proto_rawDesc = nil- file_analyzer_proto_goTypes = nil- file_analyzer_proto_depIdxs = nil-}diff --git a/pkg/analyzer/pb/analyzerpb/analyzer.pb.validate.go b/pkg/analyzer/pb/analyzerpb/analyzer.pb.validate.godeleted file mode 100644index c0327c9fa..000000000--- a/pkg/analyzer/pb/analyzerpb/analyzer.pb.validate.go+++ /dev/null@@ -1,36 +0,0 @@-// Code generated by protoc-gen-validate. DO NOT EDIT.-// source: analyzer.proto--package analyzerpb--import (- "bytes"- "errors"- "fmt"- "net"- "net/mail"- "net/url"- "regexp"- "sort"- "strings"- "time"- "unicode/utf8"-- "google.golang.org/protobuf/types/known/anypb"-)--// ensure the imports are used-var (- _ = bytes.MinRead- _ = errors.New("")- _ = fmt.Print- _ = utf8.UTFMax- _ = (*regexp.Regexp)(nil)- _ = (*strings.Reader)(nil)- _ = net.IPv4len- _ = time.Duration(0)- _ = (*url.URL)(nil)- _ = (*mail.Address)(nil)- _ = anypb.Any{}- _ = sort.Sort-)diff --git a/pkg/analyzer/proto/analyzer.proto b/pkg/analyzer/proto/analyzer.protodeleted file mode 100644index 31e32c489..000000000--- a/pkg/analyzer/proto/analyzer.proto+++ /dev/null@@ -1,29 +0,0 @@-syntax = "proto3";--package analyzer;--option go_package = "github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/pb/analyzerpb";--enum AnalyzerType {- Invalid = 0;- Airbrake = 1;- Asana = 2;- Bitbucket = 3;- GitHub = 4;- GitLab = 5;- HuggingFace = 6;- Mailchimp = 7;- Mailgun = 8;- MySQL = 9;- OpenAI = 10;- Opsgenie = 11;- Postgres = 12;- Postman = 13;- Sendgrid = 14;- Shopify = 15;- Slack = 16;- Sourcegraph = 17;- Square = 18;- Stripe = 19;- Twilio = 20;-}diff --git a/pkg/analyzer/tui/form.go b/pkg/analyzer/tui/form.goindex 0c71c4ffd..d335e5c19 100644--- a/pkg/analyzer/tui/form.go+++ b/pkg/analyzer/tui/form.go@@ -112,7 +112,7 @@ func (ui FormPage) View() string {func (ui FormPage) PrevPage() (tea.Model, tea.Cmd) {page := NewKeyTypePage(ui.Common)// Select what was previously selected.- index, ok := slices.BinarySearch(analyzers.AvailableAnalyzers, ui.KeyType)+ index, ok := slices.BinarySearch(analyzers.AvailableAnalyzers(), ui.KeyType)if !ok {// Should be impossible.index = 0diff --git a/pkg/analyzer/tui/keytype.go b/pkg/analyzer/tui/keytype.goindex daf840545..485df8734 100644--- a/pkg/analyzer/tui/keytype.go+++ b/pkg/analyzer/tui/keytype.go@@ -34,8 +34,8 @@ func (ui KeyTypePage) Init() tea.Cmd {}func NewKeyTypePage(c *common.Common) KeyTypePage {- items := make([]list.Item, len(analyzers.AvailableAnalyzers))- for i, analyzerType := range analyzers.AvailableAnalyzers {+ items := make([]list.Item, len(analyzers.AvailableAnalyzers()))+ for i, analyzerType := range analyzers.AvailableAnalyzers() {items[i] = KeyTypeItem(analyzerType)}delegate := list.NewDefaultDelegate()diff --git a/pkg/analyzer/tui/tui.go b/pkg/analyzer/tui/tui.goindex c06f6411a..66954124b 100644--- a/pkg/analyzer/tui/tui.go+++ b/pkg/analyzer/tui/tui.go@@ -32,7 +32,7 @@ func Run(keyType string) (string, *SecretInfo, error) {// If a keyType is provided, make sure it's in the list of AvailableAnalyzers.if keyType != "" {var found bool- for _, a := range analyzers.AvailableAnalyzers {+ for _, a := range analyzers.AvailableAnalyzers() {if strings.EqualFold(a, keyType) {keyType = afound = true