authentication

package
v2.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthModesKey = "authModes"
)

Variables

This section is empty.

Functions

func CreateHTTPRoundTripper added in v2.6.0

func CreateHTTPRoundTripper(roundTripperType TransportType, auth *AuthMeta, conf ...*HTTPTransport) (rt http.RoundTripper, err error)

func GetBearerToken added in v2.9.0

func GetBearerToken(auth *AuthMeta) string

func NewTLSConfig added in v2.9.0

func NewTLSConfig(auth *AuthMeta) (*tls.Config, error)

Types

type AuthMeta added in v2.6.0

type AuthMeta struct {
	// bearer auth
	EnableBearerAuth bool
	BearerToken      string

	// basic auth
	EnableBasicAuth bool
	Username        string
	Password        string // +optional

	// client certification
	EnableTLS bool
	Cert      string
	Key       string
	CA        string
}

func GetAuthConfigs added in v2.6.0

func GetAuthConfigs(triggerMetadata, authParams map[string]string) (out *AuthMeta, err error)

type HTTPTransport added in v2.6.0

type HTTPTransport struct {
	MaxIdleConnDuration time.Duration
	ReadTimeout         time.Duration
	WriteTimeout        time.Duration
}

type TransportType added in v2.6.0

type TransportType int

TransportType is type of http transport

const (
	NetHTTP  TransportType = iota // NetHTTP standard Go net/http client.
	FastHTTP                      // FastHTTP Fast http client.
)

type Type

type Type string

Type describes the authentication type used in a scaler

const (
	// APIKeyAuthType is a auth type using an API key
	APIKeyAuthType Type = "apiKey"
	// BasicAuthType is a auth type using basic auth
	BasicAuthType Type = "basic"
	// TLSAuthType is a auth type using TLS
	TLSAuthType Type = "tls"
	// BearerAuthType is a auth type using a bearer token
	BearerAuthType Type = "bearer"
)

Jump to

Keyboard shortcuts

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