authn

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package authn defines the middleware and functions to authenticate HTTP requests.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnauthenticated = errors.New("unauthenticated")

ErrUnauthenticated represents a unauthenticated context error.

Functions

func AuthMiddleware

func AuthMiddleware[T any](authManager *auth.RelyAuthManager) func(http.Handler) http.Handler

AuthMiddleware authenticates requests and extracts sessions variables from the authenticated credentials.

func GetAuthContext

func GetAuthContext[T any](ctx context.Context) (T, error)

GetAuthContext gets the authenticated session from context.

func NewAuthContext

func NewAuthContext(parentContext context.Context, value any) context.Context

NewAuthContext creates a new context with an authenticated session.

Types

This section is empty.

Jump to

Keyboard shortcuts

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