middleware

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gzip

func Gzip(inner http.Handler) http.Handler

Gzip is a middleware to enabling GZIP on HTTP requests

func IncomingWebhookAuth

func IncomingWebhookAuth(inner http.Handler) http.Handler

IncomingWebhookAuth is a middleware to checks HTTP request with API key of an incoming webhook

func IsAdmin

func IsAdmin(next http.Handler) http.Handler

IsAdmin is a middleware to limit access to administrators

func Logger

func Logger(next http.Handler) http.Handler

Logger is a middleware to log HTTP request

func MockAuth

func MockAuth(inner http.Handler) http.Handler

MockAuth is a middleware to mock HTTP request credentials

func ProxyAuth

func ProxyAuth(inner http.Handler) http.Handler

ProxyAuth is a middleware to checks HTTP request credentials from proxied headers

Types

type Middleware

type Middleware func(inner http.Handler) http.Handler

Middleware function definition

func Auth

func Auth(method string) Middleware

Auth is a middleware to authenticate HTTP request

func BasicAuth

func BasicAuth(location string) Middleware

BasicAuth is a middleware to checks HTTP request credentials from Basic AuthN method

func Cors

func Cors(allowOrigin string) Middleware

Cors is a middleware to enabling CORS on HTTP requests

func Methods

func Methods(methods ...string) Middleware

Methods is a middleware to check that the request use the correct HTTP method

func OpenIDConnectJWTAuth

func OpenIDConnectJWTAuth(authority string) Middleware

OpenIDConnectJWTAuth is a middleware to checks HTTP request with a valid JWT

func RateLimiting

func RateLimiting(name string, conf config.RateLimiting) Middleware

RateLimiting is a middleware to limite usage of an endpoint

func Tracing

func Tracing(nextRequestID func() string) Middleware

Tracing is a middleware to trace HTTP request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL