Documentation ¶
Index ¶
- type Capability
- type MockCapabilityProvider
- func (mp *MockCapabilityProvider) GetAccessTokenForDevice(r *http.Request) (token string, username string, errInfo *oauth.DeviceAuthStatusErrorInfo, ...)
- func (mp *MockCapabilityProvider) GetLoginInfo() (loginInfo *oauth.LoginInfo, err error)
- func (mp *MockCapabilityProvider) GetLoginInfoForDevice(r *http.Request) (loginInfo *oauth.DeviceLoginInfo, err error)
- func (mp *MockCapabilityProvider) GetPermittedUser(r *http.Request, token string) (username string, err error)
- func (mp *MockCapabilityProvider) GetPermittedUserForDevice(t *http.Request, token string) (username string, err error)
- func (mp *MockCapabilityProvider) PerformAuthCodeExchange(r *http.Request) (token string, username string, err error)
- func (mp *MockCapabilityProvider) ValidateConfig() (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capability ¶
type Capability struct { Provider *MockCapabilityProvider Config *oauth.Config Logger *logger.Logger }
func (*Capability) GetConfigValidator ¶
func (cap *Capability) GetConfigValidator() (v validator.Validator)
GetConfigValidator returns a validator interface that can be called to validate the capability config
func (*Capability) GetInitFuncName ¶
func (cap *Capability) GetInitFuncName() (name string)
GetInitFuncName return the empty string as the mock capability doesn't use the plugin
func (*Capability) GetOAuthCapabilityEx ¶
func (cap *Capability) GetOAuthCapabilityEx() (capEx oauth.CapabilityEx)
GetOAuthCapabilityEx returns the mock provider's interface to the capability functions
func (*Capability) InitProvider ¶
func (cap *Capability) InitProvider(initFn plugin.Symbol)
InitProvider sets the capability provider to the local mock implementation
type MockCapabilityProvider ¶
type MockCapabilityProvider struct { PerformAuthCodeExchangeRequest *http.Request GetUserToken string ShouldFailGetLoginInfo bool ShouldFailGetAccessTokenForDevice bool Username string }
func (*MockCapabilityProvider) GetAccessTokenForDevice ¶
func (mp *MockCapabilityProvider) GetAccessTokenForDevice(r *http.Request) (token string, username string, errInfo *oauth.DeviceAuthStatusErrorInfo, err error)
func (*MockCapabilityProvider) GetLoginInfo ¶
func (mp *MockCapabilityProvider) GetLoginInfo() (loginInfo *oauth.LoginInfo, err error)
GetLoginInfo returns mock login info
func (*MockCapabilityProvider) GetLoginInfoForDevice ¶
func (mp *MockCapabilityProvider) GetLoginInfoForDevice(r *http.Request) (loginInfo *oauth.DeviceLoginInfo, err error)
func (*MockCapabilityProvider) GetPermittedUser ¶
func (mp *MockCapabilityProvider) GetPermittedUser(r *http.Request, token string) (username string, err error)
GetPermittedUser saves the token received and returns the configured mock username
func (*MockCapabilityProvider) GetPermittedUserForDevice ¶
func (*MockCapabilityProvider) PerformAuthCodeExchange ¶
func (mp *MockCapabilityProvider) PerformAuthCodeExchange(r *http.Request) (token string, username string, err error)
PerformAuthCodeExchange saves the received request and returns a mock token
func (*MockCapabilityProvider) ValidateConfig ¶
func (mp *MockCapabilityProvider) ValidateConfig() (err error)
ValidateConfig does nothing for the mock implementation
Click to show internal directories.
Click to hide internal directories.