Documentation
¶
Index ¶
- func AddAuthHeaders(ctx context.Context, req *http.Request) error
- func Authenticate(output func(string), httpClient *http.Client, endpoint string, ...) (updatedConfig bool, err error)
- func ContextWithAuth(ctx context.Context, auth *auth.Config) (context.Context, error)
- func InitializeHTTPClient(auth *auth.Config) (*http.Client, error)
- type GatewayClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAuthHeaders ¶ added in v1.21.1
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
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.
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
Click to show internal directories.
Click to hide internal directories.