client

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Overview

Package client provides a client of OpenID Connect.

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type AuthCodeURLInput

type AuthCodeURLInput struct {
	State                  string
	Nonce                  string
	PKCEParams             pkce.Params
	RedirectURI            string
	AuthRequestExtraParams map[string]string
}

type ExchangeAuthCodeInput

type ExchangeAuthCodeInput struct {
	Code        string
	PKCEParams  pkce.Params
	Nonce       string
	RedirectURI string
}

type Factory

type Factory struct {
	Loader loader.Loader
	Clock  clock.Interface
	Logger logger.Interface
}

func (*Factory) New

func (f *Factory) New(ctx context.Context, p oidc.Provider, tlsClientConfig tlsclientconfig.Config) (Interface, error)

New returns an instance of infrastructure.Interface with the given configuration.

type FactoryInterface

type FactoryInterface interface {
	New(ctx context.Context, p oidc.Provider, tlsClientConfig tlsclientconfig.Config) (Interface, error)
}

type GetTokenByAuthCodeInput

type GetTokenByAuthCodeInput struct {
	BindAddress            []string
	State                  string
	Nonce                  string
	PKCEParams             pkce.Params
	RedirectURLHostname    string
	AuthRequestExtraParams map[string]string
	LocalServerSuccessHTML string
	LocalServerCertFile    string
	LocalServerKeyFile     string
}

type Interface

type Interface interface {
	GetAuthCodeURL(in AuthCodeURLInput) string
	ExchangeAuthCode(ctx context.Context, in ExchangeAuthCodeInput) (*oidc.TokenSet, error)
	GetTokenByAuthCode(ctx context.Context, in GetTokenByAuthCodeInput, localServerReadyChan chan<- string) (*oidc.TokenSet, error)
	GetTokenByROPC(ctx context.Context, username, password string) (*oidc.TokenSet, error)
	GetDeviceAuthorization(ctx context.Context) (*oauth2dev.AuthorizationResponse, error)
	ExchangeDeviceCode(ctx context.Context, authResponse *oauth2dev.AuthorizationResponse) (*oidc.TokenSet, error)
	Refresh(ctx context.Context, refreshToken string) (*oidc.TokenSet, error)
	SupportedPKCEMethods() []string
}

type MockFactoryInterface added in v1.25.2

type MockFactoryInterface struct {
	mock.Mock
}

MockFactoryInterface is an autogenerated mock type for the FactoryInterface type

func NewMockFactoryInterface added in v1.25.2

func NewMockFactoryInterface(t mockConstructorTestingTNewMockFactoryInterface) *MockFactoryInterface

NewMockFactoryInterface creates a new instance of MockFactoryInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockFactoryInterface) EXPECT added in v1.25.2

func (*MockFactoryInterface) New added in v1.25.2

New provides a mock function with given fields: ctx, p, tlsClientConfig

type MockFactoryInterface_Expecter added in v1.25.2

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

func (*MockFactoryInterface_Expecter) New added in v1.25.2

func (_e *MockFactoryInterface_Expecter) New(ctx interface{}, p interface{}, tlsClientConfig interface{}) *MockFactoryInterface_New_Call

New is a helper method to define mock.On call

  • ctx context.Context
  • p oidc.Provider
  • tlsClientConfig tlsclientconfig.Config

type MockFactoryInterface_New_Call added in v1.25.2

type MockFactoryInterface_New_Call struct {
	*mock.Call
}

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

func (*MockFactoryInterface_New_Call) Return added in v1.25.2

func (*MockFactoryInterface_New_Call) Run added in v1.25.2

type MockInterface added in v1.25.2

type MockInterface struct {
	mock.Mock
}

MockInterface is an autogenerated mock type for the Interface type

func NewMockInterface added in v1.25.2

func NewMockInterface(t mockConstructorTestingTNewMockInterface) *MockInterface

