Documentation
¶
Index ¶
- func AddGitlabIDP(t *testing.T, kubeconfig *rest.Config) (idpURL, idpName string, cleanups []func())
- func CAOE2ETestLabels() map[string]string
- func CheckClusterOperatorStatus(t *testing.T, ctx context.Context, client configv1client.ConfigV1Interface, ...) (bool, []configv1.ClusterOperatorStatusCondition, error)
- func CleanIDPConfigByName(t *testing.T, configClient configv1client.OAuthInterface, idpName string)
- func GenerateOAuthTokenPair() (privToken, pubToken string)
- func GetIDPByName(config *osinv1.OsinServerConfig, name string) *osinv1.IdentityProvider
- func GitLabClientFor(t *testing.T, transport http.RoundTripper, gitlabURL string) *gitlabClient
- func GrabOAuthServerConfig(cmClient corev1client.ConfigMapsGetter) (*osinv1.OsinServerConfig, error)
- func IDPCleanupWrapper(cleanup func()) func()
- func NewClientConfigForTest(t *testing.T) *rest.Config
- func NewTestNamespaceBuilder(namePrefix string) *testNamespaceBuilder
- func SyncDefaultIngressCAToConfig(t *testing.T, cmClient corev1client.ConfigMapsGetter, name string) func()
- func WaitForClusterOperatorAvailableNotProgressingNotDegraded(t *testing.T, client configv1client.ConfigV1Interface, name string) error
- func WaitForClusterOperatorDegraded(t *testing.T, client configv1client.ConfigV1Interface, name string) error
- func WaitForClusterOperatorProgressing(t *testing.T, client configv1client.ConfigV1Interface, name string) error
- func WaitForClusterOperatorStatus(t *testing.T, client configv1client.ConfigV1Interface, name string, ...) error
- func WaitForClusterOperatorStatusAlwaysAvailable(t *testing.T, ctx context.Context, client configv1client.ConfigV1Interface, ...) error
- func WaitForClusterOperatorStatusStable(t *testing.T, ctx context.Context, client configv1client.ConfigV1Interface, ...) error
- func WaitForHTTPStatus(t *testing.T, waitDuration time.Duration, client *http.Client, ...) error
- func WaitForNewKASRollout(t *testing.T, ctx context.Context, ...) error
- func WaitForOperatorToPickUpChanges(t *testing.T, configClient configv1client.ConfigV1Interface, name string) error
- func WaitForRouteAdmitted(t *testing.T, client routev1client.RouteV1Interface, name, ns string) (string, error)
- type CryptoMaterials
- type KeycloakClient
- func (kc *KeycloakClient) AdminURL() string
- func (kc *KeycloakClient) AuthenticatePassword(clientID, clientSecret, name, password string) error
- func (kc *KeycloakClient) CreateClientGroupMapper(clientId, mapperName, groupsClaimName string) error
- func (kc *KeycloakClient) CreateGroup(groupName string) error
- func (kc *KeycloakClient) CreateUser(username, email, password string, groups []string, ...) error
- func (kc *KeycloakClient) DeleteUserFromGroups(userId string, groupIds ...string) error
- func (kc *KeycloakClient) GetClient(id string) (map[string]interface{}, error)
- func (kc *KeycloakClient) GetClientByClientID(clientID string) (map[string]interface{}, error)
- func (kc *KeycloakClient) GetUser(id string) (map[string]interface{}, error)
- func (kc *KeycloakClient) IssuerURL() string
- func (kc *KeycloakClient) ListClients() ([]map[string]interface{}, error)
- func (kc *KeycloakClient) ListUserGroups(id string) ([]map[string]interface{}, error)
- func (kc *KeycloakClient) ListUsers() ([]map[string]interface{}, error)
- func (kc *KeycloakClient) RegenerateClientSecret(id string) (string, error)
- func (kc *KeycloakClient) TokenURL() string
- func (kc *KeycloakClient) Tokens() (accessToken, idToken string)
- func (kc *KeycloakClient) UpdateClient(id string, changedFields map[string]interface{}) error
- func (kc *KeycloakClient) UpdateClientAccessTokenTimeout(id string, timeout int32) error
- func (kc *KeycloakClient) UpdateClientDirectAccessGrantsEnabled(id string, allow bool) error
- func (kc *KeycloakClient) UpdateUser(id string, changes map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddGitlabIDP ¶
func CAOE2ETestLabels ¶
labels for listing/deleting stuff by hand, e.g. NS or simple openshift-config NS CMs and Secrets cleanup
func CheckClusterOperatorStatus ¶
func CheckClusterOperatorStatus(t *testing.T, ctx context.Context, client configv1client.ConfigV1Interface, name string, requiredConditions ...configv1.ClusterOperatorStatusCondition) (bool, []configv1.ClusterOperatorStatusCondition, error)
func CleanIDPConfigByName ¶
func CleanIDPConfigByName(t *testing.T, configClient configv1client.OAuthInterface, idpName string)
func GenerateOAuthTokenPair ¶
func GenerateOAuthTokenPair() (privToken, pubToken string)
GenerateOAuthTokenPair returns two tokens to use with OpenShift OAuth-based authentication. The first token is a private token meant to be used as a Bearer token to send queries to the API, the second token is a hashed token meant to be stored in the database.
func GetIDPByName ¶
func GetIDPByName(config *osinv1.OsinServerConfig, name string) *osinv1.IdentityProvider
GetIDPByName returns a pointer to a copy of the identity provider of a name from the config.
func GitLabClientFor ¶
func GitLabClientFor(t *testing.T, transport http.RoundTripper, gitlabURL string) *gitlabClient
func GrabOAuthServerConfig ¶
func GrabOAuthServerConfig(cmClient corev1client.ConfigMapsGetter) (*osinv1.OsinServerConfig, error)
GrabOAuthServerConfig grabs the oauth-server configuration from the openshift-authenticat/v4-0-config-system-cliconfig configmap
func IDPCleanupWrapper ¶
func IDPCleanupWrapper(cleanup func()) func()
func NewClientConfigForTest ¶
NewClientConfigForTest returns a config configured to connect to the api server
func NewTestNamespaceBuilder ¶
func NewTestNamespaceBuilder(namePrefix string) *testNamespaceBuilder
func SyncDefaultIngressCAToConfig ¶
func SyncDefaultIngressCAToConfig(t *testing.T, cmClient corev1client.ConfigMapsGetter, name string) func()
SyncDefaultIngressCAToConfig synchronizes the openshift-config-managed/default-ingress-cert to the openshift-config NS as a CA suited for an IdP configuration. Useful when deploying an IDP behind a reencrypt/edge-termination route. Returns a cleanup function for the CM.
func WaitForClusterOperatorAvailableNotProgressingNotDegraded ¶
func WaitForClusterOperatorAvailableNotProgressingNotDegraded(t *testing.T, client configv1client.ConfigV1Interface, name string) error
func WaitForClusterOperatorDegraded ¶
func WaitForClusterOperatorDegraded(t *testing.T, client configv1client.ConfigV1Interface, name string) error
func WaitForClusterOperatorProgressing ¶
func WaitForClusterOperatorProgressing(t *testing.T, client configv1client.ConfigV1Interface, name string) error
func WaitForClusterOperatorStatus ¶
func WaitForClusterOperatorStatus(t *testing.T, client configv1client.ConfigV1Interface, name string, requiredConditions ...configv1.ClusterOperatorStatusCondition) error
func WaitForClusterOperatorStatusAlwaysAvailable ¶
func WaitForClusterOperatorStatusAlwaysAvailable(t *testing.T, ctx context.Context, client configv1client.ConfigV1Interface, name string) error
func WaitForClusterOperatorStatusStable ¶
func WaitForClusterOperatorStatusStable(t *testing.T, ctx context.Context, client configv1client.ConfigV1Interface, name string, requiredConditions ...configv1.ClusterOperatorStatusCondition) error
WaitForClusterOperatorStatusStable checks that the specified cluster operator's status does not diverge from the conditions specified for 10 minutes. It returns nil if all conditions were matching expectations for that period, and an error otherwise.
func WaitForHTTPStatus ¶
func WaitForNewKASRollout ¶
func WaitForNewKASRollout(t *testing.T, ctx context.Context, kasClient operatorv1client.KubeAPIServerInterface, origRevision int32) error
func WaitForOperatorToPickUpChanges ¶
func WaitForOperatorToPickUpChanges(t *testing.T, configClient configv1client.ConfigV1Interface, name string) error
func WaitForRouteAdmitted ¶
func WaitForRouteAdmitted(t *testing.T, client routev1client.RouteV1Interface, name, ns string) (string, error)
Types ¶
type CryptoMaterials ¶
type CryptoMaterials struct {
PrivateKey *rsa.PrivateKey
Certificate *x509.Certificate
}
func NewCertificateAuthorityCertificate ¶
func NewCertificateAuthorityCertificate(t *testing.T, parent *CryptoMaterials) *CryptoMaterials
NewCertificateAuthorityCertificate returns crypto materials for a certificate authority. If no parent certificate is specified, the generated certificate will be self-signed.
func NewServerCertificate ¶
func NewServerCertificate(t *testing.T, signer *CryptoMaterials, hosts ...string) *CryptoMaterials
NewServerCertificate returns crypto materials suitable for use by a server. The hosts specified will be added as subject alternate names.
type KeycloakClient ¶
type KeycloakClient struct {
// contains filtered or unexported fields
}
func AddKeycloakIDP ¶
func KeycloakClientFor ¶
func KeycloakClientFor(t *testing.T, transport http.RoundTripper, keycloakURL, keycloakRealm string) *KeycloakClient
KeycloakClientFor creates a Keycloak REST client for the default (master) realm using the supplied transport
func (*KeycloakClient) AdminURL ¶
func (kc *KeycloakClient) AdminURL() string
func (*KeycloakClient) AuthenticatePassword ¶
func (kc *KeycloakClient) AuthenticatePassword(clientID, clientSecret, name, password string) error
func (*KeycloakClient) CreateClientGroupMapper ¶
func (kc *KeycloakClient) CreateClientGroupMapper(clientId, mapperName, groupsClaimName string) error
func (*KeycloakClient) CreateGroup ¶
func (kc *KeycloakClient) CreateGroup(groupName string) error
func (*KeycloakClient) CreateUser ¶
func (*KeycloakClient) DeleteUserFromGroups ¶
func (kc *KeycloakClient) DeleteUserFromGroups(userId string, groupIds ...string) error
func (*KeycloakClient) GetClient ¶
func (kc *KeycloakClient) GetClient(id string) (map[string]interface{}, error)
GetClient retrieves a client based on its id (NOTE: id != clientID)
func (*KeycloakClient) GetClientByClientID ¶
func (kc *KeycloakClient) GetClientByClientID(clientID string) (map[string]interface{}, error)
func (*KeycloakClient) GetUser ¶
func (kc *KeycloakClient) GetUser(id string) (map[string]interface{}, error)
func (*KeycloakClient) IssuerURL ¶
func (kc *KeycloakClient) IssuerURL() string
func (*KeycloakClient) ListClients ¶
func (kc *KeycloakClient) ListClients() ([]map[string]interface{}, error)
GetClient retrieves a client based on its id (NOTE: id != name)
func (*KeycloakClient) ListUserGroups ¶
func (kc *KeycloakClient) ListUserGroups(id string) ([]map[string]interface{}, error)
func (*KeycloakClient) ListUsers ¶
func (kc *KeycloakClient) ListUsers() ([]map[string]interface{}, error)
func (*KeycloakClient) RegenerateClientSecret ¶
func (kc *KeycloakClient) RegenerateClientSecret(id string) (string, error)
func (*KeycloakClient) TokenURL ¶
func (kc *KeycloakClient) TokenURL() string
func (*KeycloakClient) Tokens ¶
func (kc *KeycloakClient) Tokens() (accessToken, idToken string)
func (*KeycloakClient) UpdateClient ¶
func (kc *KeycloakClient) UpdateClient(id string, changedFields map[string]interface{}) error
func (*KeycloakClient) UpdateClientAccessTokenTimeout ¶
func (kc *KeycloakClient) UpdateClientAccessTokenTimeout(id string, timeout int32) error
UpdateClientAccessTokenTimeout updates the timeout for a client of the given id timeout is a timeout in seconds
func (*KeycloakClient) UpdateClientDirectAccessGrantsEnabled ¶
func (kc *KeycloakClient) UpdateClientDirectAccessGrantsEnabled(id string, allow bool) error
UpdateClientDirectAccessGrantsEnabled updates the `directAccessGrantsEnabled` attribute of the client which influences whether the password grant is allowed via the client or not
func (*KeycloakClient) UpdateUser ¶
func (kc *KeycloakClient) UpdateUser(id string, changes map[string]interface{}) error