
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
github.com/GoogleCloudPlatform/compute-image-tools/cli_tools
cli_tools uses gomock. The mocks are stored as source code, and need to be updated whenever the referenced interface is changed.
To use existing mocks, no setup is required.
To generate new mocks, or update existing mocks, you need the mockgen
tool:
go install github.com/golang/mock/mockgen
export PATH=$PATH:~/go/bin
For interfaces within cli_tools that require mocking, we create go generate definitions. These definitions codify naming convention, and simplify future updates.
For example, to update the mock for shell.Executor
:
cd cli_tools/common/utils/shell
go generate ./...
For interfaces that are external to cli_tools, we run mockgen
directly.
For example, to update the mock for daisy.Logger
:
cd cli_tools/mocks
mockgen -package mocks -mock_names Logger=MockDaisyLogger \
github.com/GoogleCloudPlatform/compute-daisy Logger > mock_daisy_logger.go
Tips:
-mock_names
flag. Executing git diff
will help you to determine whether that flag is required.cli_tools/mocks
.cli_tools/common/image/importer/mocks/source_mocks.go
FAQs
Unknown package
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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.