Skip to content

Working example of envoy external auth filter with go lang grpc service

Notifications You must be signed in to change notification settings

prakashchokalingam/envoy_ext_auth_grpc_go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screenshot 2023-06-20 at 10 16 03 PM

Example repo to demonstrate Envoy External Authorization with Golang GRPC service

This repository provides an envoy configuration file with an external auth filter activated for all incoming routes at port 8080

The envoy is configured with two clusters,

The filter envoy.filters.http.ext_authz in envoy is pointed at this go grpc cluster. All incoming requests will be forwarded to this cluster.

The Check method will be called during a request; it then adds a custom header to all other requests and rejects requests with the path '/private'.

Request grpc_filter status http_server_response
/ x-custom-header = "Hello World" 200 Hello World
/ private 403 - -

It is a straightforward Golang HTTP server that merely emits the custom header value x-custom-header added via the go_grpc_filter cluster.

To run this example

  1. Start the envoy server
envoy -c envoy.yml
  1. start the go_grpc_filter & go_simple_http servers by navigating to the cluster root.
go run main.go
  1. Go to http://localhost:8080

About

Working example of envoy external auth filter with go lang grpc service

Topics

Resources

Stars

Watchers

Forks

Languages