config

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRESTClient

func NewRESTClient(config RestConfigClient) (*perseshttp.RESTClient, error)

NewRESTClient create an instance of RESTClient using the config passed as parameter

func NewRoundTripper

func NewRoundTripper(timeout time.Duration, tlsConfig *secret.TLSConfig) (http.RoundTripper, error)

Types

type OAuth added in v0.49.0

type OAuth struct {
	// ClientID is the application's ID.
	ClientID string `json:"client_id" yaml:"client_id"`
	// ClientSecret is the application's secret.
	ClientSecret string `json:"client_secret" yaml:"client_secret"`
	// TokenURL is the resource server's token endpoint
	// URL. This is a constant specific to each server.
	TokenURL string `json:"token_url" yaml:"token_url"`
	// Scope specifies optional requested permissions.
	Scopes []string `json:"scopes" yaml:"scopes"`
	// EndpointParams specifies additional parameters for requests to the token endpoint.
	EndpointParams url.Values `json:"endpoint_params" yaml:"endpoint_params"`
	// AuthStyle optionally specifies how the endpoint wants the
	// client ID & client secret sent. The zero value means to
	// auto-detect.
	AuthStyle oauth2.AuthStyle `json:"auth_style" yaml:"auth_style"`
}

type PublicOAuth added in v0.49.0

type PublicOAuth struct {
	ClientID       secret.Hidden    `json:"client_id" yaml:"client_id"`
	ClientSecret   secret.Hidden    `json:"client_secret" yaml:"client_secret"`
	TokenURL       string           `json:"token_url" yaml:"token_url"`
	Scopes         []string         `json:"scopes" yaml:"scopes"`
	EndpointParams url.Values       `json:"endpoint_params" yaml:"endpoint_params"`
	AuthStyle      oauth2.AuthStyle `json:"auth_style" yaml:"auth_style"`
}

type PublicRestConfigClient

type PublicRestConfigClient struct {
	URL        *common.URL             `json:"url" yaml:"url"`
	NativeAuth *api.PublicAuth         `json:"native_auth,omitempty" yaml:"native_auth,omitempty"`
	Oauth      *PublicOAuth            `json:"oauth_config,omitempty" yaml:"oauth_config,omitempty"`
	BasicAuth  *secret.PublicBasicAuth `json:"basic_auth,omitempty" yaml:"basic_auth,omitempty"`
	// The HTTP authorization credentials for the targets.
	Authorization *secret.PublicAuthorization `json:"authorization,omitempty" yaml:"authorization,omitempty"`
	// TLSConfig to use to connect to the targets.
	TLSConfig *secret.PublicTLSConfig `json:"tls_config,omitempty" yaml:"tls_config,omitempty"`
	Headers   map[string]string       `json:"headers,omitempty" yaml:"headers,omitempty"`
}

PublicRestConfigClient is the struct that should be used when printing the config

func NewPublicRestConfigClient

func NewPublicRestConfigClient(config *RestConfigClient) *PublicRestConfigClient

type RestConfigClient

type RestConfigClient struct {
	URL        *common.URL       `json:"url" yaml:"url"`
	NativeAuth *api.Auth         `json:"native_auth,omitempty" yaml:"native_auth,omitempty"`
	OAuth      *OAuth            `json:"oauth,omitempty" yaml:"oauth,omitempty"`
	BasicAuth  *secret.BasicAuth `json:"basic_auth,omitempty" yaml:"basic_auth,omitempty"`
	// The HTTP authorization credentials for the targets.
	Authorization *secret.Authorization `json:"authorization,omitempty" yaml:"authorization,omitempty"`
	// TLSConfig to use to connect to the targets.
	TLSConfig *secret.TLSConfig `json:"tls_config,omitempty" yaml:"tls_config,omitempty"`
	Headers   map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"`
}

RestConfigClient defines all parameters that can be set to customize the RESTClient

func (*RestConfigClient) Validate added in v0.49.0

func (c *RestConfigClient) Validate() error

Jump to

Keyboard shortcuts

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