Documentation ¶
Index ¶
- Constants
- func CreateHTTPRoundTripper(roundTripperType TransportType, auth *AuthMeta, conf ...*HTTPTransport) (rt http.RoundTripper, err error)
- func GetBearerToken(auth *AuthMeta) string
- func NewTLSConfig(auth *AuthMeta, unsafeSsl bool) (*tls.Config, error)
- func ParseEndpointParams(inputStr string) (url.Values, error)
- func ParseScope(inputStr string) []string
- type AuthMeta
- type HTTPTransport
- type TransportType
- type Type
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 NewTLSConfig ¶ added in v2.9.0
func ParseEndpointParams ¶ added in v2.13.0
ParseEndpointParams parse OAuth endpoint params from URL-encoded query string.
func ParseScope ¶ added in v2.12.0
ParseScope parse OAuth scopes from a comma separated string whitespace is trimmed
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 // oAuth2 EnableOAuth bool OauthTokenURI string Scopes []string ClientID string ClientSecret string EndpointParams url.Values // custom auth header EnableCustomAuth bool CustomAuthHeader string CustomAuthValue string }
type HTTPTransport ¶ added in v2.6.0
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 an auth type using an API key APIKeyAuthType Type = "apiKey" // BasicAuthType is an auth type using basic auth BasicAuthType Type = "basic" // TLSAuthType is an auth type using TLS TLSAuthType Type = "tls" // BearerAuthType is an auth type using a bearer token BearerAuthType Type = "bearer" // CustomAuthType is an auth type using a custom header CustomAuthType Type = "custom" // OAuthType is an auth type using a oAuth2 OAuthType Type = "oauth" )
Click to show internal directories.
Click to hide internal directories.