Example #1
0
func config() *oauth2.Config {
	return &oauth2.Config{
		ClientID:     bot.GetSecret(*pushClientID),
		ClientSecret: bot.GetSecret(*pushClientSecret),
		Endpoint: oauth2.Endpoint{
			AuthURL:  "https://www.pushbullet.com/authorize",
			TokenURL: pushAPI("/oauth2/token"),
		},
		RedirectURL: bot.HttpHost() + "/oauth/auth",
		Scopes:      []string{"everything"},
	}
}
Example #2
0
func githubClient() *github.Client {
	ts := oauth2.StaticTokenSource(
		&oauth2.Token{AccessToken: bot.GetSecret(*githubToken)},
	)
	tc := oauth2.NewClient(oauth2.NoContext, ts)

	return github.NewClient(tc)
}