authenticator

package
v0.0.0-...-7208f07 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewOptions, NewImpl)

ProviderSet is a provider set for wire

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	AuthCodeURL(ctx contextx.Contextx, state string, opts ...oauth2.AuthCodeOption) string

	Exchange(ctx contextx.Contextx, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

	VerifyIDToken(ctx contextx.Contextx, token *oauth2.Token) (*oidc.IDToken, error)

	Claims(idToken *oidc.IDToken) (profile map[string]interface{}, err error)
}

Authenticator declare authenticator functions

func NewImpl

func NewImpl(o *Options) (Authenticator, error)

NewImpl return Authenticator

type MockAuthenticator

type MockAuthenticator struct {
	mock.Mock
}

MockAuthenticator is an autogenerated mock type for the Authenticator type

func NewMockAuthenticator

func NewMockAuthenticator(t mockConstructorTestingTNewMockAuthenticator) *MockAuthenticator

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

func (*MockAuthenticator) AuthCodeURL

func (_m *MockAuthenticator) AuthCodeURL(ctx contextx.Contextx, state string, opts ...oauth2.AuthCodeOption) string

AuthCodeURL provides a mock function with given fields: ctx, state, opts

func (*MockAuthenticator) Claims

func (_m *MockAuthenticator) Claims(idToken *oidc.IDToken) (map[string]interface{}, error)

Claims provides a mock function with given fields: idToken

func (*MockAuthenticator) Exchange

func (_m *MockAuthenticator) Exchange(ctx contextx.Contextx, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)

Exchange provides a mock function with given fields: ctx, code, opts

func (*MockAuthenticator) VerifyIDToken

func (_m *MockAuthenticator) VerifyIDToken(ctx contextx.Contextx, token *oauth2.Token) (*oidc.IDToken, error)

VerifyIDToken provides a mock function with given fields: ctx, token

type Options

type Options struct {
	Domain       string
	ClientID     string
	ClientSecret string
	CallbackURL  string
	Endpoint     string
}

Options declare authenticator configuration

func NewOptions

func NewOptions(v *viper.Viper, logger *zap.Logger) (*Options, error)

NewOptions return *Options

Jump to

Keyboard shortcuts

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