httpauth

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExternalAuthDisabled  = errors.New("external auth is not configured")
	ErrMissingSessionSecret  = errors.New("session secret is required")
	ErrInvalidSignature      = errors.New("invalid session signature")
	ErrInvalidAuthState      = errors.New("invalid auth state")
	ErrExpiredAuthState      = errors.New("expired auth state")
	ErrExpiredSession        = errors.New("expired session")
	ErrProviderAccessRevoked = errors.New("provider access revoked")
)

Functions

This section is empty.

Types

type Identity

type Identity struct {
	Provider string
	Subject  string
	Login    string
	Name     string
	Email    string
}

type ProviderMetadata

type ProviderMetadata struct {
	ID          string
	DisplayName string
}

type PublicStatus

type PublicStatus struct {
	Mode          string
	TokenEnabled  bool
	Provider      *ProviderMetadata
	Authenticated bool
	User          *Identity
	LoginURL      string
	LogoutURL     string
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(cfg config.APIConfig) *Service

func (*Service) AuthenticateRequest

func (s *Service) AuthenticateRequest(r *http.Request) (*Identity, bool)

func (*Service) Enabled

func (s *Service) Enabled() bool

func (*Service) HandleCallback

func (s *Service) HandleCallback(w http.ResponseWriter, r *http.Request) error

func (*Service) HandleLogin

func (s *Service) HandleLogin(w http.ResponseWriter, r *http.Request) error

func (*Service) HandleLogout

func (s *Service) HandleLogout(w http.ResponseWriter, r *http.Request)

func (*Service) HasExternalAuth

func (s *Service) HasExternalAuth() bool

func (*Service) Status

func (s *Service) Status(r *http.Request) PublicStatus

Jump to

Keyboard shortcuts

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