Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cloudcheck"
version = "8.4.0"
version = "8.4.1"
edition = "2024"
description = "CloudCheck is a simple Rust tool to check whether an IP address or hostname belongs to a cloud provider."
license = "GPL-3.0"
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
[![PyPI](https://img.shields.io/pypi/v/cloudcheck)](https://pypi.org/project/cloudcheck/)
[![Rust Version](https://img.shields.io/badge/rust-1.70+-orange)](https://www.rust-lang.org)
[![Crates.io](https://img.shields.io/crates/v/cloudcheck?color=orange)](https://crates.io/crates/cloudcheck)
[![License](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://github.com/blacklanternsecurity/cloudcheck/blob/master/LICENSE)
[![License](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://github.com/blacklanternsecurity/cloudcheck/blob/stable/LICENSE)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Rust Tests](https://github.com/blacklanternsecurity/cloudcheck/actions/workflows/rust-tests.yml/badge.svg?branch=master)](https://github.com/blacklanternsecurity/cloudcheck/actions/workflows/rust-tests.yml)
[![Python Tests](https://github.com/blacklanternsecurity/cloudcheck/actions/workflows/python-tests.yml/badge.svg?branch=master)](https://github.com/blacklanternsecurity/cloudcheck/actions/workflows/python-tests.yml)
[![Pipeline Tests](https://github.com/blacklanternsecurity/cloudcheck/actions/workflows/pipeline-tests.yml/badge.svg?branch=master)](https://github.com/blacklanternsecurity/cloudcheck/actions/workflows/pipeline-tests.yml)
[![Rust Tests](https://github.com/blacklanternsecurity/cloudcheck/actions/workflows/rust-tests.yml/badge.svg?branch=stable)](https://github.com/blacklanternsecurity/cloudcheck/actions/workflows/rust-tests.yml)
[![Python Tests](https://github.com/blacklanternsecurity/cloudcheck/actions/workflows/python-tests.yml/badge.svg?branch=stable)](https://github.com/blacklanternsecurity/cloudcheck/actions/workflows/python-tests.yml)
[![Pipeline Tests](https://github.com/blacklanternsecurity/cloudcheck/actions/workflows/pipeline-tests.yml/badge.svg?branch=stable)](https://github.com/blacklanternsecurity/cloudcheck/actions/workflows/pipeline-tests.yml)

### UPDATE: Now rewritten in Rust, with [34 supported cloud providers](#supported-cloud-providers)!

Expand Down
41 changes: 0 additions & 41 deletions cloudcheck_update/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,6 @@
logging.basicConfig(level=logging.INFO)
log = logging.getLogger("cloudcheck")

# Dictionary to store loaded provider classes
_provider_classes: Dict[str, Type[BaseProvider]] = {}
# Dictionary to store instantiated providers
providers: Dict[str, BaseProvider] = {}


def load_provider_classes() -> Dict[str, Type[BaseProvider]]:
"""Dynamically load all cloud provider classes from the providers directory."""
global _provider_classes

if _provider_classes:
return _provider_classes

providers_path = Path(__file__).parent.parent / "cloudcheck" / "providers"

for file in providers_path.glob("*.py"):
if file.stem in ("base", "__init__"):
continue

try:
import_path = f"cloudcheck.providers.{file.stem}"
module = importlib.import_module(import_path)

# Look for classes that inherit from BaseProvider
for attr_name in dir(module):
attr = getattr(module, attr_name)
if (
isinstance(attr, type)
and issubclass(attr, BaseProvider)
and attr != BaseProvider
):
provider_name = attr.__name__.lower()
_provider_classes[provider_name] = attr
print(f"Loaded provider class: {attr.__name__}")

except Exception as e:
log.error(f"Failed to load provider from {file}: {e}")
raise

return _provider_classes


project_root = Path(__file__).parent.parent
json_path = project_root / "cloud_providers_v2.json"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "cloudcheck"
version = "8.4.0"
version = "8.4.1"
description = "Detailed database of cloud providers. Instantly look up a domain or IP address"
readme = "README.md"
requires-python = ">=3.9"
Expand Down
4 changes: 2 additions & 2 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ testpaths = .
python_files = test_*.py
python_classes = Test*
python_functions = test_*
norecursedirs = old
addopts = --ignore=old
norecursedirs = old target
addopts = --ignore=old --ignore=target
Loading