helpers

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const BuiltinSchemaBaseURL = "https://test.example.schemas.com/schemas"

Variables

Functions

func CreateSessionUsingPassword

func CreateSessionUsingPassword(t *testing.T,
	authAttempts service.AuthAttemptService,
	sessionService service.SessionService,
	projectID string, userEmail string, userPassword string) (*domain.Session, error)

func MustMarshal

func MustMarshal(t *testing.T, v any) string

func MustUnmarshal

func MustUnmarshal[T any](t *testing.T, bs []byte) *T

Types

type AnonymousSecuritySource

type AnonymousSecuritySource struct {
}

func (AnonymousSecuritySource) OAuth2

func (f AnonymousSecuritySource) OAuth2(ctx context.Context, operationName api.OperationName) (api.OAuth2, error)

func (AnonymousSecuritySource) UsernamePassword

func (f AnonymousSecuritySource) UsernamePassword(ctx context.Context, operationName api.OperationName) (api.UsernamePassword, error)

type FakeSecuritySource

type FakeSecuritySource struct {
	// contains filtered or unexported fields
}

func (FakeSecuritySource) OAuth2

func (f FakeSecuritySource) OAuth2(ctx context.Context, operationName api.OperationName) (api.OAuth2, error)

func (FakeSecuritySource) UsernamePassword

func (f FakeSecuritySource) UsernamePassword(ctx context.Context, operationName api.OperationName) (api.UsernamePassword, error)

type Harness

type Harness struct {
	DBPool          database.Pool
	HttpClient      *http.Client
	TestServer      *httptest.Server
	Hasher          *crypto.PasswapHasher
	Crypter         crypto.Crypter
	SecretGenerator secrets.Generator

	GeneratedServer *generated.Server
	Handler         *api.Handler
	SecurityHandler *api.SecurityHandler

	SchemaService         *service.SchemaService
	SessionService        service.SessionService
	FlowService           service.FlowService
	AuthAttemptService    service.AuthAttemptService
	ProjectService        service.ProjectService
	FlowDefinitionService service.FlowDefinitionService
	UserService           *service.UserService
	FlowStateMachine      *domain.FlowStateMachineRuntime
	TeamService           *service.TeamService

	SchemaRepo         domain.JSONSchemaRepository
	SchemaResolver     *domain.JSONSchemaResolver
	SchemaValidator    *domain.SchemaValidator
	FlowDefinitionRepo domain.FlowDefinitionRepository
	AuthAttemptRepo    domain.AuthAttemptRepository
	SessionRepo        domain.SessionRepository
	ProjectRepo        domain.ProjectRepository
	UserRepo           domain.UserRepository
	UserPasswordRepo   domain.UserPasswordRepository
	UserPasskeyRepo    domain.UserPasskeyRepository
	TeamRepo           domain.TeamRepository

	TestData test_data.TestData
	// contains filtered or unexported fields
}

func (*Harness) CreateUserSchema

func (h *Harness) CreateUserSchema(t *testing.T, projectID string, schema string) string

func (*Harness) EnsureAPIClient

func (h *Harness) EnsureAPIClient(t *testing.T, projectID string) *api.Client

func (*Harness) EnsureAnonymousAPIClient

func (h *Harness) EnsureAnonymousAPIClient(t *testing.T) *api.Client

func (*Harness) EnsureAnonymousSecuritySource

func (h *Harness) EnsureAnonymousSecuritySource(t *testing.T) *FakeSecuritySource

func (*Harness) EnsureAuthAttemptRepo

func (h *Harness) EnsureAuthAttemptRepo(t *testing.T) domain.AuthAttemptRepository

func (*Harness) EnsureAuthAttemptService

func (h *Harness) EnsureAuthAttemptService(t *testing.T) service.AuthAttemptService

func (*Harness) EnsureCreateUserHandler

func (h *Harness) EnsureCreateUserHandler(t *testing.T) *domain.FlowCreateUserHandler

func (*Harness) EnsureCrypter

func (h *Harness) EnsureCrypter(t *testing.T) crypto.Crypter

func (*Harness) EnsureDBPool

func (h *Harness) EnsureDBPool(t *testing.T) database.Pool

func (*Harness) EnsureDecrypter

