Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authentication ¶
type Authentication struct { DeviceCode string `json:"device_code"` UserCode string `json:"user_code"` VerficationURL string `json:"verification_url"` }
Authentication is used to exchange the keys with the oauth2 API
func GetVerificationURL ¶
func GetVerificationURL(clientID string) (auth Authentication, err error)
GetVerificationURL returns an url for the verification
type Credentials ¶
type Credentials struct { ClientID string `json:"client_id" url:"client_id,ifStringIsNotEmpty"` ClientSecret string `json:"client_secret" url:"client_secret,ifStringIsNotEmpty"` Code string `json:"-" url:"code,ifStringIsNotEmpty"` GrantType string `json:"-" url:"grant_type,ifStringIsNotEmpty"` AccessToken string `json:"access_token" url:"-"` }
Credentials represents the informations to get a token, there are saved in `~/$CONFIG/c14-cli/c14rc.json`
func GenerateCredentials ¶
func GenerateCredentials(clientID, deviceCode string) (c Credentials, err error)
GenerateCredentials calls the oauth2 API to get the credentials
func GetCredentials ¶
func GetCredentials() (c *Credentials, err error)
GetCredentials returns the C14 credentials file
func (*Credentials) Save ¶
func (c *Credentials) Save() (err error)
Save writes the credentials file
Click to show internal directories.
Click to hide internal directories.