Skip to content

API key randomization is not working #547

@swdbo

Description

@swdbo

Hello !

It seems like even if multiple keys are set for a provider in provider-config.yaml, the same unique key will always be used.

// We use random selection of api keys from the list of keys supplied.
I may not fully understand the logic behind the use of rand.Intn() in the GetKeys() function.
I thought it was a way to randomly distribute calls on each run of subfinder, isn't it ?

If so, I have tested the rand package locally and on that page
You can see on the link that answers[rand.Intn(len(answers))] returns the same value everytime.

It looks like it could be simply resolved by using rand.Seed(time.Now().UnixNano()) before calling rand

Subfinder version
v2.5.1

Metadata

Metadata

Assignees

Labels

Priority: MediumThis issue may be useful, and needs some attention.Status: CompletedNothing further to be done with this issue. Awaiting to be closed.Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions