Documentation ¶
Index ¶
- Constants
- func LegacyClose()
- func Reset()
- type Auth
- func (s *Auth) Authenticate() error
- func (s *Auth) AuthenticateWithDevice(deviceCode strfmt.UUID) (apiKey string, err error)
- func (s *Auth) AuthenticateWithDevicePolling(deviceCode strfmt.UUID, interval time.Duration) (string, error)
- func (s *Auth) AuthenticateWithModel(credentials *mono_models.Credentials) error
- func (s *Auth) AuthenticateWithToken(token string) error
- func (s *Auth) Authenticated() bool
- func (s *Auth) AvailableAPIToken() (v string)
- func (s *Auth) BearerToken() string
- func (s *Auth) CanWrite(organization string) bool
- func (s *Auth) Client() (*mono_client.Mono, error)
- func (s *Auth) ClientAuth() runtime.ClientAuthInfoWriter
- func (s *Auth) Close() error
- func (s *Auth) CreateToken() error
- func (s *Auth) Email() string
- func (s *Auth) Logout() error
- func (s *Auth) NewAPIKey(name string) (string, error)
- func (s *Auth) Refresh() error
- func (s *Auth) SaveToken(token string) error
- func (s *Auth) Sync() error
- func (s *Auth) SyncRequired() bool
- func (s *Auth) UserID() *strfmt.UUID
- func (s *Auth) WhoAmI() string
- type Configurable
- type ErrTokenRequired
- type ErrUnauthorized
Constants ¶
const ApiTokenConfigKey = "apiToken"
Variables ¶
This section is empty.
Functions ¶
func LegacyClose ¶
func LegacyClose()
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth is the base structure used to record the authenticated state
func (*Auth) Authenticate ¶
Authenticate will try to authenticate using stored credentials
func (*Auth) AuthenticateWithDevice ¶
func (*Auth) AuthenticateWithDevicePolling ¶
func (*Auth) AuthenticateWithModel ¶
func (s *Auth) AuthenticateWithModel(credentials *mono_models.Credentials) error
AuthenticateWithModel will try to authenticate using the given swagger model
func (*Auth) AuthenticateWithToken ¶
AuthenticateWithToken will try to authenticate using the given token
func (*Auth) Authenticated ¶
Authenticated checks whether we are currently authenticated
func (*Auth) AvailableAPIToken ¶
func (*Auth) BearerToken ¶
BearerToken returns the current bearerToken
func (*Auth) Client ¶
func (s *Auth) Client() (*mono_client.Mono, error)
Client will return an API client that has authentication set up
func (*Auth) ClientAuth ¶
func (s *Auth) ClientAuth() runtime.ClientAuthInfoWriter
ClientAuth returns the auth type required by swagger api calls
func (*Auth) CreateToken ¶
CreateToken will create an API token for the current authenticated user
func (*Auth) Sync ¶
Sync will ensure that the authenticated state is in sync with what is in the config database. This is mainly useful if you want to instrument the auth package without creating unnecessary API calls.
func (*Auth) SyncRequired ¶
type Configurable ¶
type ErrTokenRequired ¶
type ErrTokenRequired struct{ *locale.LocalizedError }
type ErrUnauthorized ¶