login

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupTestUsers added in v1.2.0

func CleanupTestUsers(_ *e2e.Harness, _ string, _ []TestUser) error

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

func EnsureTestUsers(harness *e2e.Harness, namespace string, users []TestUser) error

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 Login added in v1.2.0

func Login(harness *e2e.Harness, user, password string) error

Login logs in to the cluster and flightctl API as the given user.

func LoginToFlightctl added in v1.2.0

func LoginToFlightctl(harness *e2e.Harness, token string) error

LoginToFlightctl runs flightctl login --token and refreshes the harness client.

func SwitchToUser added in v1.2.0

func SwitchToUser(harness *e2e.Harness, username, password, organizationDisplayName string) error

SwitchToUser logs in as username/password and sets the current organization to the org whose Spec.DisplayName matches organizationDisplayName (e.g. "flightctl").

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
	// AuthAAP indicates authentication using an AAP bearer token (for Quadlet AAP deployments)
	AuthAAP
)

func LoginToAPIWithToken

func LoginToAPIWithToken(harness *e2e.Harness) (AuthMethod, error)

LoginToAPIWithToken logs in as admin and persists the token.

func LoginToAPIWithTokenWithRetry added in v1.3.0

func LoginToAPIWithTokenWithRetry(harness *e2e.Harness, timeout time.Duration) (AuthMethod, error)

LoginToAPIWithTokenWithRetry retries LoginToAPIWithToken on transient network errors (EOF, connection refused) for up to the given timeout with exponential backoff. Use this after a service restart where the pod may be "Ready" in K8s before the API process is actually accepting TLS connections.

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.

type TestUser added in v1.2.0

type TestUser struct {
	Name string
	Role string
}

TestUser represents a pre-created user whose existence is verified before tests.

Jump to

Keyboard shortcuts

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