testutil

package
v0.0.0-...-82d3590 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AdminUser = FixtureUser{
		ID:        "ebf1ee29-ef5a-4aa9-8e7a-121fbcfc90bc",
		AccountID: "19ecfd4a-caf1-4ac9-91d7-21973fc9de31",
		Email:     "admin@gosign.local",
		Name:      "Admin User",
		Role:      models.UserRoleAdmin,
	}
	User1 = FixtureUser{
		ID:        "ef3a3b04-4d81-40a7-a387-cc572f68e23d",
		AccountID: "375507c0-2d39-4d80-915a-6e89522915a7",
		Email:     "user1@gosign.local",
		Name:      "User One",
		Role:      models.UserRoleUser,
	}
	User2 = FixtureUser{
		ID:        "b57349ba-8ce0-4606-a87b-c20a2848a0b2",
		AccountID: "c53aed39-0f8e-4926-843e-84db4a48de5c",
		Email:     "user2@gosign.local",
		Name:      "User Two",
		Role:      models.UserRoleUser,
	}
)

Functions

func AuthMiddleware

func AuthMiddleware(user FixtureUser) fiber.Handler

AuthMiddleware injects auth locals for handler tests.

func NewTestDB

func NewTestDB(t *testing.T) *pgxpool.Pool

NewTestDB creates isolated pgxpool backed by pgtestdb clone DB. It skips tests gracefully when test postgres is unavailable.

Types

type FixtureUser

type FixtureUser struct {
	ID             string
	AccountID      string
	OrganizationID string
	Email          string
	Name           string
	Role           models.UserRole
}

FixtureUser describes an authenticated fixture principal.

Jump to

Keyboard shortcuts

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