Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultKratosImageName specifies the Kratos docker image name to use in tests. DefaultKratosImageName = "oryd/kratos" // DefaultKratosEnvVarImageName is the environment variable name for default Kratos docker image name. DefaultKratosEnvVarImageName = "TEST_ORY_KRATOS_IMAGE_NAME" // DefaultKratosImageVersion specifies the Kratos docker image version to use in tests. DefaultKratosImageVersion = "v0.5.5-alpha.1" // DefaultKratosEnvVarImageVersion is the environment variable name for default Kratos docker image version. DefaultKratosEnvVarImageVersion = "TEST_ORY_KRATOS_IMAGE_VERSION" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestEnvContext ¶
type TestEnvContext interface { AdminPort() string Cleanup() ClientAdmin() kratosAdmin.ClientService ClientPublic() kratosPublic.ClientService Pool() *dockertest.Pool PublicPort() string }
TestEnvContext represents a test Kratos environment context.
func SetupTestKratos ¶
func SetupTestKratos(t *testing.T, postgresCtx postgres.TestEnvContext, mailslurperCtx mailslurper.TestEnvContext, selfService TestSelfServiceConfiguration) TestEnvContext
SetupTestKratos sets up Kratos environment for tests.
type TestSelfService ¶
type TestSelfService interface { TestSelfServiceConfiguration // Closes any resources allocated by this server. Close() ServeHTTP(w http.ResponseWriter, r *http.Request) // InitBrowserRegistration() error // Handlers: SetDefaultHandler(func(http.ResponseWriter, *http.Request)) TestSelfService SetErrorHandler(func(http.ResponseWriter, *http.Request)) TestSelfService SetLoginHandler(func(http.ResponseWriter, *http.Request)) TestSelfService SetRecoveryHandler(func(http.ResponseWriter, *http.Request)) TestSelfService SetRegistrationHandler(func(http.ResponseWriter, *http.Request)) TestSelfService SetSettingsHandler(func(http.ResponseWriter, *http.Request)) TestSelfService SetVerificationHandler(func(http.ResponseWriter, *http.Request)) TestSelfService // Other setters: SetKratosTestEnvCtx(TestEnvContext) TestSelfService }
TestSelfService is the test default self service server.
func DefaultKratosTestSelfService ¶
func DefaultKratosTestSelfService(t *testing.T) TestSelfService
DefaultKratosTestSelfService returns an instance of the default self service provider.
type TestSelfServiceConfiguration ¶
type TestSelfServiceConfiguration interface { // URLs BasePublicURL() string DefaultBrowserReturnURL() string ErrorURL() string LoginURL() string RecoveryURL() string RegistrationURL() string SettingsURL() string VerificationURL() string WhitelistedReturnURLs() []string }
TestSelfServiceConfiguration defines a test Kratos selfservice handler.
Click to show internal directories.
Click to hide internal directories.