helpers

package
v0.0.0-...-2873e01 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Allow

func Allow(role *types.Role, r string, oo ...string)

func AllowMe

func AllowMe(mrg myRoleGetter, r string, oo ...string)

func AllowMeDalConnectionCRUD

func AllowMeDalConnectionCRUD(mrg myRoleGetter)

func AllowMeDalConnectionSearch

func AllowMeDalConnectionSearch(mrg myRoleGetter)

func AllowMeModuleCRUD

func AllowMeModuleCRUD(mrg myRoleGetter)

func AllowMeModuleCreate

func AllowMeModuleCreate(mrg myRoleGetter)

func AllowMeModuleSearch

func AllowMeModuleSearch(mrg myRoleGetter)

func AllowMeRecordCRUD

func AllowMeRecordCRUD(mrg myRoleGetter)

func AllowMeWorkflowSearch

func AllowMeWorkflowSearch(mrg myRoleGetter)

func AssertBody

func AssertBody(expected string) assertFn

AssertBody compares the raw body to the provided string

func AssertError

func AssertError(expectedError string) assertFn

AssertError ensures there are no errors in the response

func AssertErrorP

func AssertErrorP(expectedError string) assertFn

AssertErrorP checks if the expected error is part of the error message

func AssertNoErrors

func AssertNoErrors(rsp *http.Response, _ *http.Request) (err error)

AssertNoErrors ensures there are no errors in the response

func AssertRecordValueError

func AssertRecordValueError(exp ...*types.RecordValueError) assertFn

Asserts that all expected errors are returned

Compares each error by Kind, Message and Meta.field

Note: This assertion always expects errors!

func BindAuthMiddleware

func BindAuthMiddleware(r chi.Router)

func DecodeBody

func DecodeBody(rsp *http.Response, s interface{}) error

decodes response body to given struct

func Deny

func Deny(role *types.Role, r string, oo ...string)

func DenyMe

func DenyMe(mrg myRoleGetter, r string, oo ...string)

func Dump

func Dump(rsp *http.Response, _ *http.Request) (err error)

Dump can be put into Assert()

func Grant

func Grant(rr ...*rbac.Rule)

func InitFileUpload

func InitFileUpload(t *testing.T, apiTest *apitest.APITest, endpoint string, form map[string]string, file []byte, name, mimetype string) *apitest.Response

func JSON

func JSON(i interface{}) string

func LoadLabelsFromStore

func LoadLabelsFromStore(t *testing.T, s store.Storer, resKind string, id uint64) (sl map[string]string)

func NewIntegrationTestApp

func NewIntegrationTestApp(ctx context.Context, initTestServices func(*app.CortezaApp) error) *app.CortezaApp

func RecursiveDotEnvLoad

func RecursiveDotEnvLoad()

RecursiveDotEnvLoad loads ENV variables from .evn files 3 levels down

func ReqHeaderRawAuthBearer

func ReqHeaderRawAuthBearer(token []byte) apitest.Intercept

func SearchWithLabelsViaAPI

func SearchWithLabelsViaAPI(api *apitest.APITest, t *testing.T, endpoint string, res interface{}, labels url.Values)

func SetLabelsViaAPI

func SetLabelsViaAPI(api *apitest.APITest, t *testing.T, endpoint string, in, out interface{})

func UpdateRBAC

func UpdateRBAC(rr ...uint64)

Types

type RecordValueErrorSetResponse

type RecordValueErrorSetResponse struct {
	Error struct {
		Message string
		Details []types.RecordValueError
	}
}

type StdErrorResponse

type StdErrorResponse struct {
	Error struct {
		Message string
	}
}

Jump to

Keyboard shortcuts

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