mocks

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BROWSER_LOGIN_ID        = "test_id"
	BROWSER_LOGIN_TYPE      = "browser"
	OAUTH2_SUBJECT          = "test1234"
	CONSENT_REDIRECT        = "test.test"
	AUTHORIZATION_REDIRECT  = "test.test"
	TEST_ERROR_CODE         = 599
	TRAITS_NAME             = "TestName"
	IDENTITY_ID             = "test1234"
	SCHEMA_ID               = "test_identity.schema.json"
	SESSION_ID              = "test-1111"
	ERROR_CODE              = 400
	ERROR_STATUS            = "Bad Request"
	ERROR_REASON            = "This is a test"
	ERROR_MESSAGE           = "This is a test"
	DEFAULT_ERROR_CODE      = 599
	CONSENT_CHALLANGE       = "test_challange"
	AUTHORIZATION_CHALLANGE = "test_authorization_challenge"
)
View Source
const DEFAULT_SCHEMA_SERVER_URL = "test_default.json"

Variables

This section is empty.

Functions

func CreateGenericTest

func CreateGenericTest(t *testing.T, serverCreater func(t *testing.T), HttpMethod string, reqHTTPEndpoint string, RequestBody io.Reader, testFunction func(w http.ResponseWriter, r *http.Request)) ([]byte, error)

This is a helper function to speed up development

func CreateHandlerWithError

func CreateHandlerWithError(testname string) func(w http.ResponseWriter, r *http.Request)

func CreateTestServers

func CreateTestServers(t *testing.T)

func GetErrorStatus

func GetErrorStatus(w http.ResponseWriter, r *http.Request)

func GetOKStatus

func GetOKStatus(w http.ResponseWriter, r *http.Request)

func GetSchemaUrl

func GetSchemaUrl() string

func NewHydraServerStub

func NewHydraServerStub() *httptest.Server

func NewKratosServerStub

func NewKratosServerStub() *httptest.Server

func NewSchemaServerStub

func NewSchemaServerStub() *httptest.Server

func Oauth2AuthRequestConsentAcceptHandler

func Oauth2AuthRequestConsentAcceptHandler(w http.ResponseWriter, r *http.Request)

func Oauth2AuthRequestConsentHandler

func Oauth2AuthRequestConsentHandler(w http.ResponseWriter, r *http.Request)

func Oauth2AuthRequestLoginAcceptHandler

func Oauth2AuthRequestLoginAcceptHandler(w http.ResponseWriter, r *http.Request)

func SchemaHandler

func SchemaHandler(w http.ResponseWriter, r *http.Request)

func SelfServiceErrorsHandler

func SelfServiceErrorsHandler(w http.ResponseWriter, r *http.Request)

func SelfServiceGetLoginHandler

func SelfServiceGetLoginHandler(w http.ResponseWriter, r *http.Request)

func SelfServiceLoginBrowserHandler

func SelfServiceLoginBrowserHandler(w http.ResponseWriter, r *http.Request)

func SelfServiceLoginHandler

func SelfServiceLoginHandler(w http.ResponseWriter, r *http.Request)

func SessionWhoAmIHandler

func SessionWhoAmIHandler(w http.ResponseWriter, r *http.Request)

func SetSchemaServerURL

func SetSchemaServerURL(url string)

func TimeoutHandler

func TimeoutHandler(w http.ResponseWriter, r *http.Request)

Types

type GenericError

type GenericError struct {
	Code    int64  `json:"code"`
	Debug   string `json:"debug"`
	Id      string `json:"id"`
	Message string `json:"message"`
	Reason  string `json:"reason"`
	Request string `json:"request"`
	Status  string `json:"status"`
}

func GenericErrorConstructor

func GenericErrorConstructor(testname string) GenericError

type IdentityTraits

type IdentityTraits struct {
	Name string `json:"name"`
}

type Status

type Status struct {
	Status string `json:"status"`
}

type TestError

type TestError struct {
	Code    int    `json:"code"`
	Status  string `json:"status"`
	Reason  string `json:"reason"`
	Message string `json:"message"`
}

type TestErrorReport

type TestErrorReport struct {
	Id         string    `json:"id"`
	Error      TestError `json:"error"`
	Created_at string    `json:"created_at"`
	Updated_at string    `json:"updated_at"`
}

Jump to

Keyboard shortcuts

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