authorization

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: MIT Imports: 7 Imported by: 16

Documentation

Overview

Package authorization is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthorizationInterceptor added in v1.3.0

func NewAuthorizationInterceptor(authorizer Authorizer, metrics metrics.Client) grpc.UnaryServerInterceptor

GetAuthorizationInterceptor creates an authorization interceptor and return a func that points to its Interceptor method

Types

type Attributes

type Attributes struct {
	Actor     string
	APIName   string
	Namespace string
}

Attributes is input for authority to make decision. It can be extended in future if required auth on resources like WorkflowType and TaskQueue

type Authorizer

type Authorizer interface {
	Authorize(ctx context.Context, attributes *Attributes) (Result, error)
}

Authorizer is an interface for authorization

func NewNopAuthorizer

func NewNopAuthorizer() Authorizer

NewNopAuthorizer creates a no-op authority

type Decision

type Decision int

Decision is enum type for auth decision

const (
	// DecisionDeny means auth decision is deny
	DecisionDeny Decision = iota + 1
	// DecisionAllow means auth decision is allow
	DecisionAllow
)

type MockAuthorizer

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

MockAuthorizer is a mock of Authorizer interface.

func NewMockAuthorizer

func NewMockAuthorizer(ctrl *gomock.Controller) *MockAuthorizer

NewMockAuthorizer creates a new mock instance.

func (*MockAuthorizer) Authorize

func (m *MockAuthorizer) Authorize(ctx context.Context, attributes *Attributes) (Result, error)

Authorize mocks base method.

func (*MockAuthorizer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockAuthorizerMockRecorder

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

MockAuthorizerMockRecorder is the mock recorder for MockAuthorizer.

func (*MockAuthorizerMockRecorder) Authorize

func (mr *MockAuthorizerMockRecorder) Authorize(ctx, attributes interface{}) *gomock.Call

Authorize indicates an expected call of Authorize.

type MockrequestWithName added in v1.3.0

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

MockrequestWithName is a mock of requestWithName interface.

func NewMockrequestWithName added in v1.3.0

func NewMockrequestWithName(ctrl *gomock.Controller) *MockrequestWithName

NewMockrequestWithName creates a new mock instance.

func (*MockrequestWithName) EXPECT added in v1.3.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockrequestWithName) GetName added in v1.3.0

func (m *MockrequestWithName) GetName() string

GetName mocks base method.

type MockrequestWithNameMockRecorder added in v1.3.0

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

MockrequestWithNameMockRecorder is the mock recorder for MockrequestWithName.

func (*MockrequestWithNameMockRecorder) GetName added in v1.3.0

GetName indicates an expected call of GetName.

type MockrequestWithNamespace added in v1.3.0

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

MockrequestWithNamespace is a mock of requestWithNamespace interface.

func NewMockrequestWithNamespace added in v1.3.0

func NewMockrequestWithNamespace(ctrl *gomock.Controller) *MockrequestWithNamespace

NewMockrequestWithNamespace creates a new mock instance.

func (*MockrequestWithNamespace) EXPECT added in v1.3.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockrequestWithNamespace) GetNamespace added in v1.3.0

func (m *MockrequestWithNamespace) GetNamespace() string

GetNamespace mocks base method.

type MockrequestWithNamespaceMockRecorder added in v1.3.0

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

MockrequestWithNamespaceMockRecorder is the mock recorder for MockrequestWithNamespace.

func (*MockrequestWithNamespaceMockRecorder) GetNamespace added in v1.3.0

func (mr *MockrequestWithNamespaceMockRecorder) GetNamespace() *gomock.Call

GetNamespace indicates an expected call of GetNamespace.

type Result

type Result struct {
	Decision Decision
}

Result is result from authority.

Jump to

Keyboard shortcuts

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