Help us shape the future of Go! Take the 2026 Go Developer Survey

authhttp

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package authhttp provides the legacy net/http authorization adapter.

Deprecated: use github.com/faustbrian/go-authorization/v3/adapters/http. This package remains supported for the longer of 180 days after successor public availability and two subsequently published stable root-module minor releases.

Index

Constants

This section is empty.

Variables

View Source
var (
	// WithDeniedHandler preserves the released option function identity; nil keeps default denial handling.
	WithDeniedHandler = httpauth.WithDeniedHandler
	// WithErrorHandler preserves the released option function identity; nil keeps default failure handling.
	WithErrorHandler = httpauth.WithErrorHandler
)

Functions

func DecisionFromContext

func DecisionFromContext(ctx context.Context) (authorization.Decision, bool)

DecisionFromContext returns a decision by value with shared diagnostic slices.

func ErrorFromContext

func ErrorFromContext(ctx context.Context) (error, bool)

ErrorFromContext returns raw local failure state; callers own redaction before exposure.

func NewHandler

func NewHandler(
	authorizer Authorizer,
	mapper RequestMapper,
	next http.Handler,
	options ...Option,
) (http.Handler, error)

NewHandler delegates to the released HTTP facade and direct fail-closed adapter.

Types

type Authorizer

type Authorizer = httpauth.Authorizer

Authorizer is the released httpauth.Authorizer alias; identity is preserved.

type Option

type Option = httpauth.Option

Option configures construction synchronously; nil/custom options may panic.

type RequestMapper

type RequestMapper = httpauth.RequestMapper

RequestMapper maps trusted HTTP identity/scope/facts synchronously; authenticate upstream and do not trust client tenant/ownership claims.

Jump to

Keyboard shortcuts

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