testhelpers

package
v0.4.3-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Overview

nolint

nolint

Index

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 CleanSQL

func CleanSQL(t *testing.T, c *pop.Connection)

func CourierExpectLinkInMessage

func CourierExpectLinkInMessage(t *testing.T, message *courier.Message, offset int) string

func CourierExpectMessage

func CourierExpectMessage(t *testing.T, reg interface {
	courier.PersistenceProvider
}, recipient, subject string) *courier.Message

func GetSettingsMethodConfig

func GetSettingsMethodConfig(t *testing.T, primaryUser *http.Client, ts *httptest.Server, id string) *models.RequestMethodConfig

func GetSettingsRequest

func GetSettingsRequest(t *testing.T, primaryUser *http.Client, ts *httptest.Server) *common.GetSelfServiceBrowserSettingsRequestOK

func HTTPPostForm

func HTTPPostForm(t *testing.T, client *http.Client, remote string, in *url.Values) ([]byte, *http.Response)

func HTTPRequestJSON

func HTTPRequestJSON(t *testing.T, client *http.Client, method string, url string, in interface{}) ([]byte, *http.Response)

func HookConfigRedirectTo

func HookConfigRedirectTo(t *testing.T, u string) (m []map[string]interface{})

func HookVerify

func HookVerify(t *testing.T) (m []map[string]interface{})

func InitKratosServers

func InitKratosServers(t *testing.T, reg driver.Registry, public, admin *httptest.Server)

func JSONEq

func JSONEq(t *testing.T, expected, actual interface{}, messageAndArgs ...interface{})

func MockGetSession

func MockGetSession(t *testing.T, reg mockDeps) httprouter.Handle

func MockHydrateCookieClient

func MockHydrateCookieClient(t *testing.T, c *http.Client, u string)

func MockMakeAuthenticatedRequest

func MockMakeAuthenticatedRequest(t *testing.T, reg mockDeps, conf configuration.Provider, router *httprouter.Router, req *http.Request) ([]byte, *http.Response)

func MockSessionCreateHandler

func MockSessionCreateHandler(t *testing.T, reg mockDeps) (httprouter.Handle, *session.Session)

func MockSessionCreateHandlerWithIdentity

func MockSessionCreateHandlerWithIdentity(t *testing.T, reg mockDeps, i *identity.Identity) (httprouter.Handle, *session.Session)

func MockSetSession

func MockSetSession(t *testing.T, reg mockDeps, conf configuration.Provider) httprouter.Handle

func NewClientWithCookies

func NewClientWithCookies(t *testing.T) *http.Client

func NewErrorTestServer

func NewErrorTestServer(t *testing.T, reg interface{ errorx.PersistenceProvider }) *httptest.Server

func NewKratosServer

func NewKratosServer(t *testing.T, reg driver.Registry) (public, admin *httptest.Server)

func NewKratosServerWithCSRF

func NewKratosServerWithCSRF(t *testing.T, reg driver.Registry) (public, admin *httptest.Server)

func NewKratosServerWithRouters

func NewKratosServerWithRouters(t *testing.T, reg driver.Registry, rp *x.RouterPublic, ra *x.RouterAdmin) (public, admin *httptest.Server)

func NewKratosServers

func NewKratosServers(t *testing.T) (public, admin *httptest.Server)

func NewLoginUIRequestEchoServer

func NewLoginUIRequestEchoServer(t *testing.T, reg driver.Registry) *httptest.Server

func NewRecoveryUITestServer

func NewRecoveryUITestServer(t *testing.T) *httptest.Server

func NewRedirTS

func NewRedirTS(t *testing.T, body string) *httptest.Server

func NewSDKClient

func NewSDKClient(ts *httptest.Server) *client.OryKratos

func NewSDKClientFromURL

func NewSDKClientFromURL(u string) *client.OryKratos

func NewSessionClient

func NewSessionClient(t *testing.T, u string) *http.Client

func NewSettingsAPIServer

func NewSettingsAPIServer(t *testing.T, reg *driver.RegistryDefault, ids map[string]*identity.Identity) (*httptest.Server, *httptest.Server, map[string]*http.Client)

