login

package
v1.3.0-main Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

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
)

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.

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