adminapi

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKongClientForWorkspace

func GetKongClientForWorkspace(ctx context.Context, adminURL string, wsName string,
	httpclient *http.Client) (*kong.Client, error)

GetKongClientForWorkspace returns a Kong API client for a given root API URL and workspace. If the workspace does not already exist, GetKongClientForWorkspace will create it.

func MakeHTTPClient

func MakeHTTPClient(opts *HTTPClientOpts) (*http.Client, error)

MakeHTTPClient returns an HTTP client with the specified mTLS/headers configuration. BUG: This function overwrites the default transport and client in package http! This problem is being left as-is during refactoring to avoid regression of untested code. https://github.com/Kong/kubernetes-ingress-controller/issues/1233

Types

type HTTPClientOpts

type HTTPClientOpts struct {
	// Disable verification of TLS certificate of Kong's Admin endpoint.
	TLSSkipVerify bool
	// SNI name to use to verify the certificate presented by Kong in TLS.
	TLSServerName string
	// Path to PEM-encoded CA certificate file to verify Kong's Admin SSL certificate.
	CACertPath string
	// PEM-encoded CA certificate to verify Kong's Admin SSL certificate.
	CACert string
	// Array of headers added to every Admin API call.
	Headers []string
	// mTLS client certificate file for authentication.
	TLSClientCertPath string
	// mTLS client key file for authentication.
	TLSClientCert string
	// mTLS client certificate for authentication.
	TLSClientKeyPath string
	// mTLS client key for authentication.
	TLSClientKey string
}

HTTPClientOpts defines parameters that configure an HTTP client.

type HeaderRoundTripper

type HeaderRoundTripper struct {
	// contains filtered or unexported fields
}

HeaderRoundTripper injects Headers into requests made via RT.

func (*HeaderRoundTripper) RoundTrip

func (t *HeaderRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip satisfies the RoundTripper interface.

Jump to

Keyboard shortcuts

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