Skip to content

Commit

Permalink
Add warning for passivetotal (#942)
Browse files Browse the repository at this point in the history
* disable passivetotal

* Revert "disable passivetotal"

This reverts commit 6a53ec6.

* add warning

* use SyncLockMap
  • Loading branch information
dogancanbakir authored Sep 12, 2023
1 parent b299457 commit 689a687
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions v2/pkg/passive/sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import (
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/waybackarchive"
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/whoisxmlapi"
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping/sources/zoomeyeapi"
mapsutil "github.com/projectdiscovery/utils/maps"
)

var AllSources = [...]subscraping.Source{
Expand Down Expand Up @@ -91,6 +92,11 @@ var AllSources = [...]subscraping.Source{
// &reconcloud.Source{}, // failing due to cloudflare bot protection
}

var sourceWarnings = mapsutil.NewSyncLockMap[string, string](
mapsutil.WithMap(mapsutil.Map[string, string]{
"passivetotal": "New API credentials for PassiveTotal can't be generated, but existing user account credentials are still functional. Please ensure your integrations are using valid credentials.",
}))

var NameSourceMap = make(map[string]subscraping.Source, len(AllSources))

func init() {
Expand Down Expand Up @@ -146,6 +152,12 @@ func New(sourceNames, excludedSourceNames []string, useAllSources, useSourcesSup

gologger.Debug().Msgf(fmt.Sprintf("Selected source(s) for this search: %s", strings.Join(maps.Keys(sources), ", ")))

for _, currentSource := range sources {
if warning, ok := sourceWarnings.Get(strings.ToLower(currentSource.Name())); ok {
gologger.Warning().Msg(warning)
}
}

// Create the agent, insert the sources and remove the excluded sources
agent := &Agent{sources: maps.Values(sources)}

Expand Down

0 comments on commit 689a687

Please sign in to comment.