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

Implement Conditional Plugin Loading Based on Configuration #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marksowell
Copy link

This pull request introduces a modification to the plugin loading mechanism in subfuz.py, enabling the script to conditionally load plugins based on their enabled status in the config.json file. This change addresses the issue where attempting to load a plugin that is not properly configured or is intended to be disabled by default could lead to import errors or unintended behavior.

Key Changes

  • Modified the plugin loading loop in initialize() to check the config.json for each plugin's enabled status before attempting to import it.
  • This ensures that only plugins explicitly enabled in the configuration are loaded, enhancing the script's flexibility and usability for users with different plugin requirements.

Motivation

The primary motivation behind this change is two-fold:

  1. Improve the user experience by preventing runtime errors related to plugin imports, especially for those who may not have all the dependencies required by every plugin. By allowing users to easily enable or disable plugins through the configuration file, we can make subfuz.py more adaptable to various use cases and environments.
  2. Specifically address and fix a reported issue (#19) where the script would encounter an import error due to the Censys plugin being disabled by default but still attempted to be loaded. This PR fixes cannot import name 'CensysCertificates' from 'censys.search' #19 by ensuring that only enabled plugins are loaded, thereby preventing similar errors from occurring in the future.

Testing

The changes have been manually tested to confirm that plugins marked as "enable": false in config.json are not loaded, and no import errors occur as a result. This was verified by adjusting the configuration for several plugins and observing that only those configured as enabled were attempted to be loaded.

I believe this enhancement will make subfuz.py more robust and user-friendly. I look forward to your feedback and any further suggestions for improvement.

Copy link
Contributor

@Eplox Eplox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks,
Mmh. Seems like I got no longer access to merge in this repository.
Fixed up some other bugs, including censys.
This has been forked to https://github.com/Eplox/subfuz/

shishirs4 pushed a commit to shishirs4/subfuz that referenced this pull request Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cannot import name 'CensysCertificates' from 'censys.search'
2 participants