middleware

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package middleware provides Forge-compatible middleware for API key validation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIKeyAuth

func APIKeyAuth(eng *keysmith.Engine) func(http.Handler) http.Handler

APIKeyAuth returns middleware that validates API keys from the Authorization header (Bearer token) or X-API-Key header.

func RequireScopes

func RequireScopes(scopes ...string) func(http.Handler) http.Handler

RequireScopes returns middleware that checks the validated key has all of the specified scopes.

func ResultFromContext

func ResultFromContext(ctx context.Context) (*keysmith.ValidationResult, bool)

ResultFromContext extracts the ValidationResult from the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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