Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseTokenOrchestrator ¶
type BaseTokenOrchestrator struct { ClientConfig *oauth.Config TokenCache cache.TokenCache }
BaseTokenOrchestrator implements the main logic to initiate device authorization flow
func NewBaseTokenOrchestrator ¶
func NewBaseTokenOrchestrator(ctx context.Context, tokenCache cache.TokenCache, authClient service.AuthMetadataServiceClient) (BaseTokenOrchestrator, error)
func (BaseTokenOrchestrator) FetchTokenFromCacheOrRefreshIt ¶
func (t BaseTokenOrchestrator) FetchTokenFromCacheOrRefreshIt(ctx context.Context, tokenRefreshGracePeriod config.Duration) (token *oauth2.Token, err error)
FetchTokenFromCacheOrRefreshIt fetches the token from cache and refreshes it if it'll expire within the Config.TokenRefreshGracePeriod period.
func (BaseTokenOrchestrator) RefreshToken ¶
func (t BaseTokenOrchestrator) RefreshToken(ctx context.Context, token *oauth2.Token) (*oauth2.Token, error)
RefreshToken attempts to refresh the access token if a refresh token is provided.
Click to show internal directories.
Click to hide internal directories.