Documentation
¶
Index ¶
- func CleanupTestUsers(_ *e2e.Harness, _ string, _ []TestUser) error
- func EnsureTestUsers(harness *e2e.Harness, namespace string, users []TestUser) error
- func Login(harness *e2e.Harness, user, password string) error
- func LoginToFlightctl(harness *e2e.Harness, token string) error
- func SwitchToUser(harness *e2e.Harness, username, password, organizationDisplayName string) error
- type AuthMethod
- type TestUser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupTestUsers ¶ added in v1.2.0
CleanupTestUsers is a no-op for pre-created users. It exists so suites can call it unconditionally in AfterSuite without branching.
func EnsureTestUsers ¶ added in v1.2.0
EnsureTestUsers verifies that the given pre-created users can log in successfully. Users and their role bindings are expected to already exist in the environment.
func LoginToFlightctl ¶ added in v1.2.0
LoginToFlightctl runs flightctl login --token and refreshes the harness client.
Types ¶
type AuthMethod ¶ added in v0.8.1
type AuthMethod int
const ( // AuthToken indicates authentication using an OpenShift or K8s token. AuthToken AuthMethod = iota // AuthUsernamePassword indicates authentication using a username and password. AuthUsernamePassword // AuthPAM indicates authentication using PAM (for Quadlet deployments) AuthPAM )
func LoginToAPIWithToken ¶
func LoginToAPIWithToken(harness *e2e.Harness) (AuthMethod, error)
LoginToAPIWithToken logs in as admin and persists the token.
func LoginToEnv ¶ added in v1.2.0
func LoginToEnv(harness *e2e.Harness, username, password, serverURL string) (string, AuthMethod, error)
LoginToEnv logs in to the environment (Quadlet / OpenShift / K8) with the given user and returns a token and auth method. serverURL is used only for OpenShift (oc login ... serverURL); empty for Quadlet/K8.
func LoginToEnvAsAdmin ¶ added in v1.2.0
func LoginToEnvAsAdmin(harness *e2e.Harness) (string, AuthMethod, error)
LoginToEnvAsAdmin returns an admin token and auth method for the current environment.