Documentation ¶
Index ¶
- Variables
- func GetAuthenticatedClient(token string) (*kk.SDK, error)
- func SaveAccessToken(cfg config.Hook, token *AccessToken) error
- type AccessToken
- func LoadAccessToken(cfg config.Hook, refreshURL string, logger *slog.Logger) (*AccessToken, error)
- func PollForToken(ctx context.Context, httpClient *http.Client, url string, clientID string, ...) (*AccessToken, error)
- func RefreshAccessToken(refreshURL string, refreshToken string, _ *slog.Logger) (*AccessToken, error)
- type AccessTokenResponse
- type AuthenticatedClientFactory
- type DAGError
- type DeviceCodeResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DAGGrantType = "urn:ietf:params:oauth:grant-type:device_code" AuthorizationPendingErrorCode = "authorization_pending" )
Functions ¶
func SaveAccessToken ¶
func SaveAccessToken(cfg config.Hook, token *AccessToken) error
Types ¶
type AccessToken ¶
type AccessToken struct { Token *AccessTokenResponse `json:"token"` ReceivedAt time.Time `json:"received_at"` }
func LoadAccessToken ¶
For a given profile, load a saved token from disk in the same path as the config path. * If there is no file, return error. * If it's not expired, return it. * If it's expired, refresh it, then store it, then return it
func PollForToken ¶
func RefreshAccessToken ¶
func (*AccessToken) IsExpired ¶
func (t *AccessToken) IsExpired() bool
type AccessTokenResponse ¶
type DAGError ¶
type DeviceCodeResponse ¶
type DeviceCodeResponse struct { DeviceCode string `json:"device_code"` UserCode string `json:"user_code"` VerificationURI string `json:"verification_uri"` VerificationURIComplete string `json:"verification_uri_complete,omitempty"` ExpiresIn int `json:"expires_in"` Interval int `json:"interval,omitempty"` }
func RequestDeviceCode ¶
Click to show internal directories.
Click to hide internal directories.