Documentation ¶
Overview ¶
Package httpauth is a generated GoMock package.
Package httpauth is a generated GoMock package.
Index ¶
- Constants
- func CanonicalAddr(url *url.URL) string
- func GetMechanismsFromHttpFieldValue(token string) ([]string, error)
- func IsNTLMToken(token string) bool
- func IsSupportedMechanism(mechanism AuthenticationMechanism) bool
- func LookupSchemeFromCannonicalAddress(addr string, defaultScheme string) string
- func StringFromAuthenticationMechanism(mechanism AuthenticationMechanism) string
- type AuthenticationHandler
- func (a *AuthenticationHandler) Cancel()
- func (a *AuthenticationHandler) Close()
- func (a *AuthenticationHandler) GetAuthorizationValue(url *url.URL, responseToken string) (authorizeValue string, err error)
- func (a *AuthenticationHandler) IsStopped() bool
- func (a *AuthenticationHandler) SetBasicAuthentication(userInfo *url.Userinfo) error
- func (a *AuthenticationHandler) SetLogger(logger *log.Logger)
- func (a *AuthenticationHandler) SetSpnegoProvider(spnegoProvider SpnegoProvider)
- func (a *AuthenticationHandler) Succesful()
- func (a *AuthenticationHandler) Update(availableMechanism map[AuthenticationMechanism]string) (responseToken string, err error)
- type AuthenticationHandlerInterface
- type AuthenticationMechanism
- type AuthenticationState
- type MockAuthenticationHandlerInterface
- func (m *MockAuthenticationHandlerInterface) Cancel()
- func (m *MockAuthenticationHandlerInterface) Close()
- func (m *MockAuthenticationHandlerInterface) EXPECT() *MockAuthenticationHandlerInterfaceMockRecorder
- func (m *MockAuthenticationHandlerInterface) GetAuthorizationValue(url *url.URL, responseToken string) (string, error)
- func (m *MockAuthenticationHandlerInterface) IsStopped() bool
- func (m *MockAuthenticationHandlerInterface) SetBasicAuthentication(userInfo *url.Userinfo) error
- func (m *MockAuthenticationHandlerInterface) SetLogger(logger *log.Logger)
- func (m *MockAuthenticationHandlerInterface) SetSpnegoProvider(spnegoProvider SpnegoProvider)
- func (m *MockAuthenticationHandlerInterface) Succesful()
- func (m *MockAuthenticationHandlerInterface) Update(availableMechanism map[AuthenticationMechanism]string) (string, error)
- type MockAuthenticationHandlerInterfaceMockRecorder
- func (mr *MockAuthenticationHandlerInterfaceMockRecorder) Cancel() *gomock.Call
- func (mr *MockAuthenticationHandlerInterfaceMockRecorder) Close() *gomock.Call
- func (mr *MockAuthenticationHandlerInterfaceMockRecorder) GetAuthorizationValue(url, responseToken interface{}) *gomock.Call
- func (mr *MockAuthenticationHandlerInterfaceMockRecorder) IsStopped() *gomock.Call
- func (mr *MockAuthenticationHandlerInterfaceMockRecorder) SetBasicAuthentication(userInfo interface{}) *gomock.Call
- func (mr *MockAuthenticationHandlerInterfaceMockRecorder) SetLogger(logger interface{}) *gomock.Call
- func (mr *MockAuthenticationHandlerInterfaceMockRecorder) SetSpnegoProvider(spnegoProvider interface{}) *gomock.Call
- func (mr *MockAuthenticationHandlerInterfaceMockRecorder) Succesful() *gomock.Call
- func (mr *MockAuthenticationHandlerInterfaceMockRecorder) Update(availableMechanism interface{}) *gomock.Call
- type MockSpnegoProvider
- type MockSpnegoProviderMockRecorder
- type NonwindowsSpnegoProvider
- type ProxyAuthenticator
- type SpnegoProvider
Constants ¶
const ( AuthorizationKey string = "Authorization" ProxyAuthorizationKey string = "Proxy-Authorization" ProxyAuthenticateKey string = "Proxy-Authenticate" )
Variables ¶
This section is empty.
Functions ¶
func CanonicalAddr ¶
CanonicalAddr returns url.Host but always with a ":port" suffix
func IsNTLMToken ¶
func IsSupportedMechanism ¶
func IsSupportedMechanism(mechanism AuthenticationMechanism) bool
func StringFromAuthenticationMechanism ¶
func StringFromAuthenticationMechanism(mechanism AuthenticationMechanism) string
Types ¶
type AuthenticationHandler ¶
type AuthenticationHandler struct { Mechanism AuthenticationMechanism // contains filtered or unexported fields }
func (*AuthenticationHandler) Cancel ¶
func (a *AuthenticationHandler) Cancel()
func (*AuthenticationHandler) Close ¶
func (a *AuthenticationHandler) Close()
func (*AuthenticationHandler) GetAuthorizationValue ¶
func (*AuthenticationHandler) IsStopped ¶
func (a *AuthenticationHandler) IsStopped() bool
func (*AuthenticationHandler) SetBasicAuthentication ¶
func (a *AuthenticationHandler) SetBasicAuthentication(userInfo *url.Userinfo) error
func (*AuthenticationHandler) SetLogger ¶
func (a *AuthenticationHandler) SetLogger(logger *log.Logger)
func (*AuthenticationHandler) SetSpnegoProvider ¶
func (a *AuthenticationHandler) SetSpnegoProvider(spnegoProvider SpnegoProvider)
func (*AuthenticationHandler) Succesful ¶
func (a *AuthenticationHandler) Succesful()
func (*AuthenticationHandler) Update ¶
func (a *AuthenticationHandler) Update(availableMechanism map[AuthenticationMechanism]string) (responseToken string, err error)
type AuthenticationHandlerInterface ¶
type AuthenticationHandlerInterface interface { Close() Cancel() Succesful() IsStopped() bool GetAuthorizationValue(url *url.URL, responseToken string) (string, error) Update(availableMechanism map[AuthenticationMechanism]string) (string, error) SetBasicAuthentication(userInfo *url.Userinfo) error SetLogger(logger *log.Logger) SetSpnegoProvider(spnegoProvider SpnegoProvider) }
func NewHandler ¶
func NewHandler(mechanism AuthenticationMechanism) AuthenticationHandlerInterface
type AuthenticationMechanism ¶
type AuthenticationMechanism string
const ( NoAuth AuthenticationMechanism = "noauth" Negotiate AuthenticationMechanism = "negotiate" AnyAuth AuthenticationMechanism = "anyauth" BasicAuth AuthenticationMechanism = "basic" UnknownMechanism AuthenticationMechanism = "unknownmechanism" )
func AuthenticationMechanismFromString ¶
func AuthenticationMechanismFromString(mechanism string) AuthenticationMechanism
func GetMechanismAndToken ¶
func GetMechanismAndToken(HttpFieldValue string) (AuthenticationMechanism, string)
type AuthenticationState ¶
type AuthenticationState int
const ( Initial AuthenticationState = iota Negotiating AuthenticationState = iota Done AuthenticationState = iota Error AuthenticationState = iota Cancel AuthenticationState = iota Close AuthenticationState = iota )
type MockAuthenticationHandlerInterface ¶
type MockAuthenticationHandlerInterface struct {
// contains filtered or unexported fields
}
MockAuthenticationHandlerInterface is a mock of AuthenticationHandlerInterface interface.
func NewMockAuthenticationHandlerInterface ¶
func NewMockAuthenticationHandlerInterface(ctrl *gomock.Controller) *MockAuthenticationHandlerInterface
NewMockAuthenticationHandlerInterface creates a new mock instance.
func (*MockAuthenticationHandlerInterface) Cancel ¶
func (m *MockAuthenticationHandlerInterface) Cancel()
Cancel mocks base method.
func (*MockAuthenticationHandlerInterface) Close ¶
func (m *MockAuthenticationHandlerInterface) Close()
Close mocks base method.
func (*MockAuthenticationHandlerInterface) EXPECT ¶
func (m *MockAuthenticationHandlerInterface) EXPECT() *MockAuthenticationHandlerInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockAuthenticationHandlerInterface) GetAuthorizationValue ¶
func (m *MockAuthenticationHandlerInterface) GetAuthorizationValue(url *url.URL, responseToken string) (string, error)
GetAuthorizationValue mocks base method.
func (*MockAuthenticationHandlerInterface) IsStopped ¶
func (m *MockAuthenticationHandlerInterface) IsStopped() bool
IsStopped mocks base method.
func (*MockAuthenticationHandlerInterface) SetBasicAuthentication ¶
func (m *MockAuthenticationHandlerInterface) SetBasicAuthentication(userInfo *url.Userinfo) error
SetBasicAuthentication mocks base method.
func (*MockAuthenticationHandlerInterface) SetLogger ¶
func (m *MockAuthenticationHandlerInterface) SetLogger(logger *log.Logger)
SetLogger mocks base method.
func (*MockAuthenticationHandlerInterface) SetSpnegoProvider ¶
func (m *MockAuthenticationHandlerInterface) SetSpnegoProvider(spnegoProvider SpnegoProvider)
SetSpnegoProvider mocks base method.
func (*MockAuthenticationHandlerInterface) Succesful ¶
func (m *MockAuthenticationHandlerInterface) Succesful()
Succesful mocks base method.
func (*MockAuthenticationHandlerInterface) Update ¶
func (m *MockAuthenticationHandlerInterface) Update(availableMechanism map[AuthenticationMechanism]string) (string, error)
Update mocks base method.
type MockAuthenticationHandlerInterfaceMockRecorder ¶
type MockAuthenticationHandlerInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockAuthenticationHandlerInterfaceMockRecorder is the mock recorder for MockAuthenticationHandlerInterface.
func (*MockAuthenticationHandlerInterfaceMockRecorder) Cancel ¶
func (mr *MockAuthenticationHandlerInterfaceMockRecorder) Cancel() *gomock.Call
Cancel indicates an expected call of Cancel.
func (*MockAuthenticationHandlerInterfaceMockRecorder) Close ¶
func (mr *MockAuthenticationHandlerInterfaceMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockAuthenticationHandlerInterfaceMockRecorder) GetAuthorizationValue ¶
func (mr *MockAuthenticationHandlerInterfaceMockRecorder) GetAuthorizationValue(url, responseToken interface{}) *gomock.Call
GetAuthorizationValue indicates an expected call of GetAuthorizationValue.
func (*MockAuthenticationHandlerInterfaceMockRecorder) IsStopped ¶
func (mr *MockAuthenticationHandlerInterfaceMockRecorder) IsStopped() *gomock.Call
IsStopped indicates an expected call of IsStopped.
func (*MockAuthenticationHandlerInterfaceMockRecorder) SetBasicAuthentication ¶
func (mr *MockAuthenticationHandlerInterfaceMockRecorder) SetBasicAuthentication(userInfo interface{}) *gomock.Call
SetBasicAuthentication indicates an expected call of SetBasicAuthentication.
func (*MockAuthenticationHandlerInterfaceMockRecorder) SetLogger ¶
func (mr *MockAuthenticationHandlerInterfaceMockRecorder) SetLogger(logger interface{}) *gomock.Call
SetLogger indicates an expected call of SetLogger.
func (*MockAuthenticationHandlerInterfaceMockRecorder) SetSpnegoProvider ¶
func (mr *MockAuthenticationHandlerInterfaceMockRecorder) SetSpnegoProvider(spnegoProvider interface{}) *gomock.Call
SetSpnegoProvider indicates an expected call of SetSpnegoProvider.
func (*MockAuthenticationHandlerInterfaceMockRecorder) Succesful ¶
func (mr *MockAuthenticationHandlerInterfaceMockRecorder) Succesful() *gomock.Call
Succesful indicates an expected call of Succesful.
func (*MockAuthenticationHandlerInterfaceMockRecorder) Update ¶
func (mr *MockAuthenticationHandlerInterfaceMockRecorder) Update(availableMechanism interface{}) *gomock.Call
Update indicates an expected call of Update.
type MockSpnegoProvider ¶
type MockSpnegoProvider struct {
// contains filtered or unexported fields
}
MockSpnegoProvider is a mock of SpnegoProvider interface.
func NewMockSpnegoProvider ¶
func NewMockSpnegoProvider(ctrl *gomock.Controller) *MockSpnegoProvider
NewMockSpnegoProvider creates a new mock instance.
func (*MockSpnegoProvider) Close ¶
func (m *MockSpnegoProvider) Close() error
Close mocks base method.
func (*MockSpnegoProvider) EXPECT ¶
func (m *MockSpnegoProvider) EXPECT() *MockSpnegoProviderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSpnegoProvider) SetLogger ¶
func (m *MockSpnegoProvider) SetLogger(logger *log.Logger)
SetLogger mocks base method.
type MockSpnegoProviderMockRecorder ¶
type MockSpnegoProviderMockRecorder struct {
// contains filtered or unexported fields
}
MockSpnegoProviderMockRecorder is the mock recorder for MockSpnegoProvider.
func (*MockSpnegoProviderMockRecorder) Close ¶
func (mr *MockSpnegoProviderMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockSpnegoProviderMockRecorder) GetToken ¶
func (mr *MockSpnegoProviderMockRecorder) GetToken(url, responseToken interface{}) *gomock.Call
GetToken indicates an expected call of GetToken.
func (*MockSpnegoProviderMockRecorder) SetLogger ¶
func (mr *MockSpnegoProviderMockRecorder) SetLogger(logger interface{}) *gomock.Call
SetLogger indicates an expected call of SetLogger.
type NonwindowsSpnegoProvider ¶
type NonwindowsSpnegoProvider struct {
// contains filtered or unexported fields
}
func (*NonwindowsSpnegoProvider) Close ¶
func (s *NonwindowsSpnegoProvider) Close() error
func (*NonwindowsSpnegoProvider) SetLogger ¶
func (s *NonwindowsSpnegoProvider) SetLogger(logger *log.Logger)
type ProxyAuthenticator ¶
type ProxyAuthenticator struct { CreateHandler func(mechanism AuthenticationMechanism) AuthenticationHandlerInterface // contains filtered or unexported fields }
func NewProxyAuthenticator ¶
func NewProxyAuthenticator(mechanism AuthenticationMechanism, upstreamProxy func(*http.Request) (*url.URL, error), logger *log.Logger) *ProxyAuthenticator
func (*ProxyAuthenticator) DialContext ¶
func (p *ProxyAuthenticator) DialContext(ctx context.Context, network, addr string) (net.Conn, error)
This is the main entry point function for the ProxyAuthenticator when being used with http.Transport. It should be used like this: transport.DialContext = DialContext It'll be invoked by http.Transport when it requires a new TCP connection.
func (*ProxyAuthenticator) GetMechanism ¶
func (p *ProxyAuthenticator) GetMechanism() AuthenticationMechanism
type SpnegoProvider ¶
type SpnegoProvider interface { GetToken(url *url.URL, responseToken string) (string, bool, error) Close() error SetLogger(logger *log.Logger) }
func SpnegoProviderInstance ¶
func SpnegoProviderInstance() SpnegoProvider