Documentation ¶
Index ¶
- Variables
- func AddAndLoginIdentities(t *testing.T, reg *driver.RegistryDefault, public *httptest.Server, ...) map[string]*http.Client
- func AssertFieldMessage(t *testing.T, body []byte, fieldName string, message string)
- func AssertMessage(t *testing.T, body []byte, message string)
- func AssertNoCSRFCookieInResponse(t *testing.T, _ *httptest.Server, _ *http.Client, r *http.Response)
- func CheckE2EServerOnHTTP(t *testing.T, publicPort, adminPort int) (publicUrl, adminUrl string)
- func CheckE2EServerOnHTTPS(t *testing.T, publicPort, adminPort int) (publicUrl, adminUrl string)
- func CourierExpectCodeInMessage(t *testing.T, message *courier.Message, offset int) string
- func CourierExpectLinkInMessage(t *testing.T, message *courier.Message, offset int) string
- func CourierExpectMessage(ctx context.Context, t *testing.T, reg interface{ ... }, ...) *courier.Message
- func CreateSession(t *testing.T, reg driver.Registry) *session.Session
- func DefaultIdentitySchemaConfig(url string) map[string]any
- func EasyCookieJar(t *testing.T, o *cookiejar.Options) *cookiejar.Jar
- func EasyGet(t *testing.T, c *http.Client, url string) (*http.Response, []byte)
- func EasyGetBody(t *testing.T, c *http.Client, url string) []byte
- func EasyGetJSON(t *testing.T, c *http.Client, url string) (*http.Response, []byte)
- func EncodeFormAsJSON(t *testing.T, isApi bool, values url.Values) (payload string)
- func EnsureAAL(t *testing.T, c *http.Client, ts *httptest.Server, aal string, ...)
- func ExistingNetwork(t *testing.T, p persistence.Persister, id uuid.UUID) persistence.Persister
- func ExpectStatusCode(isAPI bool, api, browser int) int
- func ExpectURL(isAPI bool, api, browser string) string
- func GenerateTLSCertificateFilesForTests(t *testing.T) (certPath, keyPath, certBase64, keyBase64 string)
- func GetLoginFlow(t *testing.T, client *http.Client, ts *httptest.Server, flowID string) *kratos.LoginFlow
- func GetRecoveryFlow(t *testing.T, client *http.Client, ts *httptest.Server) *kratos.RecoveryFlow
- func GetRecoveryFlowForType(t *testing.T, client *http.Client, ts *httptest.Server, ft flow.Type) *kratos.RecoveryFlow
- func GetRegistrationFlow(t *testing.T, client *http.Client, ts *httptest.Server, flowID string) *kratos.RegistrationFlow
- func GetSelfServiceRedirectLocation(t *testing.T, url string) string
- func GetVerificationFlow(t *testing.T, client *http.Client, ts *httptest.Server) *kratos.VerificationFlow
- func HTTPPostForm(t *testing.T, client *http.Client, remote string, in *url.Values) ([]byte, *http.Response)
- func HTTPRequestJSON(t *testing.T, client *http.Client, method string, url string, in interface{}) ([]byte, *http.Response)
- func InitKratosServers(t *testing.T, reg driver.Registry, public, admin *httptest.Server)
- func InitializeLoginFlowViaAPI(t *testing.T, client *http.Client, ts *httptest.Server, forced bool, ...) *kratos.LoginFlow
- func InitializeLoginFlowViaAPIWithContext(t *testing.T, ctx context.Context, client *http.Client, ts *httptest.Server, ...) *kratos.LoginFlow
- func InitializeLoginFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server, forced bool, ...) *kratos.LoginFlow
- func InitializeRecoveryFlowViaAPI(t *testing.T, client *http.Client, ts *httptest.Server) *kratos.RecoveryFlow
- func InitializeRecoveryFlowViaBrowser(t *testing.T, client *http.Client, isSPA bool, ts *httptest.Server, ...) *kratos.RecoveryFlow
- func InitializeRegistrationFlowViaAPI(t *testing.T, client *http.Client, ts *httptest.Server) *kratos.RegistrationFlow
- func InitializeRegistrationFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server, isSPA bool, ...) *kratos.RegistrationFlow
- func InitializeSettingsFlowViaAPI(t *testing.T, client *http.Client, ts *httptest.Server) *kratos.SettingsFlow
- func InitializeSettingsFlowViaBrowser(t *testing.T, client *http.Client, isSPA bool, ts *httptest.Server) *kratos.SettingsFlow
- func InitializeVerificationFlowViaAPI(t *testing.T, client *http.Client, ts *httptest.Server) *kratos.VerificationFlow
- func InitializeVerificationFlowViaBrowser(t *testing.T, client *http.Client, isSPA bool, ts *httptest.Server) *kratos.VerificationFlow
- func JSONEq(t *testing.T, expected, actual interface{}, messageAndArgs ...interface{})
- func LogJSON(t *testing.T, v interface{})
- func LoginMakeRequest(t *testing.T, isAPI bool, isSPA bool, f *kratos.LoginFlow, hc *http.Client, ...) (string, *http.Response)
- func LoginMakeRequestWithContext(t *testing.T, ctx context.Context, isAPI bool, isSPA bool, f *kratos.LoginFlow, ...) (string, *http.Response)
- func MockHydrateCookieClient(t *testing.T, c *http.Client, u string) *http.Cookie
- func MockMakeAuthenticatedRequest(t *testing.T, reg mockDeps, conf *config.Config, router *httprouter.Router, ...) ([]byte, *http.Response)
- func MockMakeAuthenticatedRequestWithClient(t *testing.T, reg mockDeps, conf *config.Config, router *httprouter.Router, ...) ([]byte, *http.Response)
- func MockMakeAuthenticatedRequestWithClientAndID(t *testing.T, reg mockDeps, conf *config.Config, router *httprouter.Router, ...) ([]byte, *http.Response)
- func MockSessionCreateHandler(t *testing.T, reg mockDeps) (httprouter.Handle, *session.Session)
- func MockSessionCreateHandlerWithIdentity(t *testing.T, reg mockDeps, i *identity.Identity) (httprouter.Handle, *session.Session)
- func MockSessionCreateHandlerWithIdentityAndAMR(t *testing.T, reg mockDeps, i *identity.Identity, ...) (httprouter.Handle, *session.Session)
- func MockSetSession(t *testing.T, reg mockDeps, conf *config.Config) httprouter.Handle
- func MockSetSessionWithIdentity(t *testing.T, reg mockDeps, _ *config.Config, i *identity.Identity) httprouter.Handle
- func NewActiveSession(r *http.Request, reg interface{ ... }, i *identity.Identity, ...) (*session.Session, error)
- func NewClientWithCookieJar(t *testing.T, jar *cookiejar.Jar, checkRedirect CheckRedirectFunc) *http.Client
- func NewClientWithCookies(t *testing.T) *http.Client
- func NewDebugClient(t *testing.T) *http.Client
- func NewErrorTestServer(t *testing.T, reg interface{ ... }) *httptest.Server
- func NewFakeCSRFNode() *kratos.UiNode
- func NewHTTPClientWithArbitrarySessionCookie(t *testing.T, ctx context.Context, reg *driver.RegistryDefault) *http.Client
- func NewHTTPClientWithArbitrarySessionToken(t *testing.T, ctx context.Context, reg *driver.RegistryDefault) *http.Client
- func NewHTTPClientWithArbitrarySessionTokenAndTraits(t *testing.T, ctx context.Context, reg *driver.RegistryDefault, ...) *http.Client
- func NewHTTPClientWithIdentitySessionCookie(t *testing.T, ctx context.Context, reg *driver.RegistryDefault, ...) *http.Client
- func NewHTTPClientWithIdentitySessionCookieLocalhost(t *testing.T, ctx context.Context, reg *driver.RegistryDefault, ...) *http.Client
- func NewHTTPClientWithIdentitySessionToken(t *testing.T, ctx context.Context, reg *driver.RegistryDefault, ...) *http.Client
- func NewHTTPClientWithSessionCookie(t *testing.T, ctx context.Context, reg *driver.RegistryDefault, ...) *http.Client
- func NewHTTPClientWithSessionCookieLocalhost(t *testing.T, ctx context.Context, reg *driver.RegistryDefault, ...) *http.Client
- func NewHTTPClientWithSessionToken(t *testing.T, ctx context.Context, reg *driver.RegistryDefault, ...) *http.Client
- func NewHTTPDeleteJSONRequest(t *testing.T, url string, in interface{}) *http.Request
- func NewHTTPGetAJAXRequest(t *testing.T, url string) *http.Request
- func NewHTTPGetJSONRequest(t *testing.T, url string) *http.Request
- func NewHTTPTestServer(t *testing.T, h http.Handler) *httptest.Server
- func NewKratosServer(t *testing.T, reg driver.Registry) (public, admin *httptest.Server)
- func NewKratosServerWithCSRF(t *testing.T, reg driver.Registry) (public, admin *httptest.Server)
- func NewKratosServerWithCSRFAndRouters(t *testing.T, reg driver.Registry) (public, admin *httptest.Server, rp *x.RouterPublic, ra *x.RouterAdmin)
- func NewKratosServerWithRouters(t *testing.T, reg driver.Registry, rp *x.RouterPublic, ra *x.RouterAdmin) (public, admin *httptest.Server)
- func NewKratosServers(t *testing.T) (public, admin *httptest.Server)
- func NewLoginUIFlowEchoServer(t *testing.T, reg driver.Registry) *httptest.Server
- func NewLoginUIWith401Response(t *testing.T, c *config.Config) *httptest.Server
- func NewMethodSubmit(group, value string) *kratos.UiNode
- func NewNetwork(t testing.TB, ctx context.Context, p persistence.Persister) (uuid.UUID, persistence.Persister)
- func NewNetworkUnlessExisting(t *testing.T, ctx context.Context, p persistence.Persister) (uuid.UUID, persistence.Persister)
- func NewNoRedirectClientWithCookies(t *testing.T) *http.Client
- func NewNoRedirectHTTPClientWithArbitrarySessionCookie(t *testing.T, ctx context.Context, reg *driver.RegistryDefault) *http.Client
- func NewNoRedirectHTTPClientWithSessionCookie(t *testing.T, ctx context.Context, reg *driver.RegistryDefault, ...) *http.Client
- func NewPasswordNode() *kratos.UiNode
- func NewRecoveryUIFlowEchoServer(t *testing.T, reg driver.Registry) *httptest.Server
- func NewRedirNoSessionTS(t *testing.T, reg interface{ ... }) *httptest.Server
- func NewRedirSessionEchoTS(t *testing.T, reg interface{ ... }) *httptest.Server
- func NewRedirTS(t *testing.T, body string, conf *config.Config) *httptest.Server
- func NewRegistrationUIFlowEchoServer(t *testing.T, reg driver.Registry) *httptest.Server
- func NewRequest(t *testing.T, isAPI bool, method string, url string, payload io.Reader) *http.Request
- func NewSDKClient(ts *httptest.Server) *kratos.APIClient
- func NewSDKClientFromURL(u string) *kratos.APIClient
- func NewSDKCustomClient(ts *httptest.Server, client *http.Client) *kratos.APIClient
- func NewSDKEmailNode(group string) *kratos.UiNode
- func NewSessionClient(t *testing.T, u string) *http.Client
- func NewSettingsAPIServer(t *testing.T, reg *driver.RegistryDefault, ids map[string]*identity.Identity) (*httptest.Server, *httptest.Server, map[string]*http.Client)
- func NewSettingsLoginAcceptAPIServer(t *testing.T, publicClient *kratos.APIClient, conf *config.Config) *httptest.Server
- func NewSettingsUIEchoServer(t *testing.T, reg *driver.RegistryDefault) *httptest.Server
- func NewSettingsUIFlowEchoServer(t *testing.T, reg driver.Registry) *httptest.Server
- func NewSettingsUITestServer(t *testing.T, conf *config.Config) *httptest.Server
- func NewTestHTTPRequest(t *testing.T, method, url string, body io.Reader) *http.Request
- func NewVerificationUIFlowEchoServer(t *testing.T, reg driver.Registry) *httptest.Server
- func NewVerifyAfterHookWebHookTarget(ctx context.Context, t *testing.T, conf *config.Config, ...)
- func PersistNewRecoveryFlow(t *testing.T, strategy recovery.Strategy, conf *config.Config, ...) *recovery.Flow
- func RandomEmail() string
- func RecoveryMakeRequest(t *testing.T, isAPI bool, f *kratos.RecoveryFlow, hc *http.Client, ...) (string, *http.Response)
- func RegistrationMakeRequest(t *testing.T, isAPI bool, isSPA bool, f *kratos.RegistrationFlow, ...) (string, *http.Response)
- func SDKFormFieldsToURLValues(ff []kratos.UiNode) url.Values
- func SelfServiceHookConfigReset(t *testing.T, conf *config.Config) func()
- func SelfServiceHookCreateFakeIdentity(t *testing.T, reg driver.Registry) *identity.Identity
- func SelfServiceHookErrorHandler(t *testing.T, w http.ResponseWriter, _ *http.Request, abortErr error, ...) bool
- func SelfServiceHookFakeIdentity(t *testing.T) *identity.Identity
- func SelfServiceHookLoginErrorHandler(t *testing.T, w http.ResponseWriter, r *http.Request, err error) bool
- func SelfServiceHookLoginSetDefaultRedirectTo(t *testing.T, conf *config.Config, value string)
- func SelfServiceHookLoginSetDefaultRedirectToStrategy(t *testing.T, conf *config.Config, strategy, value string)
- func SelfServiceHookLoginViperSetPost(t *testing.T, conf *config.Config, strategy string, c []config.SelfServiceHook)
- func SelfServiceHookRegistrationErrorHandler(t *testing.T, w http.ResponseWriter, r *http.Request, err error) bool
- func SelfServiceHookRegistrationSetDefaultRedirectTo(t *testing.T, conf *config.Config, value string)
- func SelfServiceHookRegistrationSetDefaultRedirectToStrategy(t *testing.T, conf *config.Config, strategy, value string)
- func SelfServiceHookRegistrationViperSetPost(t *testing.T, conf *config.Config, strategy string, c []config.SelfServiceHook)
- func SelfServiceHookSettingsErrorHandler(t *testing.T, w http.ResponseWriter, r *http.Request, err error) bool
- func SelfServiceHookSettingsSetDefaultRedirectTo(t *testing.T, conf *config.Config, value string)
- func SelfServiceHookSettingsSetDefaultRedirectToStrategy(t *testing.T, conf *config.Config, strategy, value string)
- func SelfServiceMakeHookRequest(t *testing.T, ts *httptest.Server, suffix string, asAPI bool, query url.Values) (*http.Response, string)
- func SelfServiceMakeLoginPostHookRequest(t *testing.T, ts *httptest.Server, asAPI bool, query url.Values) (*http.Response, string)
- func SelfServiceMakeLoginPreHookRequest(t *testing.T, ts *httptest.Server) (*http.Response, string)
- func SelfServiceMakeRecoveryPreHookRequest(t *testing.T, ts *httptest.Server) (*http.Response, string)
- func SelfServiceMakeRegistrationPostHookRequest(t *testing.T, ts *httptest.Server, asAPI bool, query url.Values) (*http.Response, string)
- func SelfServiceMakeRegistrationPreHookRequest(t *testing.T, ts *httptest.Server) (*http.Response, string)
- func SelfServiceMakeSettingsPostHookRequest(t *testing.T, ts *httptest.Server, asAPI bool, query url.Values) (*http.Response, string)
- func SelfServiceMakeSettingsPreHookRequest(t *testing.T, ts *httptest.Server) (*http.Response, string)
- func SelfServiceMakeVerificationPreHookRequest(t *testing.T, ts *httptest.Server) (*http.Response, string)
- func SetDefaultIdentitySchema(conf *config.Config, url string) func()deprecated
- func SetDefaultIdentitySchemaFromRaw(conf *config.Config, schema []byte)deprecated
- func SetIdentitySchemas(t *testing.T, conf *config.Config, schemas map[string]string)
- func SettingsMakeRequest(t *testing.T, isAPI bool, isSPA bool, f *kratos.SettingsFlow, hc *http.Client, ...) (string, *http.Response)
- func SkipIfNetworkContext(t testing.TB, ctx context.Context)
- func SnapshotTExcept(t *testing.T, actual interface{}, except []string)
- func StartE2EServer(t *testing.T, configFile string, configOptions ConfigOptions) (publicUrl, adminUrl string)
- func StartE2EServerOnly(t *testing.T, configFile string, isTLS bool, configOptions ConfigOptions) (publicPort, adminPort int)
- func StrategyEnable(t *testing.T, c *config.Config, strategy string, enable bool)
- func SubmitLoginForm(t *testing.T, isAPI bool, hc *http.Client, publicTS *httptest.Server, ...) string
- func SubmitRecoveryForm(t *testing.T, isAPI bool, isSPA bool, hc *http.Client, ...) string
- func SubmitRegistrationForm(t *testing.T, isAPI bool, hc *http.Client, publicTS *httptest.Server, ...) string
- func SubmitSettingsForm(t *testing.T, isAPI bool, isSPA bool, hc *http.Client, ...) string
- func SubmitVerificationForm(t *testing.T, isAPI bool, isSPA bool, hc *http.Client, ...) string
- func TestSelfServicePreHook(configKey string, ...) func(t *testing.T)
- func UseConfigFile(t *testing.T, path string) *pflag.FlagSet
- func UseIdentitySchema(t *testing.T, conf *config.Config, url string) (id string)
- func VerificationMakeRequest(t *testing.T, isAPI bool, f *kratos.VerificationFlow, hc *http.Client, ...) (string, *http.Response)
- func WithAddIdentitySchema(ctx context.Context, t *testing.T, conf *config.Config, url string) (context.Context, string)
- func WithDefaultIdentitySchema(ctx context.Context, url string) context.Context
- func WithDefaultIdentitySchemaFromRaw(ctx context.Context, schema []byte) context.Context
- type CheckRedirectFunc
- type ConfigOptions
- type InitFlowWithOption
- func InitFlowWithAAL(aal identity.AuthenticatorAssuranceLevel) InitFlowWithOption
- func InitFlowWithContext(ctx context.Context) InitFlowWithOption
- func InitFlowWithOAuth2LoginChallenge(hlc string) InitFlowWithOption
- func InitFlowWithRefresh() InitFlowWithOption
- func InitFlowWithReturnTo(returnTo string) InitFlowWithOption
- func InitFlowWithVia(via string) InitFlowWithOption
- type SessionLifespanProvider
- type TransportWithHeader
- type TransportWithLogger
Constants ¶
This section is empty.
Variables ¶
var CodeRegex = fmt.Sprintf(`(\d{%d})`, code.CodeLength)
Functions ¶
func AddAndLoginIdentities ¶
func AddAndLoginIdentities(t *testing.T, reg *driver.RegistryDefault, public *httptest.Server, ids map[string]*identity.Identity) map[string]*http.Client
AddAndLoginIdentities adds the given identities to the store (like a registration flow) and returns http.Clients which contain their sessions.
func AssertFieldMessage ¶ added in v0.11.0
func AssertNoCSRFCookieInResponse ¶ added in v1.1.0
func CheckE2EServerOnHTTP ¶
func CheckE2EServerOnHTTPS ¶
func CourierExpectCodeInMessage ¶ added in v0.11.0
func CourierExpectMessage ¶
func DefaultIdentitySchemaConfig ¶ added in v1.3.0
func EasyCookieJar ¶ added in v1.1.0
func EasyGetBody ¶ added in v1.1.0
func EasyGetJSON ¶ added in v1.1.0
func EncodeFormAsJSON ¶
func ExistingNetwork ¶
func ExistingNetwork(t *testing.T, p persistence.Persister, id uuid.UUID) persistence.Persister
func ExpectStatusCode ¶
func GenerateTLSCertificateFilesForTests ¶
func GenerateTLSCertificateFilesForTests(t *testing.T) (certPath, keyPath, certBase64, keyBase64 string)
GenerateTLSCertificateFilesForTests writes a new, self-signed TLS certificate+key (in PEM format) to a temporary location on disk and returns the paths to both, as well as the respective contents in base64 encoding. The files are automatically cleaned up when the given *testing.T concludes its tests.
func GetLoginFlow ¶ added in v1.1.0
func GetRecoveryFlow ¶
func GetRecoveryFlowForType ¶ added in v1.1.0
func GetRegistrationFlow ¶ added in v1.1.0
func GetVerificationFlow ¶
func HTTPPostForm ¶
func HTTPRequestJSON ¶
func InitKratosServers ¶
func InitializeLoginFlowViaAPIWithContext ¶ added in v1.3.0
func LoginMakeRequest ¶
func LoginMakeRequestWithContext ¶ added in v1.3.0
func MockHydrateCookieClient ¶
func MockSessionCreateHandlerWithIdentityAndAMR ¶
func MockSessionCreateHandlerWithIdentityAndAMR(t *testing.T, reg mockDeps, i *identity.Identity, methods []identity.CredentialsType) (httprouter.Handle, *session.Session)
func MockSetSession ¶
func NewActiveSession ¶ added in v1.3.0
func NewActiveSession(r *http.Request, reg interface { session.ManagementProvider }, i *identity.Identity, authenticatedAt time.Time, completedLoginFor identity.CredentialsType, completedLoginAAL identity.AuthenticatorAssuranceLevel) (*session.Session, error)
func NewClientWithCookieJar ¶ added in v0.11.0
func NewErrorTestServer ¶
func NewFakeCSRFNode ¶
func NewHTTPClientWithArbitrarySessionTokenAndTraits ¶ added in v1.3.0
func NewHTTPClientWithIdentitySessionCookieLocalhost ¶ added in v1.1.0
func NewKratosServer ¶
func NewKratosServerWithCSRF ¶
func NewKratosServerWithCSRFAndRouters ¶
func NewKratosServerWithCSRFAndRouters(t *testing.T, reg driver.Registry) (public, admin *httptest.Server, rp *x.RouterPublic, ra *x.RouterAdmin)
func NewKratosServerWithRouters ¶
func NewKratosServerWithRouters(t *testing.T, reg driver.Registry, rp *x.RouterPublic, ra *x.RouterAdmin) (public, admin *httptest.Server)
func NewMethodSubmit ¶
func NewNetwork ¶
func NewNetwork(t testing.TB, ctx context.Context, p persistence.Persister) (uuid.UUID, persistence.Persister)
func NewNetworkUnlessExisting ¶
func NewNetworkUnlessExisting(t *testing.T, ctx context.Context, p persistence.Persister) (uuid.UUID, persistence.Persister)
func NewPasswordNode ¶
func NewRedirNoSessionTS ¶
func NewRedirNoSessionTS(t *testing.T, reg interface { x.WriterProvider session.ManagementProvider config.Provider }) *httptest.Server
func NewRedirSessionEchoTS ¶
func NewRedirSessionEchoTS(t *testing.T, reg interface { x.WriterProvider session.ManagementProvider config.Provider }) *httptest.Server
func NewRequest ¶
func NewSDKClientFromURL ¶
func NewSDKCustomClient ¶
func NewSDKEmailNode ¶
func NewSettingsAPIServer ¶
func NewSettingsUIEchoServer ¶
func NewSettingsUITestServer ¶
func NewTestHTTPRequest ¶ added in v1.1.0
func NewVerifyAfterHookWebHookTarget ¶ added in v1.2.0
func PersistNewRecoveryFlow ¶ added in v0.11.0
func RandomEmail ¶
func RandomEmail() string
func RecoveryMakeRequest ¶
func RegistrationMakeRequest ¶
func SelfServiceMakeRecoveryPreHookRequest ¶ added in v0.11.0
func SelfServiceMakeSettingsPreHookRequest ¶ added in v0.11.0
func SelfServiceMakeVerificationPreHookRequest ¶ added in v0.11.0
func SetDefaultIdentitySchema
deprecated
func SetDefaultIdentitySchemaFromRaw
deprecated
func SetIdentitySchemas ¶
SetIdentitySchemas sets the identity schemas in viper config:
testhelpers.SetIdentitySchemas(map[string]string{"customer": "file://customer.json"})
func SettingsMakeRequest ¶
func SnapshotTExcept ¶
func StartE2EServer ¶
func StartE2EServer(t *testing.T, configFile string, configOptions ConfigOptions) (publicUrl, adminUrl string)
func StartE2EServerOnly ¶
func StrategyEnable ¶
func SubmitLoginForm ¶
func SubmitLoginForm( t *testing.T, isAPI bool, hc *http.Client, publicTS *httptest.Server, withValues func(v url.Values), isSPA bool, forced bool, expectedStatusCode int, expectedURL string, ) string
SubmitLoginForm initiates a login flow (for Browser and API!), fills out the form and modifies the form values with `withValues`, and submits the form. Returns the body and checks for expectedStatusCode and expectedURL on completion
func SubmitRecoveryForm ¶
func SubmitRecoveryForm( t *testing.T, isAPI bool, isSPA bool, hc *http.Client, publicTS *httptest.Server, withValues func(v url.Values), expectedStatusCode int, expectedURL string, ) string
SubmitRecoveryForm initiates a registration flow (for Browser and API!), fills out the form and modifies the form values with `withValues`, and submits the form. If completed, it will return the flow as JSON.
func SubmitRegistrationForm ¶
func SubmitRegistrationForm( t *testing.T, isAPI bool, hc *http.Client, publicTS *httptest.Server, withValues func(v url.Values), isSPA bool, expectedStatusCode int, expectedURL string, ) string
SubmitRegistrationForm (for Browser and API!), fills out the form and modifies // the form values with `withValues`, and submits the form. Returns the body and checks for expectedStatusCode and // expectedURL on completion
func SubmitSettingsForm ¶
func SubmitSettingsForm( t *testing.T, isAPI bool, isSPA bool, hc *http.Client, publicTS *httptest.Server, withValues func(v url.Values), expectedStatusCode int, expectedURL string, ) string
SubmitSettingsForm initiates a settings flow (for Browser and API!), fills out the form and modifies the form values with `withValues`, and submits the form. If completed, it will return the flow as JSON.
func SubmitVerificationForm ¶
func SubmitVerificationForm( t *testing.T, isAPI bool, isSPA bool, hc *http.Client, publicTS *httptest.Server, withValues func(v url.Values), expectedStatusCode int, expectedURL string, ) string
SubmitVerificationForm initiates a registration flow (for Browser and API!), fills out the form and modifies the form values with `withValues`, and submits the form. If completed, it will return the flow as JSON.
func TestSelfServicePreHook ¶
func UseIdentitySchema ¶ added in v0.13.0
UseIdentitySchema registers an identity schema in the config with a random ID and returns the ID
It also registers a test cleanup function, to reset the schemas to the original values, after the test finishes Deprecated: Use context-based WithAddIdentitySchema instead
func VerificationMakeRequest ¶
func WithAddIdentitySchema ¶ added in v1.3.0
func WithAddIdentitySchema(ctx context.Context, t *testing.T, conf *config.Config, url string) (context.Context, string)
WithAddIdentitySchema registers an identity schema in the config with a random ID and returns the ID
It also registers a test cleanup function, to reset the schemas to the original values, after the test finishes
func WithDefaultIdentitySchema ¶ added in v1.3.0
Types ¶
type CheckRedirectFunc ¶ added in v1.3.0
func DebugRedirects ¶ added in v1.3.0
func DebugRedirects(t *testing.T) CheckRedirectFunc
type ConfigOptions ¶
type ConfigOptions map[string]interface{}
type InitFlowWithOption ¶
type InitFlowWithOption func(*initFlowOptions)
func InitFlowWithAAL ¶
func InitFlowWithAAL(aal identity.AuthenticatorAssuranceLevel) InitFlowWithOption
func InitFlowWithContext ¶ added in v1.3.0
func InitFlowWithContext(ctx context.Context) InitFlowWithOption
func InitFlowWithOAuth2LoginChallenge ¶ added in v0.11.0
func InitFlowWithOAuth2LoginChallenge(hlc string) InitFlowWithOption
func InitFlowWithRefresh ¶
func InitFlowWithRefresh() InitFlowWithOption
func InitFlowWithReturnTo ¶
func InitFlowWithReturnTo(returnTo string) InitFlowWithOption
func InitFlowWithVia ¶ added in v1.1.0
func InitFlowWithVia(via string) InitFlowWithOption
InitFlowWithVia sets the `via` query parameter which is used by the code MFA flows to determine the trait to use to send the code to the user
type SessionLifespanProvider ¶
type SessionLifespanProvider struct {
// contains filtered or unexported fields
}
func NewSessionLifespanProvider ¶
func NewSessionLifespanProvider(expiresIn time.Duration) *SessionLifespanProvider
func (*SessionLifespanProvider) SessionLifespan ¶
func (p *SessionLifespanProvider) SessionLifespan(context.Context) time.Duration
type TransportWithHeader ¶ added in v1.1.0
type TransportWithHeader struct { http.RoundTripper // contains filtered or unexported fields }
func NewAuthorizedTransport ¶ added in v0.11.0
func NewAuthorizedTransport(t *testing.T, ctx context.Context, reg *driver.RegistryDefault, sess *session.Session) *TransportWithHeader
func NewTransportWithHeader ¶ added in v1.1.0
func NewTransportWithHeader(t *testing.T, h http.Header) *TransportWithHeader
func (*TransportWithHeader) GetHeader ¶ added in v1.3.0
func (ct *TransportWithHeader) GetHeader() http.Header
type TransportWithLogger ¶
type TransportWithLogger struct { http.RoundTripper // contains filtered or unexported fields }
func NewTransportWithLogger ¶
func NewTransportWithLogger(parent http.RoundTripper, t *testing.T) *TransportWithLogger
Source Files ¶
- config.go
- courier.go
- e2e_server.go
- errorx.go
- fake.go
- handler_mock.go
- http.go
- httptest.go
- identity.go
- identity_schema.go
- json.go
- network.go
- sdk.go
- selfservice.go
- selfservice_login.go
- selfservice_recovery.go
- selfservice_registration.go
- selfservice_settings.go
- selfservice_verification.go
- server.go
- session.go
- session_active.go
- snapshot.go
- strategies.go
- strategy_code.go