Documentation ¶
Index ¶
- func AlmostEquals(actual, expect, offset int) bool
- func BackendTrafficPolicyMustBeAccepted(t *testing.T, client client.Client, policyName types.NamespacedName, ...)
- func SecurityPolicyMustBeAccepted(t *testing.T, client client.Client, policyName types.NamespacedName, ...)
- func WaitForPods(t *testing.T, cl client.Client, namespace string, selectors map[string]string, ...)
- type AddressMappings
- type CookieTracker
- type LoggingRoundTripper
- type OIDCTestClient
- func (o *OIDCTestClient) Get(url string, followDirection bool) (*http.Response, error)
- func (o *OIDCTestClient) Login(formData map[string]string) (*http.Response, error)
- func (o *OIDCTestClient) ParseLoginForm(responseBody io.ReadCloser, formID string) error
- func (o *OIDCTestClient) Send(req *http.Request, followRedirect bool) (*http.Response, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlmostEquals ¶
AlmostEquals We use a solution similar to istio: Given an offset, calculate whether the actual value is within the offset of the expected value
func BackendTrafficPolicyMustBeAccepted ¶
func BackendTrafficPolicyMustBeAccepted(t *testing.T, client client.Client, policyName types.NamespacedName, controllerName string, ancestorRef gwv1a2.ParentReference)
BackendTrafficPolicyMustBeAccepted waits for the specified BackendTrafficPolicy to be accepted. TODO (sh2): make it generic for xPolicy
func SecurityPolicyMustBeAccepted ¶
func SecurityPolicyMustBeAccepted(t *testing.T, client client.Client, policyName types.NamespacedName, controllerName string, ancestorRef gwv1a2.ParentReference)
SecurityPolicyMustBeAccepted waits for the specified SecurityPolicy to be accepted.
Types ¶
type AddressMappings ¶
type AddressMappings struct {
// contains filtered or unexported fields
}
AddressMappings is a custom dialer that resolves specific host:port to specific target addresses.
func (*AddressMappings) DialContext ¶
DialContext is a custom dialer that resolves specific host:port to specific target addresses.
type CookieTracker ¶
type CookieTracker struct { Delegate http.RoundTripper Cookies map[string]*http.Cookie }
CookieTracker is a http.RoundTripper that tracks cookies received from the server.
type LoggingRoundTripper ¶
type LoggingRoundTripper struct { LogFunc func(...any) LogBody bool Delegate http.RoundTripper }
LoggingRoundTripper is a http.RoundTripper that logs requests and responses.
type OIDCTestClient ¶
type OIDCTestClient struct {
// contains filtered or unexported fields
}
OIDCTestClient encapsulates a http.Client and keeps track of the state of the OIDC login process.
func NewOIDCTestClient ¶
func NewOIDCTestClient(opts ...Option) (*OIDCTestClient, error)
NewOIDCTestClient creates a new OIDCTestClient.
func (*OIDCTestClient) ParseLoginForm ¶
func (o *OIDCTestClient) ParseLoginForm(responseBody io.ReadCloser, formID string) error
ParseLoginForm parses the HTML response body to get the URL where the login page would post the user-entered credentials.
type Option ¶
type Option func(*OIDCTestClient) error
Option is a functional option for configuring the OIDCTestClient.
func WithCustomAddressMappings ¶
WithCustomAddressMappings configures the OIDCTestClient to resolve specific host:port to specific target addresses.
func WithLoggingOptions ¶
WithLoggingOptions configures the OIDCTestClient to log requests and responses.