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

remove global singletons #5239

Open
tarunKoyalwar opened this issue May 29, 2024 · 0 comments · May be fixed by #5311
Open

remove global singletons #5239

tarunKoyalwar opened this issue May 29, 2024 · 0 comments · May be fixed by #5311
Assignees
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@tarunKoyalwar
Copy link
Member

tarunKoyalwar commented May 29, 2024

Nuclei version:

<= latest

Current Behavior:

Nuclei currently uses global singletons in multiple places which are initialized in protocolstate and protocolinit , the main purpose is to reuse protocol clients like httpclientpool, networkclientpool etc and use a single dialer for all tasks , while this is acceptable in cli but is considered as anti-pattern for library usage , since multiple instances can't be created and results in collison or reinitialization

we should remove this global singleton behaviour, this way it is reused and available everywhere and multiple nuclei instances could be created with seperate configs

Known Features/Logic that depend on singleton behaviour

  • global fastdialer usage
  • clientpools for each protocol
  • direct access of fastdialer in javascript libraries/modules

Expected Behavior:

  • no global singletons

Anything else:

@tarunKoyalwar tarunKoyalwar added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label May 29, 2024
@tarunKoyalwar tarunKoyalwar self-assigned this May 29, 2024
@Mzack9999 Mzack9999 assigned Mzack9999 and unassigned tarunKoyalwar Jun 13, 2024
@Mzack9999 Mzack9999 linked a pull request Jun 19, 2024 that will close this issue
4 tasks
@Mzack9999 Mzack9999 changed the title remove global singletons using dependency container's and context remove global singletons Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants