A customized middleware of DAPR.

dapr-middleware-http-filter

a customized filter middleware of DAPR.

filter 集成测试步骤

  1. 运行 webserver.go。 端口8001,只能通过IP访问,不能使用localhost,127.0.0.1访问。
  2. filter yaml的filter_url 指向上一步的webserver的地址。
  3. postman 访问 filter部署到的dapr环境。

Docker Image的创建备注: 命令: make docker-build

  1. env
    export DAPR_REGISTRY=gatty.pcauto export DAPR_TAG=dev (a.本地设置了gatty.pcauto, 通过本地镜像,直接在k8s运行, 在dapr用户build, 导到gatty用户minik8s 运行. )

b.dapr用户是使用host方式运行dapr,开发和调试的. c.在k8s上部署自己定制dapr的middleware时,只需修改业务微服务上的dapr sidecar-image的注入就可以了,dapr-system namespace下面的DAPR 原始deploy是不需要任何修改的。 d.业务微服务注入包含了filter的daprd的写法: annotations: dapr.io/sidecar-image: gatty.pcauto:dev... dapr.io/sidecar-listen-addresses: 0.0.0.0

  1. docker 设置 sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf

[Service] Environment="HTTP_PROXY=192.168.11.210:9090" "HTTPS_PROXY=192.168.11.210:9090" "NO_PROXY=localhost,127.0.0.1,192.168.49.2"

启动minikube 时,如果要访问墙外url,加上proxy env, 再启动minikube。

export HTTP_PROXY=http://192.168.11.210:9090 export HTTPS_PROXY=http://192.168.11.210:9090 export NO_PROXY=localhost,127.0.0.1,192.168.49.2(缺省已经有了,可以不运行)

  1. 注意: 自定义http的header时, 不能使用"_", 应该使用"-", 这个才有更好兼容性,否则会给过滤掉。 例如"Test-Header-Key"。
Similar Resources

Go HTTP middleware to filter clients by IP

Go HTTP middleware to filter clients by IP

Oct 30, 2022

Chi ip banner is a chi middleware that bans some ips from your Chi http server.

Chi Ip Banner Chi ip banner is a chi middleware that bans some ips from your Chi http server. It reads a .txt file in your project's root, called bani

Jan 4, 2022

URL Rewrite middleware for gin

Url Rewrite middleware for gin Example In this exable these urls use the same route http://localhost:1234/test-me http://localhost:1234/index.php/test

Sep 15, 2022

Gin middleware for session.

wsession Gin middleware for session management with multi-backend support: cookie-based Redis memstore Usage Start using it Download and install it: g

Jan 9, 2022

Fiber middleware for server-timing

Server Timing This is a Fiber middleware for the [W3C Server-Timing API] based on mitchellh/go-server-timing

Feb 6, 2022

The Dapr CLI allows you to setup Dapr on your local dev machine or on a Kubernetes cluster

Dapr CLI The Dapr CLI allows you to setup Dapr on your local dev machine or on a

Dec 23, 2021

Make Highly Customized Boxes for your CLI

Make Highly Customized Boxes for your CLI

Box CLI Maker 📦 Box CLI Maker is a Highly Customized Terminal Box Creator. Features Make Terminal Box in 8️⃣ inbuilt different styles 16 Inbuilt Colo

Jan 1, 2023

cpuworker - A Customized Goroutine Scheduler over Golang Runtime

cpuworker - A Customized Goroutine Scheduler over Golang Runtime

cpuworker Status Working in process. Run the Demo Make sure the GOMAXPROCS is bigger than 1 and there is at least GOMAXPROCS physical OS threads avail

Dec 6, 2022

BlueBot is an open-source trading bot that can be customized to handle specific investment strategies.

BlueBot Quick Note BlueBot and all mentioned services are free to use, including supported financial APIs. Overview BlueBot is a self-healing trading

Sep 7, 2022

Kitex byte-dance internal Golang microservice RPC framework with high performance and strong scalability, customized extensions for byte internal.

Kitex byte-dance internal Golang microservice RPC framework with high performance and strong scalability, customized extensions for byte internal.

Kitex 字节跳动内部的 Golang 微服务 RPC 框架,具有高性能、强可扩展的特点,针对字节内部做了定制扩展。

Jan 9, 2023

A customized GORM logger that implements the appropriate interface and uses Logrus to output logs

CryptoMath GORM Logger A customized GORM logger that implements the appropriate interface and uses Logrus to output logs. Install go get github.com/ma

Nov 6, 2021

A customized go list with index, sort, append, pop, count, clear and last item methods

golist A customized go list with index, sort, append, pop, count, clear and last item methods About The list data type has some more methods. Here are

Mar 6, 2022

Dapr is a portable, event-driven, runtime for building distributed applications across cloud and edge.

Dapr is a portable, event-driven, runtime for building distributed applications across cloud and edge.

Dapr is a portable, serverless, event-driven runtime that makes it easy for developers to build resilient, stateless and stateful microservices that run on the cloud and edge and embraces the diversity of languages and developer frameworks.

Jan 5, 2023

Collection of personal Dapr demos (bindings, state, pub/sub, service-to-service invocation)

Dapr demos Collection of personal Dapr demos. Note, some of these demos require latest version of Dapr, Ingress gateway, Observability components, or

Dec 10, 2022

A template project to demonstrate how to run WebAssembly functions as sidecar microservices in dapr

A template project to demonstrate how to run WebAssembly functions as sidecar microservices in dapr

Live Demo 1. Introduction DAPR is a portable, event-driven runtime that makes it easy for any developer to build resilient, stateless and stateful app

Jan 3, 2023

"From Zero to Hero with Go and Dapr" presented at GopherCon 2021

From Zero to Hero with Go and Dapr Slides This is a Go application demonstrating the key features of Dapr with a few different approaches. My goal is

Dec 30, 2022

Gin-errorhandling - Gin Error Handling Middleware is a middleware for the popular Gin framework

Gin Error Handling Middleware Gin Error Handling Middleware is a middleware for

Sep 19, 2022

This package provides json web token (jwt) middleware for goLang http servers

jwt-auth jwt auth middleware in goLang. If you're interested in using sessions, checkout my sessions library! README Contents: Quickstart Performance

Dec 5, 2022

:closed_lock_with_key: Middleware for keeping track of users, login states and permissions

Permissions2 Middleware for keeping track of users, login states and permissions. Online API Documentation godoc.org Features and limitations Uses sec

Dec 31, 2022
Go http.Hander based middleware stack with context sharing

wrap Package wrap creates a fast and flexible middleware stack for http.Handlers. Features small; core is only 13 LOC based on http.Handler interface;

Apr 5, 2022
Minimalist net/http middleware for golang

interpose Interpose is a minimalist net/http middleware framework for golang. It uses http.Handler as its core unit of functionality, minimizing compl

Sep 27, 2022
Lightweight Middleware for net/http

MuxChain MuxChain is a small package designed to complement net/http for specifying chains of handlers. With it, you can succinctly compose layers of

Dec 10, 2022
Idiomatic HTTP Middleware for Golang

Negroni Notice: This is the library formerly known as github.com/codegangsta/negroni -- Github will automatically redirect requests to this repository

Jan 2, 2023
A tiny http middleware for Golang with added handlers for common needs.

rye A simple library to support http services. Currently, rye provides a middleware handler which can be used to chain http handlers together while pr

Jan 4, 2023
A Go middleware that stores various information about your web application (response time, status code count, etc.)

Go stats handler stats is a net/http handler in golang reporting various metrics about your web application. This middleware has been developed and re

Dec 10, 2022
gorilla/csrf provides Cross Site Request Forgery (CSRF) prevention middleware for Go web applications & services 🔒

gorilla/csrf gorilla/csrf is a HTTP middleware library that provides cross-site request forgery (CSRF) protection. It includes: The csrf.Protect middl

Jan 9, 2023
A collection of useful middleware for Go HTTP services & web applications 🛃

gorilla/handlers Package handlers is a collection of handlers (aka "HTTP middleware") for use with Go's net/http package (or any framework supporting

Dec 31, 2022
Simple middleware to rate-limit HTTP requests.

Tollbooth This is a generic middleware to rate-limit HTTP requests. NOTE 1: This library is considered finished. NOTE 2: Major version changes are bac

Dec 28, 2022
OpenID Connect (OIDC) http middleware for Go

Go OpenID Connect (OIDC) HTTP Middleware Introduction This is a middleware for http to make it easy to use OpenID Connect. Currently Supported framewo

Jan 1, 2023