func NewSettingsLoginAcceptAPIServer

func NewSettingsLoginAcceptAPIServer(t *testing.T, adminClient *client.OryKratos) *httptest.Server

func NewSettingsUITestServer

func NewSettingsUITestServer(t *testing.T) *httptest.Server

func RecoveryFlowEnable

func RecoveryFlowEnable(enable bool)

func SDKFormFieldsToURLValues

func SDKFormFieldsToURLValues(ff models.FormFields) url.Values

func SelfServiceHookConfigReset

func SelfServiceHookConfigReset()

func SelfServiceHookCreateFakeIdentity

func SelfServiceHookCreateFakeIdentity(t *testing.T, reg driver.Registry) *identity.Identity

func SelfServiceHookFakeIdentity

func SelfServiceHookFakeIdentity(t *testing.T) *identity.Identity

func SelfServiceHookLoginErrorHandler

func SelfServiceHookLoginErrorHandler(t *testing.T, w http.ResponseWriter, r *http.Request, err error) bool

func SelfServiceHookLoginSetDefaultRedirectTo

func SelfServiceHookLoginSetDefaultRedirectTo(value string)

func SelfServiceHookLoginSetDefaultRedirectToStrategy

func SelfServiceHookLoginSetDefaultRedirectToStrategy(strategy, value string)

func SelfServiceHookLoginViperSetPost

func SelfServiceHookLoginViperSetPost(strategy string, c []configuration.SelfServiceHook)

func SelfServiceHookRegistrationErrorHandler

func SelfServiceHookRegistrationErrorHandler(t *testing.T, w http.ResponseWriter, r *http.Request, err error) bool

func SelfServiceHookRegistrationSetDefaultRedirectTo

func SelfServiceHookRegistrationSetDefaultRedirectTo(value string)

func SelfServiceHookRegistrationSetDefaultRedirectToStrategy

func SelfServiceHookRegistrationSetDefaultRedirectToStrategy(strategy, value string)

func SelfServiceHookRegistrationViperSetPost

func SelfServiceHookRegistrationViperSetPost(strategy string, c []configuration.SelfServiceHook)

func SelfServiceHookSettingsErrorHandler

func SelfServiceHookSettingsErrorHandler(t *testing.T, w http.ResponseWriter, r *http.Request, err error) bool

func SelfServiceHookSettingsSetDefaultRedirectTo

func SelfServiceHookSettingsSetDefaultRedirectTo(value string)

func SelfServiceHookSettingsSetDefaultRedirectToStrategy

func SelfServiceHookSettingsSetDefaultRedirectToStrategy(strategy, value string)

func SelfServiceMakeLoginPostHookRequest

func SelfServiceMakeLoginPostHookRequest(t *testing.T, ts *httptest.Server, asAPI bool, query url.Values) (*http.Response, string)

func SelfServiceMakeLoginPreHookRequest

func SelfServiceMakeLoginPreHookRequest(t *testing.T, ts *httptest.Server) (*http.Response, string)

func SelfServiceMakeRegistrationPostHookRequest

func SelfServiceMakeRegistrationPostHookRequest(t *testing.T, ts *httptest.Server, asAPI bool, query url.Values) (*http.Response, string)

func SelfServiceMakeRegistrationPreHookRequest

func SelfServiceMakeRegistrationPreHookRequest(t *testing.T, ts *httptest.Server) (*http.Response, string)

func SelfServiceMakeSettingsPostHookRequest

func SelfServiceMakeSettingsPostHookRequest(t *testing.T, ts *httptest.Server, asAPI bool, query url.Values) (*http.Response, string)

func StrategyEnable

func StrategyEnable(strategy string, enable bool)

func TestSelfServicePreHook

func TestSelfServicePreHook(
	configKey string,
	makeRequestPre func(t *testing.T, ts *httptest.Server) (*http.Response, string),
	newServer func(t *testing.T) *httptest.Server,
) func(t *testing.T)

func VerificationFlowEnable

func VerificationFlowEnable(enable bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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