
Research
Security News
Malicious npm Packages Use Telegram to Exfiltrate BullX Credentials
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
github.com/braspagdevelopers/mock-server-client
Client for the mock-server.com product.
The focus of this library is to use within integration tests in order to verify if a specific request was made in a mocked dependency (the mock-server).
It is still work in progress.
Using go get
go get -u github.com/BraspagDevelopers/mock-server-client
Using go.mod
file
require github.com/BraspagDevelopers/mock-server-client
Import the package
import (
"github.com/BraspagDevelopers/mock-server-client"
)
The folowing verifies if the mock-server received requests matching the following filters:
POST
/api/categories
Environment: Development
name
had the value "Tools"
ms := mockserver.NewClient("localhost", 8080)
err := ms.Verify(
mockserver.RequestMatcher{
Method: http.MethodPost,
Path: "/api/categories"}.
WithHeader("Environment", "Development").
WithJsonFields(map[string]interface{}{
"name": "Tools",
}),
mockserver.Once())
You can clear the mock-server requests in the log that matches an specific RequestMatcher
using the method MockClient.Verify
.
err := ms.Verify(mockserver.RequestMatcher{
Method: http.MethodPost,
Path: "/api/categories"}.
WithHeader("Environment", "Development").
WithJsonFields(map[string]interface{}{
"name": "Tools",
}))
Notice that the cardinality is not specified in this request for this method. All matching requests will be erased from the log.
You can also verify and clear matching requests at once by using the method MockClient.VerifyAndClear()
.
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.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.
Security News
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.