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

authhttp

package
v2.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: 3 Imported by: 0

Documentation

Overview

Package authhttp preserves the original HTTP authentication adapter import path. New code should import github.com/faustbrian/go-authentication/v2/adapters/http. Types are aliases and calls forward to the canonical adapter; ownership, parsing/provider caveats and lifecycle are identical, not separate implementations.

Deprecated: use github.com/faustbrian/go-authentication/v2/adapters/http.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatChallenge deprecated

func FormatChallenge(challenge authentication.Challenge) (string, error)

FormatChallenge serializes a challenge for a WWW-Authenticate field value.

Deprecated: use authenticationhttp.FormatChallenge.

func NewMiddleware deprecated

func NewMiddleware(extractor CredentialExtractor, authenticator authentication.Authenticator, options ...MiddlewareOption) (func(http.Handler) http.Handler, error)

NewMiddleware creates fail-closed authentication-only net/http middleware.

Deprecated: use authenticationhttp.NewMiddleware.

Types

type APIKeyOption deprecated

type APIKeyOption = authenticationhttp.APIKeyOption

APIKeyOption configures an API-key source.

Deprecated: use authenticationhttp.APIKeyOption.

func WithAPIKeyMaxBytes deprecated

func WithAPIKeyMaxBytes(maximum int) APIKeyOption

WithAPIKeyMaxBytes sets the inclusive API-key size bound.

Deprecated: use authenticationhttp.WithAPIKeyMaxBytes.

type BearerOption deprecated

type BearerOption = authenticationhttp.BearerOption

BearerOption configures a bearer source.

Deprecated: use authenticationhttp.BearerOption.

func WithBearerMaxBytes deprecated

func WithBearerMaxBytes(maximum int) BearerOption

WithBearerMaxBytes sets the inclusive bearer-token size bound.

Deprecated: use authenticationhttp.WithBearerMaxBytes.

func WithBearerPipe deprecated

func WithBearerPipe() BearerOption

WithBearerPipe permits the pipe character in an opaque bearer credential.

Deprecated: use authenticationhttp.WithBearerPipe.

type CredentialExtractor deprecated

type CredentialExtractor = authenticationhttp.CredentialExtractor

CredentialExtractor extracts one typed credential from an HTTP request.

Deprecated: use authenticationhttp.CredentialExtractor.

type Extractor deprecated

type Extractor = authenticationhttp.Extractor

Extractor rejects ambiguous credentials across all enabled sources.

Deprecated: use authenticationhttp.Extractor.

func NewExtractor deprecated

func NewExtractor(sources ...Source) (*Extractor, error)

NewExtractor creates an extractor from one or more explicit sources.

Deprecated: use authenticationhttp.NewExtractor.

type MiddlewareOption deprecated

type MiddlewareOption = authenticationhttp.MiddlewareOption

MiddlewareOption configures HTTP authentication middleware.

Deprecated: use authenticationhttp.MiddlewareOption.

func WithChallenges deprecated

func WithChallenges(challenges ...authentication.Challenge) MiddlewareOption

WithChallenges configures fallback challenges for authentication failures.

Deprecated: use authenticationhttp.WithChallenges.

func WithOptionalAnonymous deprecated

func WithOptionalAnonymous() MiddlewareOption

WithOptionalAnonymous permits anonymous access only when credentials are absent.

Deprecated: use authenticationhttp.WithOptionalAnonymous.

type Source deprecated

type Source = authenticationhttp.Source

Source is an explicitly enabled HTTP credential location.

Deprecated: use authenticationhttp.Source.

func APIKeyCookie deprecated

func APIKeyCookie(idCookie, keyCookie string, options ...APIKeyOption) Source

APIKeyCookie explicitly enables API-key extraction from two cookies.

Deprecated: use authenticationhttp.APIKeyCookie.

func APIKeyHeader deprecated

func APIKeyHeader(idHeader, keyHeader string, options ...APIKeyOption) Source

APIKeyHeader explicitly enables API-key extraction from two headers.

Deprecated: use authenticationhttp.APIKeyHeader.

func APIKeyQuery deprecated

func APIKeyQuery(idParameter, keyParameter string, options ...APIKeyOption) Source

APIKeyQuery explicitly enables API-key extraction from two query parameters.

Deprecated: credentials in URLs can be retained by logs, proxies, and browser history. Prefer authenticationhttp.APIKeyHeader for new designs.

func BasicAuthorization deprecated

func BasicAuthorization() Source

BasicAuthorization enables Basic extraction from the Authorization header.

Deprecated: use authenticationhttp.BasicAuthorization.

func BearerAuthorization deprecated

func BearerAuthorization(options ...BearerOption) Source

BearerAuthorization enables bearer extraction from the Authorization header.

Deprecated: use authenticationhttp.BearerAuthorization.

func BearerCookie deprecated

func BearerCookie(name string, options ...BearerOption) Source

BearerCookie explicitly enables bearer extraction from a cookie.

Deprecated: use authenticationhttp.BearerCookie.

func BearerQuery deprecated

func BearerQuery(name string, options ...BearerOption) Source

BearerQuery explicitly enables bearer extraction from a query parameter.

Deprecated: credentials in URLs can be retained by logs, proxies, and browser history. Prefer authenticationhttp.BearerAuthorization for new designs.

Jump to

Keyboard shortcuts

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