🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

www.commemorateforus.life/nlachfr/bifrost

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

www.commemorateforus.life/nlachfr/bifrost

Go
Version
v0.0.1
Version published
Created
Source

bifrost

A protobuf router and reverse proxy for services, with input validation capabilities

About

This project is still in alpha: APIs should be considered unstable and likely to change.

Bifrost is a reflective protobuf router and reverse proxy. It uses your protobuf definitions for dynamically generating the gateway and is able to check input based on user-defined rules (see protoc-gen-cel-validate for more details regarding rules).

It features :

  • gRPC, gRPC-web and connect protocols (binding and proxying)
  • protoc-gen-cel-validate validation rules
  • supports Go plugin for loading your custom rules

Installation

For installing bifrost, you can simply run the go install:

$ go install github.com/nlachfr/bifrost/cmd/bifrost

The binary will be placed in your $GOBIN location.

Configuration file

In order to use the gateway, you must provided a configuration file. It will allows you to :

  • define listening address and upstreams
  • specify proto files location
  • configure validation

All the configuration fields are specified in the bifrost.gateway.Configuration message specification.

Example

  • Create your configuration file
servers:
  - listen:
      - 127.0.0.1:8888
    upstreams:
      '*':
        address: https://demo.connect.build    
        protocol: grpc
files:
  sources:
    - proto/*.proto
  imports:
    - "."
validate:
  rule:
    servicerules:
      buf.connect.demo.eliza.v1.ElizaService:
        rule:
          programs:
            - expr: 'attribute_context.request.headers["ok"] == "ok"'      
      connect.ping.v1.PingService:
        rule:
          programs:
            - expr: 'attribute_context.request.headers["ok"] == "ok"'
  • Call bifrost with your newly created configuration
$ bifrost -config ./config.yml

FAQs

Package last updated on 30 Mar 2023

Did you know?

Socket

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