mocks

package
v1.31.21 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthZReq

type AuthZReq struct {
	Principal *models.Principal
	Verb      string
	Resources []string
}

type FakeAuthorizer

type FakeAuthorizer struct {
	// contains filtered or unexported fields
}

func NewMockAuthorizer

func NewMockAuthorizer() *FakeAuthorizer

func (*FakeAuthorizer) Authorize

func (a *FakeAuthorizer) Authorize(ctx context.Context, principal *models.Principal, verb string, resources ...string) error

Authorize provides a mock function with given fields: principal, verb, resource

func (*FakeAuthorizer) AuthorizeSilent added in v1.28.5

func (a *FakeAuthorizer) AuthorizeSilent(ctx context.Context, principal *models.Principal, verb string, resources ...string) error

func (*FakeAuthorizer) Calls

func (a *FakeAuthorizer) Calls() []AuthZReq

func (*FakeAuthorizer) FilterAuthorizedResources added in v1.28.5

func (a *FakeAuthorizer) FilterAuthorizedResources(ctx context.Context, principal *models.Principal, verb string, resources ...string) ([]string, error)

func (*FakeAuthorizer) SetErr

func (a *FakeAuthorizer) SetErr(err error)

Jump to

Keyboard shortcuts

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