digest

package
v0.0.0-...-bbc9ce3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilTransport      = errors.New("transport is nil")
	ErrBadChallenge      = errors.New("challenge is bad")
	ErrAlgNotImplemented = errors.New("algorithm not implemented")
)

Functions

This section is empty.

Types

type Transport

type Transport struct {
	Username  string
	Password  string
	Transport http.RoundTripper
}

Transport is an implementation of http.RoundTripper that supports HTTP digest authentication.

func NewTransport

func NewTransport(username, password string) *Transport

NewTransport creates a new digest transport using http.DefaultTransport.

func (*Transport) RoundTrip

func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error)

RoundTrip makes a request expecting a 401 response that will require digest authentication. It creates the credentials it needs and makes a follow-up request.

Jump to

Keyboard shortcuts

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