authentication

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HttpClient = &http.Client{
	Timeout: time.Second * 10,
}

Functions

func ClearApiToken added in v0.8.1

func ClearApiToken() error

func ClearCustomerToken added in v0.8.1

func ClearCustomerToken() error

func DisableAutoLogin added in v0.8.1

func DisableAutoLogin() error

func EnableAutoLogin added in v0.8.1

func EnableAutoLogin() error

func GetAuthenticationCacheDirectory added in v0.8.1

func GetAuthenticationCacheDirectory() string

func IsApiTokenSet added in v0.8.1

func IsApiTokenSet() bool

func IsAutoLoginEnabled added in v0.8.1

func IsAutoLoginEnabled() bool

func IsCustomerTokenSet added in v0.8.1

func IsCustomerTokenSet() bool

func SaveApiToken added in v0.8.1

func SaveApiToken(bearerToken *ApiTokenResponse)

func SaveCustomerToken added in v0.8.1

func SaveCustomerToken(response CustomerTokenResponse)

Types

type ApiTokenResponse added in v0.8.1

type ApiTokenResponse struct {
	Expires     int64  `json:"expires"`
	ExpiresIn   int    `json:"expires_in"`
	Identifier  string `json:"identifier"`
	TokenType   string `json:"token_type"`
	AccessToken string `json:"access_token"`
}

func GetApiToken added in v0.8.1

func GetApiToken() *ApiTokenResponse

func GetAuthenticationToken

func GetAuthenticationToken(useTokenFromProfileDir bool, valuesOverride *url.Values) (*ApiTokenResponse, error)

type CustomerTokenEpccCliAdditionalInfo added in v0.8.1

type CustomerTokenEpccCliAdditionalInfo struct {
	CustomerName  string `json:"customer_name"`
	CustomerEmail string `json:"customer_email"`
}

type CustomerTokenResponse added in v0.8.1

type CustomerTokenResponse struct {
	Data           CustomerTokenStruct                `json:"data"`
	AdditionalInfo CustomerTokenEpccCliAdditionalInfo `json:"additional_data"`
}

func GetCustomerToken added in v0.8.1

func GetCustomerToken() *CustomerTokenResponse

type CustomerTokenStruct added in v0.8.1

type CustomerTokenStruct struct {
	Type       string `json:"type"`
	Id         string `json:"id"`
	CustomerId string `json:"customer_id"`
	Expires    int64  `json:"expires"`
	Token      string `json:"token"`
}

Jump to

Keyboard shortcuts

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