auth

package
v0.48.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package auth provides HTTP client authentication support.

Index

Constants

View Source
const None = "None"

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	Type() string
	User() string
	Password() string
	// Challenge is the values from "WWW-Authenticate" header
	Challenge([]string) Authenticator
	Authenticate(*http.Request)
}

Authenticator stub

var Anonymous Authenticator = &noAuth{}

func Basic

func Basic(user string, pw string) Authenticator

Basic provides HTTP basic authentication. See https://tools.ietf.org/html/rfc7617

func Deferred

func Deferred(user string, pw string) Authenticator

type DigestAuth

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

DigestAuth structure holds our credentials.

func Digest

func Digest(user string, pw string) *DigestAuth

Digest implements HTTP digest authentication. See https://tools.ietf.org/html/rfc7616 TODO finish this: it only supports MD5 and the tests are inadequate

func (*DigestAuth) Authenticate added in v0.44.0

func (d *DigestAuth) Authenticate(req *http.Request)

Authenticate the current request.

func (*DigestAuth) Challenge

func (d *DigestAuth) Challenge(ss []string) Authenticator

func (*DigestAuth) DigestParts

func (d *DigestAuth) DigestParts(wwwAuthenticateHeader string) Authenticator

func (*DigestAuth) Password

func (d *DigestAuth) Password() string

Password holds the DigestAuth password.

func (*DigestAuth) Type

func (d *DigestAuth) Type() string

Type identifies the Digest authenticator.

func (*DigestAuth) User

func (d *DigestAuth) User() string

User holds the DigestAuth username.

Jump to

Keyboard shortcuts

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