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

Use centralized function/objects for all network access #591

Open
pombredanne opened this issue Jan 24, 2022 · 1 comment
Open

Use centralized function/objects for all network access #591

pombredanne opened this issue Jan 24, 2022 · 1 comment

Comments

@pombredanne
Copy link
Collaborator

The network calls are scattered in many places and this is problem.

@abhi-kr-2100
Copy link

I skimmed the code and found a fetch_response utility function in vulnerabilities/utils.py, more fetch_* functions/methods purpose-built for their respective importers, and fetch methods various VersionAPI subclasses.

Before I try to fix this issue, I would like to know if this is what you're talking about as well? Perhaps, you know of some more?

My plan to fix this:

  1. Understand how each importer/VersionAPI fetches data.
  2. Separate what's general to every importer/VersionAPI from what's special to each.
  3. Design a base Fetcher class (analogous to the Importer class).
  4. Specialize (through inheritance) the Fetcher class for an importer/VersionAPI as necessary.

I'm contributing for the first time and will appreciate all the advice and constructive criticism I get get. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants