Socket
Socket
Sign inDemoInstall

rootle-grpc-interceptor

Package Overview
Dependencies
35
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rootle-grpc-interceptor

TS implementation of Rootle log gRPC clinet interceptor


Version published
Weekly downloads
38
decreased by-90.4%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Rootle gRPC client interceptor

Error log gRPC client uses Rootle log API to log gRPC errors.

Referer and User-Agent

gRPC interceptors has the incoming request as an input to tell the Rootle interceptor which filed in the incoming request should be used as referer and, useragent an interface of type InterceptorRequestSources must be passed to the Rootle constructor.

const requestHeaders = {
    useragent: "agent",
    referer:   "client",
}

The code above will tell the interceptor to look for field in the request named `Agent` to use it as a `useragent` and a field named `Clinet` to use it as a `referer`

Usage

import Rootle from 'rootle';
import Interceptor from 'rootle-grpc-interceptor';

const logger = new Rootle("ac12Cd-Aevd-12Grx-235f4", "billing-Lambda", {
referer: "client",
useragent: "agent"
});


new grpcService.GreeterClient(
    "localhost:6000",
    grpc.credentials.createInsecure(),
    {
        interceptors: [Interceptor],
    })

FAQs

Last updated on 24 Oct 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc