middleware

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 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

Types

type Middleware

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

Middleware function definition

func Auth

func Auth(cfg config.AuthNConfig) Middleware

Auth is a middleware to authenticate HTTP request

func BasicAuth

func BasicAuth(cfg config.AuthNConfig) 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 OpenIDConnectAuth added in v1.2.0

func OpenIDConnectAuth(cfg config.AuthNConfig) Middleware

OpenIDConnectAuth is a middleware to checks HTTP request with a valid OIDC token

func ProxyAuth

func ProxyAuth(cfg config.AuthNConfig) Middleware

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

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