Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
from freeze_uuid import freeze_uuid
@freeze_uuid('12af6b44-8181-11ee-b890-628ab7cd4d99')
def test_uuid():
assert str(uuid.uuid1()) == '12af6b44-8181-11ee-b890-628ab7cd4d99'
assert str(uuid.uuid4()) == '12af6b44-8181-11ee-b890-628ab7cd4d99'
@freeze_uuid()
def test_uuid_default():
assert str(uuid.uuid1()) == '00000000-0000-0000-0000-000000000000'
assert str(uuid.uuid4()) == '00000000-0000-0000-0000-000000000000'
@pytest.mark.asyncio
@freeze_uuid('12af6b44-8181-11ee-b890-628ab7cd4d99')
async def test_uuid_async():
assert str(uuid.uuid1()) == '12af6b44-8181-11ee-b890-628ab7cd4d99'
assert str(uuid.uuid4()) == '12af6b44-8181-11ee-b890-628ab7cd4d99'
@freeze_uuid(['12af6b44-8181-11ee-b890-628ab7cd4d99', '12af6b44-8181-11ee-b890-628ab7cd4d98'])
def test_uuid_list():
assert str(uuid.uuid1()) == '12af6b44-8181-11ee-b890-628ab7cd4d99'
assert str(uuid.uuid4()) == '12af6b44-8181-11ee-b890-628ab7cd4d98'
assert str(uuid.uuid4()) == '12af6b44-8181-11ee-b890-628ab7cd4d98'
assert str(uuid.uuid4()) == '12af6b44-8181-11ee-b890-628ab7cd4d98'
from uuid_extensions import uuid7
@freeze_uuid(TEST_UUID)
def test_uuid_7():
assert str(uuid7()) == TEST_UUID
from freeze_uuid import freeze_uuid_manager
@pytest.mark.parametrize(
['expected_result', 'freeze_data'],
[
pytest.param(
TEST_UUID_2,
[TEST_UUID_2],
),
pytest.param(
TEST_UUID_3,
[TEST_UUID_3],
),
pytest.param(
TEST_UUID_4,
[TEST_UUID_4],
),
pytest.param(
TEST_UUID_5,
[TEST_UUID_5],
),
]
)
def test_parametrize(expected_result, freeze_data):
with freeze_uuid_manager(freeze_data):
assert str(uuid.uuid4()) == expected_result
FAQs
Python package for mocking uuid.
We found that freeze-uuid 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.