setup

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 14 Imported by: 1 module, 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 CreateClient

func CreateClient(t *testing.T, opts ...sdk.Option) *sdk.HTTPClient

CreateClient returns a fresh unauthenticated HTTP client

func CreateClientWithCookie

func CreateClientWithCookie(t *testing.T, cookie *http.Cookie) *sdk.HTTPClient

CreateClientWithCookie creates an SDK client with a specific cookie set on the refresh path

func FindRefreshCookie

func FindRefreshCookie(t *testing.T, jar *cookiejar.Jar) *http.Cookie

FindRefreshCookie finds the refresh_token cookie in the jar

func GenerateTestCredentials

func GenerateTestCredentials(t *testing.T, name string) (string, string)

GenerateTestCredentials generates unique email and password using nanosecond timestamps

func GetAccessToken

func GetAccessToken(t *testing.T, user *UserClient) string

GetAccessToken logs in with a fresh client and returns the raw access token

func GetPermissionByName

func GetPermissionByName(t *testing.T, client *sdk.HTTPClient, scope iam.Scope) sdk.Permission

GetPermissionByName finds a permission by name from the permissions list

func LoginUser

func LoginUser(t *testing.T, client *sdk.HTTPClient, email, password string) *sdk.LoginResponse

LoginUser logs in and returns the response. Fails the test on error.

Types

type UserClient

type UserClient struct {
	Client   *sdk.HTTPClient
	UserID   uuid.UUID
	TenantID uuid.UUID
	Email    string
	Password string
}

UserClient holds an authenticated SDK client with user metadata

func CreateAdminUser

func CreateAdminUser(t *testing.T, name string) *UserClient

CreateAdminUser creates a verified user with all permissions granted via direct assignment

func CreateUserInTenant

func CreateUserInTenant(t *testing.T, admin *UserClient, name string) *UserClient

CreateUserInTenant creates a user in an existing tenant, verifies email, and logs in

func CreateUserInTenantWithRoles

func CreateUserInTenantWithRoles(t *testing.T, admin *UserClient, name string, roleIDs []uuid.UUID) *UserClient

CreateUserInTenantWithRoles creates a user with specific roles. NOT logged in (for MFA-required flows).

func CreateVerifiedUser

func CreateVerifiedUser(t *testing.T, name string, opts ...sdk.Option) *UserClient

CreateVerifiedUser registers a user, verifies email via DB token extraction, and returns an authenticated client

func CreateVerifiedUserWithJar

func CreateVerifiedUserWithJar(t *testing.T, name string) (*UserClient, *cookiejar.Jar)

CreateVerifiedUserWithJar creates a verified user with a controllable cookie jar

Jump to

Keyboard shortcuts

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