Documentation
¶
Overview ¶
nolint
nolint
nolint
Index ¶
- func AddAndLoginIdentities(t *testing.T, reg *driver.RegistryDefault, public *httptest.Server, ...) map[string]*http.Client
- func CleanSQL(t *testing.T, c *pop.Connection)
- func CourierExpectLinkInMessage(t *testing.T, message *courier.Message, offset int) string
- func CourierExpectMessage(t *testing.T, reg interface{ ... }, recipient, subject string) *courier.Message
- func EncodeFormAsJSON(t *testing.T, isApi bool, values url.Values) (payload string)
- func ExpectStatusCode(isAPI bool, api, browser int) int
- func ExpectURL(isAPI bool, api, browser string) string
- func GetLoginFlowMethodConfig(t *testing.T, rs *models.LoginFlow, id string) *models.LoginFlowMethodConfig
- func GetRecoveryFlow(t *testing.T, client *http.Client, ts *httptest.Server) *public.GetSelfServiceRecoveryFlowOK
- func GetRecoveryFlowMethodConfig(t *testing.T, rs *models.RecoveryFlow, id string) *models.RecoveryFlowMethodConfig
- func GetRegistrationFlowMethodConfig(t *testing.T, rs *models.RegistrationFlow, id string) *models.RegistrationFlowMethodConfig
- func GetSettingsFlowMethodConfig(t *testing.T, rs *models.SettingsFlow, id string) *models.FlowMethodConfig
- func GetSettingsFlowMethodConfigDeprecated(t *testing.T, primaryUser *http.Client, ts *httptest.Server, id string) *models.FlowMethodConfig
- func GetVerificationFlow(t *testing.T, client *http.Client, ts *httptest.Server) *public.GetSelfServiceVerificationFlowOK
- func GetVerificationFlowMethodConfig(t *testing.T, rs *models.VerificationFlow, id string) *models.VerificationFlowMethodConfig
- 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) *public.InitializeSelfServiceLoginViaAPIFlowOK
- func InitializeLoginFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server, forced bool) *public.GetSelfServiceLoginFlowOK
- func InitializeRecoveryFlowViaAPI(t *testing.T, client *http.Client, ts *httptest.Server) *public.InitializeSelfServiceRecoveryViaAPIFlowOK
- func InitializeRecoveryFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server) *public.GetSelfServiceRecoveryFlowOK
- func InitializeRegistrationFlowViaAPI(t *testing.T, client *http.Client, ts *httptest.Server) *public.InitializeSelfServiceRegistrationViaAPIFlowOK
- func InitializeRegistrationFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server) *public.GetSelfServiceRegistrationFlowOK
- func InitializeSettingsFlowViaAPI(t *testing.T, client *http.Client, ts *httptest.Server) *public.InitializeSelfServiceSettingsViaAPIFlowOK
- func InitializeSettingsFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server) *public.GetSelfServiceSettingsFlowOK
- func InitializeVerificationFlowViaAPI(t *testing.T, client *http.Client, ts *httptest.Server) *public.InitializeSelfServiceVerificationViaAPIFlowOK
- func InitializeVerificationFlowViaBrowser(t *testing.T, client *http.Client, ts *httptest.Server) *public.GetSelfServiceVerificationFlowOK
- func JSONEq(t *testing.T, expected, actual interface{}, messageAndArgs ...interface{})
- func LogJSON(t *testing.T, v interface{})
- func LoginMakeRequest(t *testing.T, isAPI bool, f *models.LoginFlowMethodConfig, hc *http.Client, ...) (string, *http.Response)
- func MockGetSession(t *testing.T, reg mockDeps) httprouter.Handle
- func MockHydrateCookieClient(t *testing.T, c *http.Client, u string)
- func MockMakeAuthenticatedRequest(t *testing.T, reg mockDeps, conf configuration.Provider, ...) ([]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 MockSetSession(t *testing.T, reg mockDeps, conf configuration.Provider) httprouter.Handle
- func NewClientWithCookies(t *testing.T) *http.Client
- func NewDebugClient(t *testing.T) *http.Client
- func NewErrorTestServer(t *testing.T, reg interface{ ... }) *httptest.Server
- func NewHTTPClientWithArbitrarySessionCookie(t *testing.T, reg *driver.RegistryDefault) *http.Client
- func NewHTTPClientWithArbitrarySessionToken(t *testing.T, reg *driver.RegistryDefault) *http.Client
- func NewHTTPClientWithIdentitySessionCookie(t *testing.T, reg *driver.RegistryDefault, id *identity.Identity) *http.Client
- func NewHTTPClientWithIdentitySessionToken(t *testing.T, reg *driver.RegistryDefault, id *identity.Identity) *http.Client
- func NewHTTPClientWithSessionCookie(t *testing.T, reg *driver.RegistryDefault, sess *session.Session) *http.Client
- func NewHTTPClientWithSessionToken(t *testing.T, reg *driver.RegistryDefault, sess *session.Session) *http.Client
- func NewHTTPDeleteJSONRequest(t *testing.T, url string, in interface{}) *http.Request
- func NewHTTPGetJSONRequest(t *testing.T, url string) *http.Request
- 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 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) *httptest.Server
- func NewRecoveryUIFlowEchoServer(t *testing.T, reg driver.Registry) *httptest.Server
- func NewRedirSessionEchoTS(t *testing.T, reg interface{ ... }) *httptest.Server
- func NewRedirTS(t *testing.T, body string) *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) *client.OryKratos
- func NewSDKClientFromURL(u string) *client.OryKratos
- 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, adminClient *client.OryKratos) *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) *httptest.Server
- func NewVerificationUIFlowEchoServer(t *testing.T, reg driver.Registry) *httptest.Server
- func RecoveryFlowEnable(enable bool)
- func RecoveryMakeRequest(t *testing.T, isAPI bool, f *models.RecoveryFlowMethodConfig, hc *http.Client, ...) (string, *http.Response)
- func RecoverySubmitForm(t *testing.T, f *models.RecoveryFlowMethodConfig, hc *http.Client, ...) (string, *public.GetSelfServiceRecoveryFlowOK)
- func RegistrationMakeRequest(t *testing.T, isAPI bool, f *models.RegistrationFlowMethodConfig, ...) (string, *http.Response)
- func SDKFormFieldsToURLValues(ff models.FormFields) url.Values
- func SelfServiceHookConfigReset()
- func SelfServiceHookCreateFakeIdentity(t *testing.T, reg driver.Registry) *identity.Identity
- func SelfServiceHookFakeIdentity(t *testing.T) *identity.Identity
- func SelfServiceHookLoginErrorHandler(t *testing.T, w http.ResponseWriter, r *http.Request, err error) bool
- func SelfServiceHookLoginSetDefaultRedirectTo(value string)
- func SelfServiceHookLoginSetDefaultRedirectToStrategy(strategy, value string)
- func SelfServiceHookLoginViperSetPost(strategy string, c []configuration.SelfServiceHook)
- func SelfServiceHookRegistrationErrorHandler(t *testing.T, w http.ResponseWriter, r *http.Request, err error) bool
- func SelfServiceHookRegistrationSetDefaultRedirectTo(value string)
- func SelfServiceHookRegistrationSetDefaultRedirectToStrategy(strategy, value string)
- func SelfServiceHookRegistrationViperSetPost(strategy string, c []configuration.SelfServiceHook)
- func SelfServiceHookSettingsErrorHandler(t *testing.T, w http.ResponseWriter, r *http.Request, err error) bool
- func SelfServiceHookSettingsSetDefaultRedirectTo(value string)
- func SelfServiceHookSettingsSetDefaultRedirectToStrategy(strategy, value 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 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 SetDefaultIdentitySchema(location string)
- func SetIdentitySchemas(schemas map[string]string)
- func SettingsMakeRequest(t *testing.T, isAPI bool, f *models.FlowMethodConfig, hc *http.Client, ...) (string, *http.Response)
- func StrategyEnable(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, hc *http.Client, publicTS *httptest.Server, ...) string
- func SubmitRegistrationForm(t *testing.T, isAPI bool, hc *http.Client, publicTS *httptest.Server, ...) string
- func SubmitSettingsForm(t *testing.T, isAPI bool, hc *http.Client, publicTS *httptest.Server, ...) string
- func SubmitVerificationForm(t *testing.T, isAPI bool, hc *http.Client, publicTS *httptest.Server, ...) string
- func TestSelfServicePreHook(configKey string, ...) func(t *testing.T)
- func VerificationFlowEnable(enable bool)
- func VerificationMakeRequest(t *testing.T, isAPI bool, f *models.VerificationFlowMethodConfig, ...) (string, *http.Response)
- func VerificationSubmitForm(t *testing.T, f *models.VerificationFlowMethodConfig, hc *http.Client, ...) (string, *public.GetSelfServiceVerificationFlowOK)
- type SessionLifespanProvider
- type TransportWithLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 CourierExpectMessage ¶
func EncodeFormAsJSON ¶
func ExpectStatusCode ¶
func GetRecoveryFlow ¶
func GetRecoveryFlowMethodConfig ¶
func GetRecoveryFlowMethodConfig(t *testing.T, rs *models.RecoveryFlow, id string) *models.RecoveryFlowMethodConfig
func GetRegistrationFlowMethodConfig ¶
func GetRegistrationFlowMethodConfig(t *testing.T, rs *models.RegistrationFlow, id string) *models.RegistrationFlowMethodConfig
func GetSettingsFlowMethodConfig ¶
func GetSettingsFlowMethodConfig(t *testing.T, rs *models.SettingsFlow, id string) *models.FlowMethodConfig
func GetVerificationFlow ¶
func GetVerificationFlowMethodConfig ¶
func GetVerificationFlowMethodConfig(t *testing.T, rs *models.VerificationFlow, id string) *models.VerificationFlowMethodConfig
func HTTPPostForm ¶
func HTTPRequestJSON ¶
func InitKratosServers ¶
func LoginMakeRequest ¶
func MockGetSession ¶
func MockGetSession(t *testing.T, reg mockDeps) httprouter.Handle
func MockSetSession ¶
func MockSetSession(t *testing.T, reg mockDeps, conf configuration.Provider) httprouter.Handle
func NewErrorTestServer ¶
func NewKratosServer ¶
func NewKratosServerWithCSRF ¶
func NewKratosServerWithRouters ¶
func NewKratosServerWithRouters(t *testing.T, reg driver.Registry, rp *x.RouterPublic, ra *x.RouterAdmin) (public, admin *httptest.Server)
func NewRedirSessionEchoTS ¶
func NewRedirSessionEchoTS(t *testing.T, reg interface { x.WriterProvider session.ManagementProvider }) *httptest.Server
func NewRequest ¶
func NewSDKClientFromURL ¶
func NewSettingsAPIServer ¶
func NewSettingsUIEchoServer ¶
func RecoveryFlowEnable ¶
func RecoveryFlowEnable(enable bool)
func RecoveryMakeRequest ¶
func RecoverySubmitForm ¶
func RegistrationMakeRequest ¶
func SDKFormFieldsToURLValues ¶
func SDKFormFieldsToURLValues(ff models.FormFields) url.Values
func SelfServiceHookConfigReset ¶
func SelfServiceHookConfigReset()
func SelfServiceHookLoginSetDefaultRedirectTo ¶
func SelfServiceHookLoginSetDefaultRedirectTo(value string)
func SelfServiceHookLoginSetDefaultRedirectToStrategy ¶
func SelfServiceHookLoginSetDefaultRedirectToStrategy(strategy, value string)
func SelfServiceHookLoginViperSetPost ¶
func SelfServiceHookLoginViperSetPost(strategy string, c []configuration.SelfServiceHook)
func SelfServiceHookRegistrationSetDefaultRedirectTo ¶
func SelfServiceHookRegistrationSetDefaultRedirectTo(value string)
func SelfServiceHookRegistrationSetDefaultRedirectToStrategy ¶
func SelfServiceHookRegistrationSetDefaultRedirectToStrategy(strategy, value string)
func SelfServiceHookRegistrationViperSetPost ¶
func SelfServiceHookRegistrationViperSetPost(strategy string, c []configuration.SelfServiceHook)
func SelfServiceHookSettingsSetDefaultRedirectTo ¶
func SelfServiceHookSettingsSetDefaultRedirectTo(value string)
func SelfServiceHookSettingsSetDefaultRedirectToStrategy ¶
func SelfServiceHookSettingsSetDefaultRedirectToStrategy(strategy, value string)
func SetDefaultIdentitySchema ¶
func SetDefaultIdentitySchema(location string)
SetDefaultIdentitySchema sets the identity schemas in viper config:
testhelpers.SetDefaultIdentitySchema("file://customer.json")
func SetIdentitySchemas ¶
SetIdentitySchemas sets the identity schemas in viper config:
testhelpers.SetIdentitySchemas(map[string]string{"customer": "file://customer.json"})
func SettingsMakeRequest ¶
func StrategyEnable ¶
func SubmitLoginForm ¶
func SubmitLoginForm( t *testing.T, isAPI bool, hc *http.Client, publicTS *httptest.Server, withValues func(v url.Values), method identity.CredentialsType, 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, hc *http.Client, publicTS *httptest.Server, withValues func(v url.Values), method identity.CredentialsType, 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), method identity.CredentialsType, 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, hc *http.Client, publicTS *httptest.Server, withValues func(v url.Values), method string, 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, hc *http.Client, publicTS *httptest.Server, withValues func(v url.Values), method identity.CredentialsType, 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 VerificationFlowEnable ¶
func VerificationFlowEnable(enable bool)
func VerificationMakeRequest ¶
func VerificationSubmitForm ¶
Types ¶
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() time.Duration
type TransportWithLogger ¶
type TransportWithLogger struct { http.RoundTripper // contains filtered or unexported fields }
func NewTransportWithLogger ¶
func NewTransportWithLogger(parent http.RoundTripper, t *testing.T) *TransportWithLogger