authentication

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func AddPostAuthErrorHook added in v0.10.1

func AddPostAuthErrorHook(f func(r *http.Request, e error))

func AddPostAuthHook added in v0.10.1

func AddPostAuthHook(f func(r *http.Request, s *http.Response))

func ClearAccountManagementAuthenticationToken added in v0.9.0

func ClearAccountManagementAuthenticationToken() error

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 IsAccountManagementAuthenticationTokenSet added in v0.9.0

func IsAccountManagementAuthenticationTokenSet() bool

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 SaveAccountManagementAuthenticationToken added in v0.9.0

func SaveAccountManagementAuthenticationToken(response AccountManagementAuthenticationTokenStruct)

func SaveApiToken added in v0.8.1

func SaveApiToken(bearerToken *ApiTokenResponse)

func SaveCustomerToken added in v0.8.1

func SaveCustomerToken(response CustomerTokenResponse)

Types

type AccountManagementAuthenticationTokenResponse added in v0.9.0

type AccountManagementAuthenticationTokenResponse struct {
	Data []AccountManagementAuthenticationTokenStruct `json:"data"`
}

type AccountManagementAuthenticationTokenStruct added in v0.9.0

type AccountManagementAuthenticationTokenStruct struct {
	Type        string `json:"type"`
	AccountName string `json:"account_name"`
	AccountId   string `json:"account_id"`
	Expires     string `json:"expires"`
	Token       string `json:"token"`
}

func GetAccountManagementAuthenticationToken added in v0.9.0

func GetAccountManagementAuthenticationToken() *AccountManagementAuthenticationTokenStruct

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, warnOnNoAuthentication bool) (*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