middleware

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDefaultAPIMiddleware

func CreateDefaultAPIMiddleware(
	oas *openapi3.T,
	auth AuthFunc,
) []echo.MiddlewareFunc

If auth is nil, no authentication is applied.

Types

type AuthFunc

type AuthFunc func(ctx context.Context, r *http.Request) error

AuthFunc validates the request. Return nil if valid, error if not. Only called for endpoints with security requirements in the OpenAPI spec. Endpoints with `security: []` bypass this entirely.

func BearerAuth

func BearerAuth(validate TokenValidator) AuthFunc

type TokenValidator

type TokenValidator func(ctx context.Context, token string) error

Jump to

Keyboard shortcuts

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