Documentation
¶
Index ¶
- Constants
- Variables
- func CreateSessionUsingPassword(t *testing.T, authAttempts service.AuthAttemptService, ...) (*domain.Session, error)
- func MustMarshal(t *testing.T, v any) string
- func MustUnmarshal[T any](t *testing.T, bs []byte) *T
- type ApiClient
- type FakeSecuritySource
- type Harness
- func (h *Harness) CreateUserSchema(t *testing.T, project *domain.Project, schema string) string
- func (h *Harness) EnsureAnyTokenVerifier(t *testing.T) *tokengen.AnyTokenTypeVerifier
- func (h *Harness) EnsureAuthAttemptRepo(t *testing.T) domain.AuthAttemptRepository
- func (h *Harness) EnsureAuthAttemptService(t *testing.T) service.AuthAttemptService
- func (h *Harness) EnsureCreateUserHandler(t *testing.T) *service.FlowCreateUserWithPasswordHandler
- func (h *Harness) EnsureCrypter(t *testing.T) crypto.Crypter
- func (h *Harness) EnsureDBPool(t *testing.T) database.Pool
- func (h *Harness) EnsureDecrypter(t *testing.T) crypto.Decrypter
- func (h *Harness) EnsureEncrypter(t *testing.T) crypto.Encrypter
- func (h *Harness) EnsureEncryptionKey(t *testing.T) [32]byte
- func (h *Harness) EnsureFlowCreateUserForPasskeyHandler(t *testing.T) *service.FlowCreateUserForPasskeyHandler
- func (h *Harness) EnsureFlowDefinitionRepo(t *testing.T) domain.FlowDefinitionRepository
- func (h *Harness) EnsureFlowDefinitionService(t *testing.T) service.FlowDefinitionService
- func (h *Harness) EnsureFlowService(t *testing.T) service.FlowService
- func (h *Harness) EnsureFlowStateMachine(t *testing.T) *domain.FlowStateMachineRuntime
- func (h *Harness) EnsureGeneratedServer(t *testing.T) *generated.Server
- func (h *Harness) EnsureHandler(t *testing.T) *api.Handler
- func (h *Harness) EnsureHashValidator(t *testing.T) crypto.HashValidator
- func (h *Harness) EnsureHashVerifier(t *testing.T) crypto.HashVerifier
- func (h *Harness) EnsureHasher(t *testing.T) crypto.Hasher
- func (h *Harness) EnsureHttpClient(t *testing.T) *http.Client
- func (h *Harness) EnsureJWTGenerator(t *testing.T) *tokengen.JWTGenerator
- func (h *Harness) EnsureJoseSigner(t *testing.T) jose.Signer
- func (h *Harness) EnsureOpaqueTokenGenerator(t *testing.T) *tokengen.OpaqueTokenGenerator
- func (h *Harness) EnsurePasskeyRegistrationService(t *testing.T) *service.PasskeyRegistrationService
- func (h *Harness) EnsureProjectRepo(t *testing.T) domain.ProjectRepository
- func (h *Harness) EnsureProjectService(t *testing.T) service.ProjectService
- func (h *Harness) EnsureSchemaRepo(t *testing.T) domain.JSONSchemaRepository
- func (h *Harness) EnsureSchemaResolver(t *testing.T) *domain.JSONSchemaResolver
- func (h *Harness) EnsureSchemaService(t *testing.T) *service.SchemaService
- func (h *Harness) EnsureSchemaValidator(t *testing.T) *domain.SchemaValidator
- func (h *Harness) EnsureSecretGenerator(t *testing.T) secrets.Generator
- func (h *Harness) EnsureSecurityHandler(t *testing.T) *api.SecurityHandler
- func (h *Harness) EnsureSessionRepo(t *testing.T) domain.SessionRepository
- func (h *Harness) EnsureSessionService(t *testing.T) service.SessionService
- func (h *Harness) EnsureSigningKey(t *testing.T) *rsa.PrivateKey
- func (h *Harness) EnsureTeamRepo(t *testing.T) domain.TeamRepository
- func (h *Harness) EnsureTeamService(t *testing.T) *service.TeamService
- func (h *Harness) EnsureTestServer(t *testing.T) *httptest.Server
- func (h *Harness) EnsureUserPasskeyRepo(t *testing.T) domain.UserPasskeyRepository
- func (h *Harness) EnsureUserPasswordRepo(t *testing.T) domain.UserPasswordRepository
- func (h *Harness) EnsureUserRepo(t *testing.T) domain.UserRepository
- func (h *Harness) EnsureUserService(t *testing.T) *service.UserService
Constants ¶
View Source
const BuiltinSchemaBaseURL = "https://test.example.schemas.com/schemas"
Variables ¶
View Source
var Connector database.Connector
Functions ¶
Types ¶
type ApiClient ¶
func NewApiClient ¶
func (*ApiClient) SetPassword ¶
func (*ApiClient) SetUsername ¶
type FakeSecuritySource ¶
type FakeSecuritySource struct {
Token string
Scopes []string
Username string
Password string
Roles []string
}
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 {
EncryptionKey []byte
SigningKey *rsa.PrivateKey
DBPool database.Pool
HttpClient *http.Client
TestServer *httptest.Server
Hasher *crypto.PasswapHasher
Crypter crypto.Crypter
SecretGenerator secrets.Generator
JWTGenerator *tokengen.JWTGenerator
OpaqueTokenGenerator *tokengen.OpaqueTokenGenerator
TokenVerifier *tokengen.AnyTokenTypeVerifier
JoseSigner jose.Signer
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
}
func (*Harness) CreateUserSchema ¶
func (*Harness) EnsureAnyTokenVerifier ¶
func (h *Harness) EnsureAnyTokenVerifier(t *testing.T) *tokengen.AnyTokenTypeVerifier
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) *service.FlowCreateUserWithPasswordHandler
func (*Harness) EnsureFlowCreateUserForPasskeyHandler ¶
func (h *Harness) EnsureFlowCreateUserForPasskeyHandler(t *testing.T) *service.FlowCreateUserForPasskeyHandler
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 (*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) EnsureJWTGenerator ¶
func (h *Harness) EnsureJWTGenerator(t *testing.T) *tokengen.JWTGenerator
func (*Harness) EnsureOpaqueTokenGenerator ¶
func (h *Harness) EnsureOpaqueTokenGenerator(t *testing.T) *tokengen.OpaqueTokenGenerator
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 (*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) EnsureSigningKey ¶
func (h *Harness) EnsureSigningKey(t *testing.T) *rsa.PrivateKey
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 (*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
Click to show internal directories.
Click to hide internal directories.