gateclient

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 29 Imported by: 45

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAuthHeaders added in v1.21.1

func AddAuthHeaders(ctx context.Context, req *http.Request) error

AddAuthHeaders will use the context variables to set via ContextWithAuth to add any necessary authentication headers to the request.

func Authenticate added in v1.21.1

func Authenticate(output func(string), httpClient *http.Client, endpoint string, auth *auth.Config) (updatedConfig bool, err error)

Authenticate is helper function to attempt to authenticate with OAuth2, Google Service Account or LDAP as configured in the auth.Config.

func ContextWithAuth added in v1.21.1

func ContextWithAuth(ctx context.Context, auth *auth.Config) (context.Context, error)

ContextWithAuth will set context variables that maybe necessary for IAP or Basic authentication per-request. This can be used in conjunction with AddAuthHeaders to ensure auth headers from the context are added to all requests.

func InitializeHTTPClient added in v1.21.1

func InitializeHTTPClient(auth *auth.Config) (*http.Client, error)

InitializeHTTPClient will return an *http.Client configured with optional TLS keys as specified in the auth.Config

Types

type GatewayClient

type GatewayClient struct {

	// Generate Gate Api client.
	*gate.APIClient

	// Spin CLI configuration.
	Config config.Config

	// Context for OAuth2 access token.
	Context context.Context
	// contains filtered or unexported fields
}

GatewayClient is the wrapper with authentication

func NewGateClient

func NewGateClient(ui output.Ui, gateEndpoint, defaultHeaders, configLocation string, ignoreCertErrors bool, ignoreRedirects bool, retryTimeout int) (*GatewayClient, error)

Create new spinnaker gateway client with flag

func (*GatewayClient) GateEndpoint

func (m *GatewayClient) GateEndpoint() string

func (*GatewayClient) RetryTimeout added in v1.30.0

func (m *GatewayClient) RetryTimeout() int

Jump to

Keyboard shortcuts

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