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.
@ngx-grpc/core
Advanced tools
gRPC Angular code generator based on [grpc-web](https://github.com/grpc/grpc-web).
gRPC Angular code generator based on grpc-web.
Work in progress: breaking changes possible.
@deprecated
option for properties and rpc / methods. ExampleInstallation consists of two parts
Step 1. Install the plugin
npm i -g protoc-gen-ng
Step 2. Install protoc
if you have none yet: guide.
Install runtime dependencies:
npm i -S google-protobuf grpc-web
npm i -D @types/google-protobuf
google-protobuf
is required to encode / decode messagesgrpc-web
implements the transportDue to the browsers' limitations you would need to configure a special proxy in order to access your gRPC services.
Please configure your proxy according to grpc-web docs.
Add to your package.json
the following script:
"scripts": {
...
"proto:generate": "protoc --plugin=protoc-gen-grpc_ng --ng_out=<OUTPUT_PATH> -I <PROTO_DIR_PATH> <PROTO_FILES>"
...
}
Modify it as follows:
OUTPUT_PATH
- the path your code will be generatedPROTO_DIR_PATH
- the root path of your proto filesPROTO_FILES
- list of proto files to useExample:
"scripts": {
...
"proto:generate": "protoc --plugin=protoc-gen-grpc_ng --ng_out=./src/proto -I ../proto ../proto/*"
...
}
Every service has an injected configuration. You can create those services manually or use them as native Angular services.
To use them as Angular services, provide the configuration in your AppModule.
E.g. for a service TestServiceClient
you need to provide the GRPC_TEST_SERVICE_CLIENT_SETTINGS
:
@NgModule({
// ...
providers: [
// ...
// the name of the token can be found in corresponding service constructor
{ provide: GRPC_TEST_SERVICE_CLIENT_SETTINGS, useValue: { host: 'http://localhost:8080' } },
// or use value from environment.ts
// { provide: GRPC_TEST_SERVICE_CLIENT_SETTINGS, useValue: { host: environment.host } },
// ...
],
// ...
})
export class AppModule {
}
proto 3 grpc-web google-protobuf
MIT
FAQs
Angular gRPC framework: core package
The npm package @ngx-grpc/core receives a total of 3,127 weekly downloads. As such, @ngx-grpc/core popularity was classified as popular.
We found that @ngx-grpc/core 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.
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.