Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Add tests for including github repos. (#854)
ahrav46bc010165c1
diff --git a/pkg/sources/github/github_test.go b/pkg/sources/github/github_test.goindex ea0e541ce..c057fd700 100644--- a/pkg/sources/github/github_test.go+++ b/pkg/sources/github/github_test.go@@ -308,6 +308,29 @@ func TestEnumerateWithToken(t *testing.T) {assert.True(t, gock.IsDone())}+func TestEnumerateWithToken_IncludeRepos(t *testing.T) {+ defer gock.Off()++ gock.New("https://api.github.com").+ Get("/user").+ Reply(200).+ JSON(map[string]string{"login": "super-secret-user"})++ gock.New("https://api.github.com").+ Get("/users/super-secret-user/gists").+ Reply(200).+ JSON([]map[string]string{{"clone_url": ""}})++ s := initTestSource(nil)+ s.repos = []string{"some-special-repo"}++ err := s.enumerateWithToken(context.TODO(), "https://api.github.com", "token")+ assert.Nil(t, err)+ assert.Equal(t, 2, len(s.repos))+ assert.Equal(t, []string{"some-special-repo", ""}, s.repos)+ assert.True(t, gock.IsDone())+}+func TestEnumerateWithApp(t *testing.T) {defer gock.Off()