Documentation
¶
Index ¶
- func CreateClient(t *testing.T, opts ...sdk.Option) *sdk.HTTPClient
- func CreateClientWithCookie(t *testing.T, cookie *http.Cookie) *sdk.HTTPClient
- func FindRefreshCookie(t *testing.T, jar *cookiejar.Jar) *http.Cookie
- func GenerateTestCredentials(t *testing.T, name string) (string, string)
- func GetAccessToken(t *testing.T, user *UserClient) string
- func GetPermissionByName(t *testing.T, client *sdk.HTTPClient, scope iam.Scope) sdk.Permission
- func LoginUser(t *testing.T, client *sdk.HTTPClient, email, password string) *sdk.LoginResponse
- type UserClient
- func CreateAdminUser(t *testing.T, name string) *UserClient
- func CreateUserInTenant(t *testing.T, admin *UserClient, name string) *UserClient
- func CreateUserInTenantWithRoles(t *testing.T, admin *UserClient, name string, roleIDs []uuid.UUID) *UserClient
- func CreateVerifiedUser(t *testing.T, name string, opts ...sdk.Option) *UserClient
- func CreateVerifiedUserWithJar(t *testing.T, name string) (*UserClient, *cookiejar.Jar)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateClient ¶
CreateClient returns a fresh unauthenticated HTTP client
func CreateClientWithCookie ¶
CreateClientWithCookie creates an SDK client with a specific cookie set on the refresh path
func FindRefreshCookie ¶
FindRefreshCookie finds the refresh_token cookie in the jar
func GenerateTestCredentials ¶
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 via gRPC, 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 ¶
CreateVerifiedUser registers a user, verifies email via DB token extraction, and returns an authenticated client
func CreateVerifiedUserWithJar ¶
CreateVerifiedUserWithJar creates a verified user with a controllable cookie jar