Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@ozonru/mountebank-grpc
Advanced tools
Readme
Custom gRPC protocol implementation for Mountebank. This works for unary/streaming/bidi requests as well as with Mountebank proxy functionality.
This makes use of nodejs and the google-protobuf and @grpc/proto-loader modules to generate gRPC descriptors from .proto files. This does not support reflection.
Install project:
npm install @ozonru/mountebank-grpc
Create protocols.json file for gRPC:
{
"grpc": {
"createCommand": "mb-grpc"
}
}
Start Mountebank with protocols file:
mb start --protofile protocols.json
To load a gRPC imposter (via POST http://<MB_SERVER>:<MB_PORT>/imposters
):
{
"protocol": "grpc",
"port": 4545,
"loglevel": "debug",
"recordRequests": true,
"_note_services": "need the name of the package, service and protofile location for this to load",
"services": {
"example.ExampleService": {
"file": "example.proto"
}
},
"options": {
"protobufjs": {
"_note": "any options to protobufjs",
"includeDirs": ["/path/to/include/protos", "/etc/mountebank/mountebank-grpc/src/protos"]
}
},
"stubs": [{
"predicates": [
{
"matches": { "path": "UnaryUnary" },
"caseSensitive": false
}
],
"responses": [
{
"is": {
"value": {
"_note": "gRPC mock unary call response",
"_note_streaming": "this is a unary/unary call, streaming requests need the value to be an array",
"id": 100,
"data": "mock response"
},
"metadata": {
"_note": "gRPC mock initial/trailing metadata response",
"initial": {
"metadata-initial-key": "metadata-initial-value"
},
"trailing": {
"metadata-trailing-key": "metadata-trailing-value"
}
},
"error": {
"_note": "gRPC mock error",
"status": "OUT_OF_RANGE",
"message": "invalid message"
}
}
}
]
}]
}
To load a gRPC proxy imposter:
{
"protocol": "grpc",
"port": 4546,
"loglevel": "debug",
"recordRequests": true,
"services": {
"example.ExampleService": {
"file": "/etc/mountebank/mountebank-grpc/src/protos/example.proto"
}
},
"stubs": [
{
"responses": [
{
"proxy": {
"to": "localhost:4545",
"mode": "proxyAlways",
"predicateGenerators": [{ "matches": {"path": true} }]
}
}
]
}
]
}
FAQs
gRPC client for mountebank
The npm package @ozonru/mountebank-grpc receives a total of 884 weekly downloads. As such, @ozonru/mountebank-grpc popularity was classified as not popular.
We found that @ozonru/mountebank-grpc demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.