NewMockInterface creates a new instance of MockInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockInterface) EXPECT added in v1.25.2

func (_m *MockInterface) EXPECT() *MockInterface_Expecter

func (*MockInterface) ExchangeAuthCode added in v1.25.2

func (_m *MockInterface) ExchangeAuthCode(ctx context.Context, in ExchangeAuthCodeInput) (*oidc.TokenSet, error)

ExchangeAuthCode provides a mock function with given fields: ctx, in

func (*MockInterface) ExchangeDeviceCode added in v1.26.0

func (_m *MockInterface) ExchangeDeviceCode(ctx context.Context, authResponse *oauth2dev.AuthorizationResponse) (*oidc.TokenSet, error)

ExchangeDeviceCode provides a mock function with given fields: ctx, authResponse

func (*MockInterface) GetAuthCodeURL added in v1.25.2

func (_m *MockInterface) GetAuthCodeURL(in AuthCodeURLInput) string

GetAuthCodeURL provides a mock function with given fields: in

func (*MockInterface) GetDeviceAuthorization added in v1.26.0

func (_m *MockInterface) GetDeviceAuthorization(ctx context.Context) (*oauth2dev.AuthorizationResponse, error)

GetDeviceAuthorization provides a mock function with given fields: ctx

func (*MockInterface) GetTokenByAuthCode added in v1.25.2

func (_m *MockInterface) GetTokenByAuthCode(ctx context.Context, in GetTokenByAuthCodeInput, localServerReadyChan chan<- string) (*oidc.TokenSet, error)

GetTokenByAuthCode provides a mock function with given fields: ctx, in, localServerReadyChan

func (*MockInterface) GetTokenByROPC added in v1.25.2

func (_m *MockInterface) GetTokenByROPC(ctx context.Context, username string, password string) (*oidc.TokenSet, error)

GetTokenByROPC provides a mock function with given fields: ctx, username, password

func (*MockInterface) Refresh added in v1.25.2

func (_m *MockInterface) Refresh(ctx context.Context, refreshToken string) (*oidc.TokenSet, error)

Refresh provides a mock function with given fields: ctx, refreshToken

func (*MockInterface) SupportedPKCEMethods added in v1.25.2

func (_m *MockInterface) SupportedPKCEMethods() []string

SupportedPKCEMethods provides a mock function with given fields:

type MockInterface_ExchangeAuthCode_Call added in v1.25.2

type MockInterface_ExchangeAuthCode_Call struct {
	*mock.Call
}

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

func (*MockInterface_ExchangeAuthCode_Call) Return added in v1.25.2

func (*MockInterface_ExchangeAuthCode_Call) Run added in v1.25.2

type MockInterface_ExchangeDeviceCode_Call added in v1.26.0

type MockInterface_ExchangeDeviceCode_Call struct {
	*mock.Call
}

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

func (*MockInterface_ExchangeDeviceCode_Call) Return added in v1.26.0

func (*MockInterface_ExchangeDeviceCode_Call) Run added in v1.26.0

type MockInterface_Expecter added in v1.25.2

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

func (*MockInterface_Expecter) ExchangeAuthCode added in v1.25.2

func (_e *MockInterface_Expecter) ExchangeAuthCode(ctx interface{}, in interface{}) *MockInterface_ExchangeAuthCode_Call

ExchangeAuthCode is a helper method to define mock.On call

  • ctx context.Context
  • in ExchangeAuthCodeInput

func (*MockInterface_Expecter) ExchangeDeviceCode added in v1.26.0

func (_e *MockInterface_Expecter) ExchangeDeviceCode(ctx interface{}, authResponse interface{}) *MockInterface_ExchangeDeviceCode_Call

ExchangeDeviceCode is a helper method to define mock.On call

  • ctx context.Context
  • authResponse *oauth2dev.AuthorizationResponse

func (*MockInterface_Expecter) GetAuthCodeURL added in v1.25.2

