Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) GetEnvironment ¶ added in v0.3.0
type Credentials ¶
type Credentials struct { Audience string `json:"audience"` Source string `json:"source"` ClientId string `json:"clientId"` ExpiresAt string `json:"expiresAt"` Token string `json:"token"` RefreshToken string `json:"refreshToken"` }
func LoadCredentials ¶
func LoadCredentials(fileLocation string) (Credentials, error)
func NewCredentials ¶
func NewCredentials(audience, source, clientId, expiresAt, token string, refreshToken string) *Credentials
func (*Credentials) GetEnvironment ¶ added in v0.3.0
func (c *Credentials) GetEnvironment() (string, error)
func (*Credentials) WriteCredentials ¶
func (c *Credentials) WriteCredentials(fileLocation string) error
type DeviceTokenData ¶ added in v0.7.0
type DeviceTokenData struct { DeviceCode string `json:"device_code"` UserCode string `json:"user_code"` VerificationUri string `json:"verification_uri"` ExpiresIn int `json:"expires_in"` Interval int `json:"interval"` VerificationUriComplete string `json:"verification_uri_complete"` }
func GetDeviceCodeFromAuthorizationServer ¶ added in v0.7.0
func GetDeviceCodeFromAuthorizationServer(clientId, scope, audience, authUrl string) (*DeviceTokenData, error)
type ErrorResponse ¶ added in v0.7.0
type SuccessfulResponse ¶ added in v0.7.0
type SuccessfulResponse struct { // AccessToken Encoded JWT / Bearer Token AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` // SecondsUtilTokenExpires the number of seconds until the JWT expires, from when it was created by the Auth Server. // The JWT has the exact expiration date time SecondsUtilTokenExpires int `json:"expires_in"` }
func PollAuthorizationServerForResponse ¶ added in v0.7.0
func PollAuthorizationServerForResponse(cliClientId string, authUrl string, deviceTokenResponse *DeviceTokenData, authStartedAt time.Time) (*SuccessfulResponse, error)
func RefreshAuthToken ¶ added in v0.7.0
Click to show internal directories.
Click to hide internal directories.