auth

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(authServer string, log logrus.FieldLogger) *handler

Types

type ExchangeRequest

type ExchangeRequest struct {
	CodeVerifier string `json:"code_verifier"`
	AccessCode   string `json:"access_code"`
	RedirectURI  string `json:"redirect_uri"`
}

type ExchangeResponse

type ExchangeResponse struct {
	Token   *oauth2.Token `json:"token"`
	IDToken string        `json:"id_token"`
}

type Handler

type Handler interface {
	GetDeviceAgentToken(ctx context.Context, log logrus.FieldLogger, oauthConfig oauth2.Config, redirect string) (*Tokens, error)
}

type MockHandler

type MockHandler struct {
	mock.Mock
}

MockHandler is an autogenerated mock type for the Handler type

func NewMockHandler

func NewMockHandler(t interface {
	mock.TestingT
	Cleanup(func())
},
) *MockHandler

NewMockHandler creates a new instance of MockHandler. 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 (*MockHandler) EXPECT

func (_m *MockHandler) EXPECT() *MockHandler_Expecter

func (*MockHandler) GetDeviceAgentToken

func (_mock *MockHandler) GetDeviceAgentToken(ctx context.Context, log logrus.FieldLogger, oauthConfig oauth2.Config, redirect string) (*Tokens, error)

GetDeviceAgentToken provides a mock function for the type MockHandler

type MockHandler_Expecter

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

func (*MockHandler_Expecter) GetDeviceAgentToken

func (_e *MockHandler_Expecter) GetDeviceAgentToken(ctx interface{}, log interface{}, oauthConfig interface{}, redirect interface{}) *MockHandler_GetDeviceAgentToken_Call

GetDeviceAgentToken is a helper method to define mock.On call

  • ctx context.Context
  • log logrus.FieldLogger
  • oauthConfig oauth2.Config
  • redirect string

type MockHandler_GetDeviceAgentToken_Call

type MockHandler_GetDeviceAgentToken_Call struct {
	*mock.Call
}

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

func (*MockHandler_GetDeviceAgentToken_Call) Return

func (*MockHandler_GetDeviceAgentToken_Call) Run

func (*MockHandler_GetDeviceAgentToken_Call) RunAndReturn

type Tokens

type Tokens struct {
	Token   *oauth2.Token
	IDToken string
}

Jump to

Keyboard shortcuts

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