func (_e *MockInterface_Expecter) GetAuthCodeURL(in interface{}) *MockInterface_GetAuthCodeURL_Call

GetAuthCodeURL is a helper method to define mock.On call

  • in AuthCodeURLInput

func (*MockInterface_Expecter) GetDeviceAuthorization added in v1.26.0

func (_e *MockInterface_Expecter) GetDeviceAuthorization(ctx interface{}) *MockInterface_GetDeviceAuthorization_Call

GetDeviceAuthorization is a helper method to define mock.On call

  • ctx context.Context

func (*MockInterface_Expecter) GetTokenByAuthCode added in v1.25.2

func (_e *MockInterface_Expecter) GetTokenByAuthCode(ctx interface{}, in interface{}, localServerReadyChan interface{}) *MockInterface_GetTokenByAuthCode_Call

GetTokenByAuthCode is a helper method to define mock.On call

  • ctx context.Context
  • in GetTokenByAuthCodeInput
  • localServerReadyChan chan<- string

func (*MockInterface_Expecter) GetTokenByROPC added in v1.25.2

func (_e *MockInterface_Expecter) GetTokenByROPC(ctx interface{}, username interface{}, password interface{}) *MockInterface_GetTokenByROPC_Call

GetTokenByROPC is a helper method to define mock.On call

  • ctx context.Context
  • username string
  • password string

func (*MockInterface_Expecter) Refresh added in v1.25.2

func (_e *MockInterface_Expecter) Refresh(ctx interface{}, refreshToken interface{}) *MockInterface_Refresh_Call

Refresh is a helper method to define mock.On call

  • ctx context.Context
  • refreshToken string

func (*MockInterface_Expecter) SupportedPKCEMethods added in v1.25.2

SupportedPKCEMethods is a helper method to define mock.On call

type MockInterface_GetAuthCodeURL_Call added in v1.25.2

type MockInterface_GetAuthCodeURL_Call struct {
	*mock.Call
}

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

func (*MockInterface_GetAuthCodeURL_Call) Return added in v1.25.2

func (*MockInterface_GetAuthCodeURL_Call) Run added in v1.25.2

type MockInterface_GetDeviceAuthorization_Call added in v1.26.0

type MockInterface_GetDeviceAuthorization_Call struct {
	*mock.Call
}

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

func (*MockInterface_GetDeviceAuthorization_Call) Return added in v1.26.0

func (*MockInterface_GetDeviceAuthorization_Call) Run added in v1.26.0

type MockInterface_GetTokenByAuthCode_Call added in v1.25.2

type MockInterface_GetTokenByAuthCode_Call struct {
	*mock.Call
}

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

func (*MockInterface_GetTokenByAuthCode_Call) Return added in v1.25.2

func (*MockInterface_GetTokenByAuthCode_Call) Run added in v1.25.2

type MockInterface_GetTokenByROPC_Call added in v1.25.2

type MockInterface_GetTokenByROPC_Call struct {
	*mock.Call
}

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

func (*MockInterface_GetTokenByROPC_Call) Return added in v1.25.2

func (*MockInterface_GetTokenByROPC_Call) Run added in v1.25.2

type MockInterface_Refresh_Call added in v1.25.2

type MockInterface_Refresh_Call struct {
	*mock.Call
}

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

func (*MockInterface_Refresh_Call) Return added in v1.25.2

func (*MockInterface_Refresh_Call) Run added in v1.25.2

func (_c *MockInterface_Refresh_Call) Run(run func(ctx context.Context, refreshToken string)) *MockInterface_Refresh_Call

type MockInterface_SupportedPKCEMethods_Call added in v1.25.2

type MockInterface_SupportedPKCEMethods_Call struct {
	*mock.Call
}

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

func (*MockInterface_SupportedPKCEMethods_Call) Return added in v1.25.2

func (*MockInterface_SupportedPKCEMethods_Call) Run added in v1.25.2

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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