policybackend

package
v0.0.0-...-1a56975 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsReportJSON

func ContainsReportJSON(t testing.TB, reports []proto.Message, expected string) bool

ContainsReportJSON checks whether the given proto array contains the expected string

Types

type Instance

type Instance interface {
	resource.Resource

	// DenyCheck indicates that the policy backend should deny all incoming check requests when deny is
	// set to true.
	DenyCheck(t testing.TB, deny bool)

	// ExpectReport checks that the backend has received the given report requests. The requests are consumed
	// after the call completes.
	ExpectReport(t testing.TB, expected ...proto.Message)

	// ExpectReportJSON checks that the backend has received the given report request.  The requests are
	// consumed after the call completes.
	ExpectReportJSON(t testing.TB, expected ...string)

	// GetReports reeturns the currently accumulated set of reports.
	GetReports(t testing.TB) []proto.Message

	// CreateConfigSnippet for the Mixer adapter to talk to this policy backend.
	// The supplied name will be the name of the handler.
	CreateConfigSnippet(name string, namespace string) string
}

Instance represents a deployed fake policy backend for Mixer.

func New

func New(ctx resource.Context) (i Instance, err error)

New returns a new instance of echo.

func NewOrFail

func NewOrFail(t *testing.T, s resource.Context) Instance

Jump to

Keyboard shortcuts

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