func (h *Harness) EnsureDecrypter(t *testing.T) crypto.Decrypter

func (*Harness) EnsureEncrypter

func (h *Harness) EnsureEncrypter(t *testing.T) crypto.Encrypter

func (*Harness) EnsureFakeSecuritySource

func (h *Harness) EnsureFakeSecuritySource(t *testing.T, projectID string) *FakeSecuritySource

func (*Harness) EnsureFlowDefinitionRepo

func (h *Harness) EnsureFlowDefinitionRepo(t *testing.T) domain.FlowDefinitionRepository

func (*Harness) EnsureFlowDefinitionService

func (h *Harness) EnsureFlowDefinitionService(t *testing.T) service.FlowDefinitionService

func (*Harness) EnsureFlowService

func (h *Harness) EnsureFlowService(t *testing.T) service.FlowService

func (*Harness) EnsureFlowStateMachine

func (h *Harness) EnsureFlowStateMachine(t *testing.T) *domain.FlowStateMachineRuntime

func (*Harness) EnsureGeneratedServer

func (h *Harness) EnsureGeneratedServer(t *testing.T) *generated.Server

func (*Harness) EnsureHandler

func (h *Harness) EnsureHandler(t *testing.T) *api.Handler

func (*Harness) EnsureHashValidator

func (h *Harness) EnsureHashValidator(t *testing.T) crypto.HashValidator

func (*Harness) EnsureHashVerifier

func (h *Harness) EnsureHashVerifier(t *testing.T) crypto.HashVerifier

func (*Harness) EnsureHasher

func (h *Harness) EnsureHasher(t *testing.T) crypto.Hasher

func (*Harness) EnsureHttpClient

func (h *Harness) EnsureHttpClient(t *testing.T) *http.Client

func (*Harness) EnsurePasskeyRegistrationService

func (h *Harness) EnsurePasskeyRegistrationService(t *testing.T) *service.PasskeyRegistrationService

func (*Harness) EnsureProjectRepo

func (h *Harness) EnsureProjectRepo(t *testing.T) domain.ProjectRepository

func (*Harness) EnsureProjectService

func (h *Harness) EnsureProjectService(t *testing.T) service.ProjectService

func (*Harness) EnsureSchemaRepo

func (h *Harness) EnsureSchemaRepo(t *testing.T) domain.JSONSchemaRepository

func (*Harness) EnsureSchemaResolver

func (h *Harness) EnsureSchemaResolver(t *testing.T) *domain.JSONSchemaResolver

func (*Harness) EnsureSchemaService

func (h *Harness) EnsureSchemaService(t *testing.T) *service.SchemaService

func (*Harness) EnsureSchemaValidator

func (h *Harness) EnsureSchemaValidator(t *testing.T) *domain.SchemaValidator

func (*Harness) EnsureSecretGenerator

func (h *Harness) EnsureSecretGenerator(t *testing.T) secrets.Generator

func (*Harness) EnsureSecurityHandler

func (h *Harness) EnsureSecurityHandler(t *testing.T) *api.SecurityHandler

func (*Harness) EnsureSessionRepo

func (h *Harness) EnsureSessionRepo(t *testing.T) domain.SessionRepository

func (*Harness) EnsureSessionService

func (h *Harness) EnsureSessionService(t *testing.T) service.SessionService

func (*Harness) EnsureTeamRepo

func (h *Harness) EnsureTeamRepo(t *testing.T) domain.TeamRepository

func (*Harness) EnsureTeamService

func (h *Harness) EnsureTeamService(t *testing.T) *service.TeamService

func (*Harness) EnsureTestServer

func (h *Harness) EnsureTestServer(t *testing.T) *httptest.Server

func (*Harness) EnsureUserPasskeyRepo

func (h *Harness) EnsureUserPasskeyRepo(t *testing.T) domain.UserPasskeyRepository

func (*Harness) EnsureUserPasswordRepo

func (h *Harness) EnsureUserPasswordRepo(t *testing.T) domain.UserPasswordRepository

func (*Harness) EnsureUserRepo

func (h *Harness) EnsureUserRepo(t *testing.T) domain.UserRepository

func (*Harness) EnsureUserService

func (h *Harness) EnsureUserService(t *testing.T) *service.UserService

Jump to

Keyboard shortcuts

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