
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.
Simple Redis client for python.
It has been made to simplify working with Redis in python.
Instantiate Cache()
, give the Redis host
, port
and db
.
Then you can get a cached entry with Cache.get_data_from_cache()
and add an entry to Redis with Cache.save_data_to_cache()
⚠️The data send to cache NEEDS TO BE A DICTIONARY! ⚠️
from redis_client.client import Cache
from time import sleep
from tpying import Dict
# Redis Configuration
cache = Cache(redis_host="localhost", redis_port=6379, redis_db=0, log_level="INFO")
def username_expander(username: str) -> Dict[str, str]:
"""Example of a function that require caching."""
# Key that will be use to retrieve cached data
# Note that I include the parameter 'username' in the key to make sure we only cache unique value.
key = f"username_expander:{username}"
# Check if the data is already caches
cached_data = cache.get_data_from_cache(key)
# Return it if yes
if cached_data:
return cached_data
data = {"expanded_username": f"{username}_123"}
# Save data to cache with an expiration time of 12 hours
cache.save_data_to_cache(key, data, expiration_in_hours=12)
return data
FAQs
A simple client for Redis
We found that redis-client 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.