Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Configs = configset.Set[Config]{ Default: &Config{}, }
Functions ¶
This section is empty.
Types ¶
type OAuth ¶
type OAuth struct {
BaseURL string
// contains filtered or unexported fields
}
func (*OAuth) FreshToken ¶
func (o *OAuth) FreshToken(ctx context.Context, l *zap.Logger, i sdktypes.Integration, vs sdktypes.Vars) *oauth2.Token
FreshToken returns the OAuth token stored in the connection variables. If it's stale, this function refreshes it first. A token without an expiry is considered fresh forever, so time-limited tokens with a missing timestamp need to add it. Refreshed tokens are saved back to the connection variables.
func (*OAuth) GetConfig ¶
func (o *OAuth) GetConfig(ctx context.Context, integration string, cid sdktypes.ConnectionID) (*oauth2.Config, map[string]string, error)
GetConfig returns the OAuth 2.0 configuration for the given integration. The connection ID may be nil, but if it's not, this function tries to use private OAuth app settings from the connection's variables instead of the integration's defaults. This function must be called only by trusted code, as it may return sensitive information!
Click to show internal directories.
Click to hide internal directories.