diff --git a/gothic/gothic.go b/gothic/gothic.go index 86adf58e9..eddb3f69b 100644 --- a/gothic/gothic.go +++ b/gothic/gothic.go @@ -365,3 +365,10 @@ func updateSessionValue(session *sessions.Session, key, value string) error { session.Values[key] = b.String() return nil } + +func FetchUserInfoWithToken(token string) (goth.User, error) { + + result := goth.User{} + + return result, nil +} diff --git a/provider.go b/provider.go index 4635a4203..423b93ef6 100644 --- a/provider.go +++ b/provider.go @@ -19,6 +19,9 @@ type Provider interface { Debug(bool) RefreshToken(refreshToken string) (*oauth2.Token, error) // Get new access token based on the refresh token RefreshTokenAvailable() bool // Refresh token is provided by auth provider or not + // IsEmailProvided() bool + // IsPhoneProvided() bool + FetchUserWithToken(string) (User, error) } const NoAuthUrlErrorMessage = "an AuthURL has not been set" diff --git a/providers/amazon/amazon.go b/providers/amazon/amazon.go index 7061e4d7a..349e7723f 100644 --- a/providers/amazon/amazon.go +++ b/providers/amazon/amazon.go @@ -5,6 +5,7 @@ package amazon import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -165,3 +166,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/apple/apple.go b/providers/apple/apple.go index 83000094e..48c0f57d6 100644 --- a/providers/apple/apple.go +++ b/providers/apple/apple.go @@ -240,3 +240,8 @@ func (p *Provider) RevokeToken(token string) error { return nil } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + //TODO: + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/auth0/auth0.go b/providers/auth0/auth0.go index c07b9db47..34e23bf90 100644 --- a/providers/auth0/auth0.go +++ b/providers/auth0/auth0.go @@ -5,6 +5,7 @@ package auth0 import ( "bytes" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -181,3 +182,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/azuread/azuread.go b/providers/azuread/azuread.go index 8717ddf37..6c987aa44 100644 --- a/providers/azuread/azuread.go +++ b/providers/azuread/azuread.go @@ -5,6 +5,7 @@ package azuread import ( "encoding/json" + "errors" "fmt" "io" "net/http" @@ -185,3 +186,7 @@ func userFromReader(r io.Reader, user *goth.User) error { func authorizationHeader(session *Session) (string, string) { return "Authorization", fmt.Sprintf("Bearer %s", session.AccessToken) } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/azureadv2/azureadv2.go b/providers/azureadv2/azureadv2.go index 523f79cce..2b9b11a55 100644 --- a/providers/azureadv2/azureadv2.go +++ b/providers/azureadv2/azureadv2.go @@ -2,6 +2,7 @@ package azureadv2 import ( "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -231,3 +232,7 @@ func scopesToStrings(scopes ...ScopeType) []string { } return strs } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/battlenet/battlenet.go b/providers/battlenet/battlenet.go index 3a52b47e7..05c718dc6 100644 --- a/providers/battlenet/battlenet.go +++ b/providers/battlenet/battlenet.go @@ -5,6 +5,7 @@ package battlenet import ( "bytes" "encoding/json" + "errors" "fmt" "io/ioutil" "net/http" @@ -151,3 +152,7 @@ func (p *Provider) RefreshTokenAvailable() bool { func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { return nil, nil } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/bitbucket/bitbucket.go b/providers/bitbucket/bitbucket.go index 06f2c9607..33859acd4 100644 --- a/providers/bitbucket/bitbucket.go +++ b/providers/bitbucket/bitbucket.go @@ -4,6 +4,7 @@ package bitbucket import ( "bytes" "encoding/json" + "errors" "fmt" "io/ioutil" "net/http" @@ -239,3 +240,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/bitly/bitly.go b/providers/bitly/bitly.go index f302d5fe4..753bb87f4 100644 --- a/providers/bitly/bitly.go +++ b/providers/bitly/bitly.go @@ -169,3 +169,7 @@ func getEmail(emails []struct { return "", fmt.Errorf("The user does not have a verified, primary email address on Bitly") } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/box/box.go b/providers/box/box.go index 92b8b730b..e53a23034 100644 --- a/providers/box/box.go +++ b/providers/box/box.go @@ -4,6 +4,7 @@ package box import ( "encoding/json" + "errors" "fmt" "io" "net/http" @@ -156,3 +157,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/classlink/provider.go b/providers/classlink/provider.go index a64a67cae..deaaf5715 100644 --- a/providers/classlink/provider.go +++ b/providers/classlink/provider.go @@ -154,3 +154,7 @@ func newConfig(provider *Provider, scopes []string) *oauth2.Config { return c } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/cloudfoundry/cf.go b/providers/cloudfoundry/cf.go index 31eb63f2e..338258dfd 100644 --- a/providers/cloudfoundry/cf.go +++ b/providers/cloudfoundry/cf.go @@ -6,6 +6,7 @@ import ( "bytes" "context" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -175,3 +176,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/cognito/cognito.go b/providers/cognito/cognito.go index ff4bee58d..ba03ec2fb 100644 --- a/providers/cognito/cognito.go +++ b/providers/cognito/cognito.go @@ -3,6 +3,7 @@ package cognito import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -237,3 +238,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/dailymotion/dailymotion.go b/providers/dailymotion/dailymotion.go index d3c1e1d24..17b18ac01 100644 --- a/providers/dailymotion/dailymotion.go +++ b/providers/dailymotion/dailymotion.go @@ -5,6 +5,7 @@ package dailymotion import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -187,3 +188,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/deezer/deezer.go b/providers/deezer/deezer.go index a0f9b9d1d..ec5e0a92b 100644 --- a/providers/deezer/deezer.go +++ b/providers/deezer/deezer.go @@ -178,3 +178,7 @@ func (p *Provider) RefreshTokenAvailable() bool { func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { return nil, errors.New("Refresh token is not provided by deezer") } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/digitalocean/digitalocean.go b/providers/digitalocean/digitalocean.go index 69a7a639e..a49ef865b 100644 --- a/providers/digitalocean/digitalocean.go +++ b/providers/digitalocean/digitalocean.go @@ -5,6 +5,7 @@ package digitalocean import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -176,3 +177,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/discord/discord.go b/providers/discord/discord.go index 9b3030f2d..71edcdcd7 100644 --- a/providers/discord/discord.go +++ b/providers/discord/discord.go @@ -5,6 +5,7 @@ package discord import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -235,3 +236,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/dropbox/dropbox.go b/providers/dropbox/dropbox.go index da55dba15..05ca5aedd 100644 --- a/providers/dropbox/dropbox.go +++ b/providers/dropbox/dropbox.go @@ -210,3 +210,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return false } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/eveonline/eveonline.go b/providers/eveonline/eveonline.go index ad18776b6..b15280672 100644 --- a/providers/eveonline/eveonline.go +++ b/providers/eveonline/eveonline.go @@ -5,6 +5,7 @@ package eveonline import ( "bytes" "encoding/json" + "errors" "fmt" "io/ioutil" "net/http" @@ -160,3 +161,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/facebook/facebook.go b/providers/facebook/facebook.go index 23773ca34..252afd722 100644 --- a/providers/facebook/facebook.go +++ b/providers/facebook/facebook.go @@ -214,3 +214,8 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return false } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + // TODO: + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/faux/faux.go b/providers/faux/faux.go index 4b0cc5dd1..86c0e8f49 100644 --- a/providers/faux/faux.go +++ b/providers/faux/faux.go @@ -4,6 +4,7 @@ package faux import ( "encoding/json" + "errors" "fmt" "net/http" "strings" @@ -108,3 +109,7 @@ func (s *Session) Marshal() string { func (s *Session) GetAuthURL() (string, error) { return s.AuthURL, nil } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/fitbit/fitbit.go b/providers/fitbit/fitbit.go index 8f402ada7..776fcb75d 100644 --- a/providers/fitbit/fitbit.go +++ b/providers/fitbit/fitbit.go @@ -4,6 +4,7 @@ package fitbit import ( "encoding/json" + "errors" "fmt" "io" "net/http" @@ -193,3 +194,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return true } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/gitea/gitea.go b/providers/gitea/gitea.go index 6156df176..45d29093b 100644 --- a/providers/gitea/gitea.go +++ b/providers/gitea/gitea.go @@ -5,6 +5,7 @@ package gitea import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -185,3 +186,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/github/github.go b/providers/github/github.go index 962d07a33..561df678f 100644 --- a/providers/github/github.go +++ b/providers/github/github.go @@ -243,3 +243,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return false } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/gitlab/gitlab.go b/providers/gitlab/gitlab.go index e5457cf0a..b278bd41b 100644 --- a/providers/gitlab/gitlab.go +++ b/providers/gitlab/gitlab.go @@ -5,6 +5,7 @@ package gitlab import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -186,3 +187,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/google/google.go b/providers/google/google.go index a266c91a2..a05a704c9 100644 --- a/providers/google/google.go +++ b/providers/google/google.go @@ -4,6 +4,7 @@ package google import ( "encoding/json" + "errors" "fmt" "io/ioutil" "net/http" @@ -209,3 +210,8 @@ func (p *Provider) SetAccessType(at string) { } p.authCodeOptions = append(p.authCodeOptions, oauth2.SetAuthURLParam("access_type", at)) } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + //TODO: Implement this + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/gplus/gplus.go b/providers/gplus/gplus.go index 61e9a0ea0..87a930228 100644 --- a/providers/gplus/gplus.go +++ b/providers/gplus/gplus.go @@ -5,6 +5,7 @@ package gplus import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -193,3 +194,8 @@ func (p *Provider) SetPrompt(prompt ...string) { } p.prompt = oauth2.SetAuthURLParam("prompt", strings.Join(prompt, " ")) } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + //TODO + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/heroku/heroku.go b/providers/heroku/heroku.go index 3df805463..aa2ab823c 100644 --- a/providers/heroku/heroku.go +++ b/providers/heroku/heroku.go @@ -4,6 +4,7 @@ package heroku import ( "encoding/json" + "errors" "fmt" "io" "net/http" @@ -155,3 +156,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/hubspot/hubspot.go b/providers/hubspot/hubspot.go index 4358481f1..0a3764a0d 100644 --- a/providers/hubspot/hubspot.go +++ b/providers/hubspot/hubspot.go @@ -2,6 +2,7 @@ package hubspot import ( "encoding/json" + "errors" "fmt" "io/ioutil" "net/http" @@ -172,3 +173,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/influxcloud/influxcloud.go b/providers/influxcloud/influxcloud.go index 7f7ad94c6..7a7d11d9c 100644 --- a/providers/influxcloud/influxcloud.go +++ b/providers/influxcloud/influxcloud.go @@ -179,3 +179,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return false } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/instagram/instagram.go b/providers/instagram/instagram.go index b4703dc44..4434688dc 100644 --- a/providers/instagram/instagram.go +++ b/providers/instagram/instagram.go @@ -172,3 +172,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return false } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/intercom/intercom.go b/providers/intercom/intercom.go index b58e864ae..8670c756a 100644 --- a/providers/intercom/intercom.go +++ b/providers/intercom/intercom.go @@ -180,3 +180,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return false } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/kakao/kakao.go b/providers/kakao/kakao.go index f19e35ad8..544aad035 100644 --- a/providers/kakao/kakao.go +++ b/providers/kakao/kakao.go @@ -5,6 +5,7 @@ package kakao import ( "bytes" "encoding/json" + "errors" "fmt" "io/ioutil" "net/http" @@ -160,3 +161,7 @@ func (p *Provider) RefreshTokenAvailable() bool { func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { return nil, nil } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/lastfm/lastfm.go b/providers/lastfm/lastfm.go index ad30e8d07..a2e6669da 100644 --- a/providers/lastfm/lastfm.go +++ b/providers/lastfm/lastfm.go @@ -228,3 +228,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return false } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/line/line.go b/providers/line/line.go index e4d2e9555..b8721faa7 100644 --- a/providers/line/line.go +++ b/providers/line/line.go @@ -5,6 +5,7 @@ package line import ( "bytes" "encoding/json" + "errors" "fmt" "io/ioutil" "net/http" @@ -167,3 +168,7 @@ func (p *Provider) SetBotPrompt(botPrompt string) { } p.authCodeOptions = append(p.authCodeOptions, oauth2.SetAuthURLParam("bot_prompt", botPrompt)) } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/linkedin/linkedin.go b/providers/linkedin/linkedin.go index 5719911d7..9eb37749d 100644 --- a/providers/linkedin/linkedin.go +++ b/providers/linkedin/linkedin.go @@ -276,3 +276,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return false } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/mailru/mailru.go b/providers/mailru/mailru.go index db38280e2..36b908344 100644 --- a/providers/mailru/mailru.go +++ b/providers/mailru/mailru.go @@ -4,6 +4,7 @@ package mailru import ( "encoding/json" + "errors" "fmt" "io/ioutil" "net/http" @@ -136,3 +137,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return true } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/mastodon/mastodon.go b/providers/mastodon/mastodon.go index a69788d20..4f9d4e3bc 100644 --- a/providers/mastodon/mastodon.go +++ b/providers/mastodon/mastodon.go @@ -5,6 +5,7 @@ package mastodon import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -183,3 +184,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/meetup/meetup.go b/providers/meetup/meetup.go index 3d1ef0c8c..0c86849b7 100644 --- a/providers/meetup/meetup.go +++ b/providers/meetup/meetup.go @@ -5,6 +5,7 @@ package meetup import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -195,3 +196,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/microsoftonline/microsoftonline.go b/providers/microsoftonline/microsoftonline.go index abf5db21c..e85e2e17d 100644 --- a/providers/microsoftonline/microsoftonline.go +++ b/providers/microsoftonline/microsoftonline.go @@ -6,6 +6,7 @@ package microsoftonline import ( "bytes" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -188,3 +189,7 @@ func userFromReader(r io.Reader, user *goth.User) error { func authorizationHeader(session *Session) (string, string) { return "Authorization", fmt.Sprintf("Bearer %s", session.AccessToken) } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/naver/naver.go b/providers/naver/naver.go index dad6beb89..23485f641 100644 --- a/providers/naver/naver.go +++ b/providers/naver/naver.go @@ -3,6 +3,7 @@ package naver import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -171,3 +172,7 @@ func userFromReader(reader io.Reader, user *goth.User) error { return nil } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/nextcloud/nextcloud.go b/providers/nextcloud/nextcloud.go index 23d3ee896..72672469b 100644 --- a/providers/nextcloud/nextcloud.go +++ b/providers/nextcloud/nextcloud.go @@ -5,6 +5,7 @@ package nextcloud import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -204,3 +205,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/okta/okta.go b/providers/okta/okta.go index b53eae2b4..7a339b8db 100644 --- a/providers/okta/okta.go +++ b/providers/okta/okta.go @@ -5,6 +5,7 @@ package okta import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -196,3 +197,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/onedrive/onedrive.go b/providers/onedrive/onedrive.go index dcb96e9cb..a5c174de5 100644 --- a/providers/onedrive/onedrive.go +++ b/providers/onedrive/onedrive.go @@ -5,6 +5,7 @@ package onedrive import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -162,3 +163,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/openidConnect/openidConnect.go b/providers/openidConnect/openidConnect.go index 4a7215948..99034bdc0 100644 --- a/providers/openidConnect/openidConnect.go +++ b/providers/openidConnect/openidConnect.go @@ -518,3 +518,7 @@ func unMarshal(payload []byte) (map[string]interface{}, error) { return data, json.NewDecoder(bytes.NewBuffer(payload)).Decode(&data) } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/oura/oura.go b/providers/oura/oura.go index a62e89470..afe5d7553 100644 --- a/providers/oura/oura.go +++ b/providers/oura/oura.go @@ -3,6 +3,7 @@ package oura import ( "encoding/json" + "errors" "fmt" "io" "net/http" @@ -189,3 +190,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return true } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/patreon/patreon.go b/providers/patreon/patreon.go index a599b75e1..ebe9dbc76 100644 --- a/providers/patreon/patreon.go +++ b/providers/patreon/patreon.go @@ -3,6 +3,7 @@ package patreon import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -218,3 +219,7 @@ func userFromReader(r io.Reader, user *goth.User) error { user.AvatarURL = u.Data.Attributes.ImageURL return nil } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/paypal/paypal.go b/providers/paypal/paypal.go index bca0b8b77..536d2339f 100644 --- a/providers/paypal/paypal.go +++ b/providers/paypal/paypal.go @@ -5,6 +5,7 @@ package paypal import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -198,3 +199,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/reddit/reddit.go b/providers/reddit/reddit.go index ce06143df..cb1dce44b 100644 --- a/providers/reddit/reddit.go +++ b/providers/reddit/reddit.go @@ -2,6 +2,7 @@ package reddit import ( "encoding/json" + "errors" "fmt" "io/ioutil" "net/http" @@ -135,3 +136,7 @@ func (p *Provider) FetchUser(s goth.Session) (goth.User, error) { return gothUser, nil } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/salesforce/salesforce.go b/providers/salesforce/salesforce.go index d4a1c3f50..7d7369fff 100644 --- a/providers/salesforce/salesforce.go +++ b/providers/salesforce/salesforce.go @@ -5,6 +5,7 @@ package salesforce import ( "bytes" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -189,3 +190,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/seatalk/seatalk.go b/providers/seatalk/seatalk.go index fd6161be6..278e3a3a9 100644 --- a/providers/seatalk/seatalk.go +++ b/providers/seatalk/seatalk.go @@ -3,6 +3,7 @@ package seatalk import ( "context" "encoding/json" + "errors" "fmt" "io/ioutil" "net/http" @@ -159,3 +160,7 @@ func newConfig(provider *Provider, scopes []string) *oauth2.Config { func (p *Provider) RefreshTokenAvailable() bool { return true } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/shopify/shopify.go b/providers/shopify/shopify.go index 9b1450680..a72d44f38 100755 --- a/providers/shopify/shopify.go +++ b/providers/shopify/shopify.go @@ -190,3 +190,7 @@ func newConfig(p *Provider, scopes []string) *oauth2.Config { return c } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/slack/slack.go b/providers/slack/slack.go index 84036ea96..daadb5209 100644 --- a/providers/slack/slack.go +++ b/providers/slack/slack.go @@ -5,6 +5,7 @@ package slack import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -235,3 +236,7 @@ func (p *Provider) RefreshTokenAvailable() bool { func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { return nil, nil } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/soundcloud/soundcloud.go b/providers/soundcloud/soundcloud.go index 2e11ee624..b0d947231 100644 --- a/providers/soundcloud/soundcloud.go +++ b/providers/soundcloud/soundcloud.go @@ -5,6 +5,7 @@ package soundcloud import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -168,3 +169,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/spotify/spotify.go b/providers/spotify/spotify.go index f36512c0c..ed214636d 100644 --- a/providers/spotify/spotify.go +++ b/providers/spotify/spotify.go @@ -4,6 +4,7 @@ package spotify import ( "encoding/json" + "errors" "fmt" "io" "net/http" @@ -222,3 +223,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/steam/steam.go b/providers/steam/steam.go index 79679defe..23bff4514 100644 --- a/providers/steam/steam.go +++ b/providers/steam/steam.go @@ -3,6 +3,7 @@ package steam import ( "encoding/json" + "errors" "fmt" "io" "net/http" @@ -197,3 +198,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return false } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/strava/strava.go b/providers/strava/strava.go index 785cc7fb2..bdd8146f6 100644 --- a/providers/strava/strava.go +++ b/providers/strava/strava.go @@ -5,6 +5,7 @@ package strava import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -181,3 +182,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/stripe/stripe.go b/providers/stripe/stripe.go index b2c2257ba..19874de63 100644 --- a/providers/stripe/stripe.go +++ b/providers/stripe/stripe.go @@ -4,6 +4,7 @@ package stripe import ( "encoding/json" + "errors" "fmt" "io" "net/http" @@ -162,3 +163,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/tiktok/tiktok.go b/providers/tiktok/tiktok.go index 1d3332188..d6ab32fe9 100644 --- a/providers/tiktok/tiktok.go +++ b/providers/tiktok/tiktok.go @@ -5,6 +5,7 @@ package tiktok import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -277,3 +278,7 @@ func handleErrorResponse(data []byte) error { return fmt.Errorf("%s [%d]", errResp.Data.Description, errResp.Data.ErrorCode) } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/tumblr/tumblr.go b/providers/tumblr/tumblr.go index 07028c227..c7414ef55 100644 --- a/providers/tumblr/tumblr.go +++ b/providers/tumblr/tumblr.go @@ -150,3 +150,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return false } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/twitch/twitch.go b/providers/twitch/twitch.go index 9f350f9bd..d8ba470b3 100644 --- a/providers/twitch/twitch.go +++ b/providers/twitch/twitch.go @@ -428,3 +428,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/twitter/twitter.go b/providers/twitter/twitter.go index 4e2e2c98a..aa4d1efdc 100644 --- a/providers/twitter/twitter.go +++ b/providers/twitter/twitter.go @@ -165,3 +165,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return false } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/twitterv2/twitterv2.go b/providers/twitterv2/twitterv2.go index 1dcb21292..1f5b8b8aa 100644 --- a/providers/twitterv2/twitterv2.go +++ b/providers/twitterv2/twitterv2.go @@ -171,3 +171,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return false } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/typetalk/typetalk.go b/providers/typetalk/typetalk.go index 73aa755cd..afa52e1f0 100644 --- a/providers/typetalk/typetalk.go +++ b/providers/typetalk/typetalk.go @@ -7,6 +7,7 @@ package typetalk import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -204,3 +205,7 @@ func (p *Provider) RefreshTokenAvailable() bool { func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { return nil, nil } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/uber/uber.go b/providers/uber/uber.go index de48df81c..b2a585fbd 100644 --- a/providers/uber/uber.go +++ b/providers/uber/uber.go @@ -4,6 +4,7 @@ package uber import ( "encoding/json" + "errors" "fmt" "io" "net/http" @@ -159,3 +160,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/vk/vk.go b/providers/vk/vk.go index 615c81fbd..004201b8f 100644 --- a/providers/vk/vk.go +++ b/providers/vk/vk.go @@ -182,3 +182,7 @@ func newConfig(provider *Provider, scopes []string) *oauth2.Config { return c } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/wechat/wechat.go b/providers/wechat/wechat.go index 526e8fe4b..0d88f133a 100644 --- a/providers/wechat/wechat.go +++ b/providers/wechat/wechat.go @@ -2,6 +2,7 @@ package wechat import ( "encoding/json" + "errors" "fmt" "io" "net/http" @@ -236,3 +237,7 @@ func (p *Provider) fetchToken(code string) (*oauth2.Token, string, error) { return token, obj.Openid, nil } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/wecom/wecom.go b/providers/wecom/wecom.go index c30cf5c0e..c2c398b00 100644 --- a/providers/wecom/wecom.go +++ b/providers/wecom/wecom.go @@ -215,3 +215,7 @@ func userFromReader(reader io.Reader, user *goth.User) error { return nil } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/wepay/wepay.go b/providers/wepay/wepay.go index ad8fdf248..485dcc549 100644 --- a/providers/wepay/wepay.go +++ b/providers/wepay/wepay.go @@ -4,6 +4,7 @@ package wepay import ( "encoding/json" + "errors" "fmt" "io" "net/http" @@ -153,3 +154,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { return nil, nil } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/xero/xero.go b/providers/xero/xero.go index bb642c353..8428e9e59 100644 --- a/providers/xero/xero.go +++ b/providers/xero/xero.go @@ -258,3 +258,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return false } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/yahoo/yahoo.go b/providers/yahoo/yahoo.go index 0dd13ab01..30a3ef344 100644 --- a/providers/yahoo/yahoo.go +++ b/providers/yahoo/yahoo.go @@ -4,6 +4,7 @@ package yahoo import ( "encoding/json" + "errors" "fmt" "io" "net/http" @@ -162,3 +163,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/yammer/yammer.go b/providers/yammer/yammer.go index f7e803ea2..542c96f26 100644 --- a/providers/yammer/yammer.go +++ b/providers/yammer/yammer.go @@ -158,3 +158,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { func (p *Provider) RefreshTokenAvailable() bool { return false } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/yandex/yandex.go b/providers/yandex/yandex.go index e550a80f3..6231b7671 100644 --- a/providers/yandex/yandex.go +++ b/providers/yandex/yandex.go @@ -5,6 +5,7 @@ package yandex import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -181,3 +182,7 @@ func (p *Provider) RefreshToken(refreshToken string) (*oauth2.Token, error) { } return newToken, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +} diff --git a/providers/zoom/session.go b/providers/zoom/session.go index 913f2d335..8d3d73db8 100644 --- a/providers/zoom/session.go +++ b/providers/zoom/session.go @@ -77,3 +77,7 @@ func (p *Provider) UnmarshalSession(data string) (goth.Session, error) { err := json.NewDecoder(strings.NewReader(data)).Decode(s) return s, err } + +func (p *Provider) FetchUserWithToken(token string) (goth.User, error) { + return goth.User{}, errors.New("not implemented") +}