
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
A lightweight, yet powerful dependency injection framework for Python applications.
pip install a13x-depinj
from dataclasses import dataclass
@dataclass
class DatabaseConfig:
url: str
port: int
class Database:
def __init__(self, config: dict):
self.config = DatabaseConfig(**config)
def connect(self):
# Implementation
pass
class UserService:
def __init__(self, config: dict):
self.db = ComponentRegistry().get(Database)
components:
- module: myapp.database
class: Database
config_path: database.config
- module: myapp.services
class: UserService
config_path: services.user
where config_path references a starting entry in the config.yaml file:
services:
user:
name: "a13x"
email: "a13x.h.cc@gmail.com"
database:
config:
db_path: "data/market_data.db"
enable_wal: true
pragma_synchronous: "NORMAL"
pragma_journal_mode: "WAL"
pragma_cache_size: -2000 # 2MB cache
max_connections: 10
from a13x_depinj import ComponentRegistry, Config
# Load application configuration
config = Config.load_config('config.yaml')
# Initialize components
with ComponentRegistry.from_yaml(config, 'deployment.yaml') as registry:
# Get component instances
db = registry.get(Database)
user_service = registry.get(UserService)
# Use components
db.connect()
Components can be initialized lazily when first accessed:
registry = ComponentRegistry.from_yaml(config, 'deployment.yaml', lazy=True)
Components can implement cleanup methods:
class Database:
def cleanup(self):
# Cleanup resources
pass
The registry will automatically call cleanup when using the context manager or when unregistering components.
The registry supports type hints for better IDE integration:
from typing import TypeVar, Type
T = TypeVar('T')
registry = ComponentRegistry[T]()
db: Database = registry.get(Database)
Contributions are welcome! Please check our Contributing Guidelines for details.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A lightweight dependency injection framework for Python applications
We found that a13x-depinj demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.