httpauth

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 6 Imported by: ? 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

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	// SetAuth sets authentication on the request.
	//
	// Returns true if authentication successfully set.
	// Does nothing and returns false if no authentication available for the given request.
	// Does nothing and returns false if the request scheme is not https.
	SetAuth(envContainer app.EnvContainer, request *http.Request) (bool, error)
}

Authenticator adds authentication to request.

This could be instead replaced with a http.RoundTripper workflow, however this means we have to use the same http.Client, and we generally pass EnvContainers to functions right now, and not building objects with EnvContainers, so this would not fit in with the rest of this codebase. This should be re-evaluated though.

func NewEnvAuthenticator

func NewEnvAuthenticator(usernameKey string, passwordKey string) Authenticator

NewEnvAuthenticator returns a new env Authenticator for the environment.

func NewMultiAuthenticator

func NewMultiAuthenticator(authenticators ...Authenticator) Authenticator

NewMultiAuthenticator returns a new multi Authenticator.

Stops on first matching SetAuth request.

func NewNetrcAuthenticator

func NewNetrcAuthenticator() Authenticator

NewNetrcAuthenticator returns a new netrc Authenticator.

func NewNopAuthenticator

func NewNopAuthenticator() Authenticator

NewNopAuthenticator returns a new nop Authenticator.

Always returns false and nil.

Jump to

Keyboard shortcuts

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