auth

package
v2.0.0-...-1b98e1c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (

	// DefaultDialerTimeout limits the time spent establishing a TCP connection
	DefaultDialerTimeout = 10 * time.Second
)

Variables

This section is empty.

Functions

func DumpRequest

func DumpRequest(req *http.Request, body bool) ([]byte, error)

DumpRequest was copied from httputil.DumpRequest to remove the Host, Authorization, and User-Agent headers

Types

type Credentials

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

func NewCredentials

func NewCredentials(p *conf.Poller, logger *slog.Logger) *Credentials

func (*Credentials) Expire

func (c *Credentials) Expire()

Expire will reset the credential schedule if the receiver has a CredentialsScript Otherwise it will do nothing. Resetting the schedule will cause the next call to Password to fetch the credentials

func (*Credentials) GetPollerAuth

func (c *Credentials) GetPollerAuth() (PollerAuth, error)

func (*Credentials) Transport

func (c *Credentials) Transport(request *http.Request, poller *conf.Poller) (http.RoundTripper, error)

type PollerAuth

type PollerAuth struct {
	Username             string
	Password             string
	AuthToken            string
	IsCert               bool
	HasCredentialScript  bool
	HasCertificateScript bool
	Schedule             string
	PemCert              []byte
	PemKey               []byte
	CertPath             string
	KeyPath              string
	CaCertPath           string
	// contains filtered or unexported fields
}

func (PollerAuth) Certificate

func (a PollerAuth) Certificate() (tls.Certificate, error)

type RoundTripFunc

type RoundTripFunc func(req *http.Request) (res *http.Response, err error)

func (RoundTripFunc) RoundTrip

func (rtf RoundTripFunc) RoundTrip(r *http.Request) (*http.Response, error)

type ScriptResponse

type ScriptResponse struct {
	Username  string `yaml:"username"`
	Data      string `yaml:"password"`
	AuthToken string `yaml:"authToken"`
}

Jump to

Keyboard shortcuts

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