authmw

package
v0.4.64 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthClient

type AuthClient interface {
	InjectTokenCtx(ctx context.Context, header http.Header, spec connect.Spec) (context.Context, error)
}

type AuthMiddleware

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

func New

func New(
	jwtClient AuthClient,
	apiKeyClient AuthClient,
) *AuthMiddleware

func (*AuthMiddleware) InjectTokenCtx

func (n *AuthMiddleware) InjectTokenCtx(ctx context.Context, header http.Header, spec connect.Spec) (context.Context, error)

type MockAuthClient

type MockAuthClient struct {
	mock.Mock
}

MockAuthClient is an autogenerated mock type for the AuthClient type

func NewMockAuthClient

func NewMockAuthClient(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockAuthClient

NewMockAuthClient creates a new instance of MockAuthClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockAuthClient) EXPECT

func (*MockAuthClient) InjectTokenCtx

func (_m *MockAuthClient) InjectTokenCtx(ctx context.Context, header http.Header, spec connect.Spec) (context.Context, error)

InjectTokenCtx provides a mock function with given fields: ctx, header, spec

type MockAuthClient_Expecter

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

func (*MockAuthClient_Expecter) InjectTokenCtx

func (_e *MockAuthClient_Expecter) InjectTokenCtx(ctx interface{}, header interface{}, spec interface{}) *MockAuthClient_InjectTokenCtx_Call

InjectTokenCtx is a helper method to define mock.On call

  • ctx context.Context
  • header http.Header
  • spec connect.Spec

type MockAuthClient_InjectTokenCtx_Call

type MockAuthClient_InjectTokenCtx_Call struct {
	*mock.Call
}

MockAuthClient_InjectTokenCtx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InjectTokenCtx'

func (*MockAuthClient_InjectTokenCtx_Call) Return

func (*MockAuthClient_InjectTokenCtx_Call) Run

func (*MockAuthClient_InjectTokenCtx_Call) RunAndReturn

Jump to

Keyboard shortcuts

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