Documentation ¶
Index ¶
- Variables
- type AuthMock
- func (a *AuthMock) Authenticate(user, pass string) (c *Credentials, err error)
- func (a *AuthMock) GetToken() (token string)
- func (a *AuthMock) V2Authenticate(authType, authCode, authCodeVerifier, refreshToken string) (c *V2Credentials, err error)
- func (a *AuthMock) V2GetUserCode() (uc *UserCode, err error)
- func (a *AuthMock) Validate() (err error)
- type Credentials
- type Service
- type UserCode
- type V2Credentials
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrGrantType = errors.New("Grant type is invalid, should be 'client_credentials', 'authorization_code' or 'refresh_token'")
View Source
var ErrNoAuthCodeOrVerifier = errors.New("Grant type 'authorization_code', should have both 'authorizationCode' and 'authorizationCodeVerifier' provided")
View Source
var ErrNoRefreshToken = errors.New("Grant type 'refresh_token', should have a refresh token provided")
ErrUnauthorized API no auth error
Functions ¶
This section is empty.
Types ¶
type AuthMock ¶
AuthMock mock of auth service
func (*AuthMock) Authenticate ¶
func (a *AuthMock) Authenticate(user, pass string) (c *Credentials, err error)
Authenticate mock of auth service
func (*AuthMock) V2Authenticate ¶ added in v1.1.1
func (a *AuthMock) V2Authenticate(authType, authCode, authCodeVerifier, refreshToken string) (c *V2Credentials, err error)
func (*AuthMock) V2GetUserCode ¶ added in v1.1.1
V2GetUserCode mock of auth service
type Credentials ¶
type Credentials struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` Scope string `json:"scope"` ExpiresIn int `json:"expires_in"` }
Credentials describes the API credential type
type Service ¶
type Service interface { V2GetUserCode() (*UserCode, error) Authenticate(username, password string) (*Credentials, error) V2Authenticate(authType, authCode, authCodeVerifier, refreshToken string) (c *V2Credentials, err error) Validate() error GetToken() string }
Service describes the auth service abstraction
Click to show internal directories.
Click to hide internal directories.