From 24d1721e6475750310d13649eda0c7accf9eb4ef Mon Sep 17 00:00:00 2001 From: James Eagle Date: Sat, 5 Nov 2022 07:49:44 +0000 Subject: [PATCH] Typos --- examples/main.go | 2 +- gothic/gothic.go | 4 ++-- providers/azureadv2/azureadv2.go | 2 +- providers/digitalocean/digitalocean.go | 2 +- providers/discord/session.go | 2 +- providers/dropbox/dropbox.go | 2 +- providers/fitbit/session.go | 2 +- providers/github/session.go | 6 +++--- providers/google/google.go | 6 +++--- providers/influxcloud/influxcloud.go | 2 +- providers/linkedin/linkedin.go | 2 +- providers/linkedin/session.go | 6 +++--- providers/mailru/mailru.go | 2 +- providers/microsoftonline/microsoftonline.go | 2 +- providers/nextcloud/README.md | 2 +- providers/onedrive/onedrive.go | 2 +- providers/openidConnect/openidConnect.go | 2 +- providers/oura/errors.go | 2 +- providers/oura/session.go | 2 +- providers/paypal/session.go | 6 +++--- providers/salesforce/session.go | 6 +++--- providers/slack/slack.go | 2 +- providers/spotify/session.go | 2 +- providers/twitch/session.go | 2 +- providers/typetalk/typetalk.go | 2 +- providers/vk/vk.go | 2 +- providers/wepay/wepay.go | 2 +- user.go | 2 +- 28 files changed, 39 insertions(+), 39 deletions(-) diff --git a/examples/main.go b/examples/main.go index 8b6261a26..31f11e917 100644 --- a/examples/main.go +++ b/examples/main.go @@ -152,7 +152,7 @@ func main() { ) // OpenID Connect is based on OpenID Connect Auto Discovery URL (https://openid.net/specs/openid-connect-discovery-1_0-17.html) - // because the OpenID Connect provider initialize it self in the New(), it can return an error which should be handled or ignored + // because the OpenID Connect provider initialize itself in the New(), it can return an error which should be handled or ignored // ignore the error for now openidConnect, _ := openidConnect.New(os.Getenv("OPENID_CONNECT_KEY"), os.Getenv("OPENID_CONNECT_SECRET"), "http://localhost:3000/auth/openid-connect/callback", os.Getenv("OPENID_CONNECT_DISCOVERY_URL")) if openidConnect != nil { diff --git a/gothic/gothic.go b/gothic/gothic.go index ed7280983..c803f7bd3 100644 --- a/gothic/gothic.go +++ b/gothic/gothic.go @@ -1,6 +1,6 @@ /* Package gothic wraps common behaviour when using Goth. This makes it quick, and easy, to get up -and running with Goth. Of course, if you want complete control over how things flow, in regards +and running with Goth. Of course, if you want complete control over how things flow, in regard to the authentication process, feel free and use Goth directly. See https://github.com/markbates/goth/blob/master/examples/main.go to see this in action. @@ -151,7 +151,7 @@ func GetAuthURL(res http.ResponseWriter, req *http.Request) (string, error) { /* CompleteUserAuth does what it says on the tin. It completes the authentication -process and fetches all of the basic information about the user from the provider. +process and fetches all the basic information about the user from the provider. It expects to be able to get the name of the provider from the query parameters as either "provider" or ":provider". diff --git a/providers/azureadv2/azureadv2.go b/providers/azureadv2/azureadv2.go index ef3d7399e..523f79cce 100644 --- a/providers/azureadv2/azureadv2.go +++ b/providers/azureadv2/azureadv2.go @@ -216,7 +216,7 @@ func userFromReader(r io.Reader, user *goth.User) error { user.Location = u.OfficeLocation user.UserID = u.ID user.AvatarURL = graphAPIResource + fmt.Sprintf("users/%s/photo/$value", u.ID) - // Make sure all of the information returned is available via RawData + // Make sure all the information returned is available via RawData if err := json.Unmarshal(userBytes, &user.RawData); err != nil { return err } diff --git a/providers/digitalocean/digitalocean.go b/providers/digitalocean/digitalocean.go index 8c7c8c3b6..69a7a639e 100644 --- a/providers/digitalocean/digitalocean.go +++ b/providers/digitalocean/digitalocean.go @@ -64,7 +64,7 @@ func (p *Provider) Client() *http.Client { // Debug is a no-op for the digitalocean package. func (p *Provider) Debug(debug bool) {} -// BeginAuth asks Github for an authentication end-point. +// BeginAuth asks DigitalOcean for an authentication end-point. func (p *Provider) BeginAuth(state string) (goth.Session, error) { url := p.config.AuthCodeURL(state) session := &Session{ diff --git a/providers/discord/session.go b/providers/discord/session.go index a41cc5a0b..228237e8d 100644 --- a/providers/discord/session.go +++ b/providers/discord/session.go @@ -53,7 +53,7 @@ func (s Session) Marshal() string { } // String is equivalent to Marshal. It returns a JSON representation of the -// of the session. +// session. func (s Session) String() string { return s.Marshal() } diff --git a/providers/dropbox/dropbox.go b/providers/dropbox/dropbox.go index a203fdd1b..da55dba15 100644 --- a/providers/dropbox/dropbox.go +++ b/providers/dropbox/dropbox.go @@ -193,7 +193,7 @@ func userFromReader(r io.Reader, user *goth.User) error { user.FirstName = u.Name.GivenName user.LastName = u.Name.Surname user.Name = strings.TrimSpace(fmt.Sprintf("%s %s", u.Name.GivenName, u.Name.Surname)) - user.Description = u.Name.DisplayName // Full name plus parenthetical team naem + user.Description = u.Name.DisplayName // Full name plus parenthetical team name user.Email = u.Email user.NickName = u.Email // Email is the dropbox username user.Location = u.Country diff --git a/providers/fitbit/session.go b/providers/fitbit/session.go index 7f36f8c33..6b3471a56 100644 --- a/providers/fitbit/session.go +++ b/providers/fitbit/session.go @@ -27,7 +27,7 @@ func (s Session) GetAuthURL() (string, error) { return s.AuthURL, nil } -// Authorize completes the the authorization with Fitbit and returns the access +// Authorize completes the authorization with Fitbit and returns the access // token to be stored for future use. func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) { p := provider.(*Provider) diff --git a/providers/github/session.go b/providers/github/session.go index f473a526e..cd19e8705 100644 --- a/providers/github/session.go +++ b/providers/github/session.go @@ -8,13 +8,13 @@ import ( "github.com/markbates/goth" ) -// Session stores data during the auth process with Github. +// Session stores data during the auth process with GitHub. type Session struct { AuthURL string AccessToken string } -// GetAuthURL will return the URL set by calling the `BeginAuth` function on the Github provider. +// GetAuthURL will return the URL set by calling the `BeginAuth` function on the GitHub provider. func (s Session) GetAuthURL() (string, error) { if s.AuthURL == "" { return "", errors.New(goth.NoAuthUrlErrorMessage) @@ -22,7 +22,7 @@ func (s Session) GetAuthURL() (string, error) { return s.AuthURL, nil } -// Authorize the session with Github and return the access token to be stored for future use. +// Authorize the session with GitHub and return the access token to be stored for future use. func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) { p := provider.(*Provider) token, err := p.config.Exchange(goth.ContextForClient(p.Client()), params.Get("code")) diff --git a/providers/google/google.go b/providers/google/google.go index d9cb41bbf..a266c91a2 100644 --- a/providers/google/google.go +++ b/providers/google/google.go @@ -190,8 +190,8 @@ func (p *Provider) SetHostedDomain(hd string) { p.authCodeOptions = append(p.authCodeOptions, oauth2.SetAuthURLParam("hd", hd)) } -// SetLoginHint sets the login_hint parameter for the google OAuth call. -// Use this to prompt the user to login with a specific account. +// SetLoginHint sets the login_hint parameter for the Google OAuth call. +// Use this to prompt the user to log in with a specific account. // See https://developers.google.com/identity/protocols/oauth2/openid-connect#login-hint func (p *Provider) SetLoginHint(loginHint string) { if loginHint == "" { @@ -200,7 +200,7 @@ func (p *Provider) SetLoginHint(loginHint string) { p.authCodeOptions = append(p.authCodeOptions, oauth2.SetAuthURLParam("login_hint", loginHint)) } -// SetAccessType sets the access_type parameter for the google OAuth call. +// SetAccessType sets the access_type parameter for the Google OAuth call. // If an access token is being requested, the client does not receive a refresh token unless a value of offline is specified. // See https://developers.google.com/identity/protocols/oauth2/openid-connect#access-type-param func (p *Provider) SetAccessType(at string) { diff --git a/providers/influxcloud/influxcloud.go b/providers/influxcloud/influxcloud.go index 8d96f0fe9..7f7ad94c6 100644 --- a/providers/influxcloud/influxcloud.go +++ b/providers/influxcloud/influxcloud.go @@ -20,7 +20,7 @@ import ( const ( // The hard coded domain is difficult here because influx cloud has an acceptance - // domain that is different and we will need that for enterprise development. + // domain that is different, and we will need that for enterprise development. defaultDomain string = "cloud.influxdata.com" userAPIPath string = "/api/v1/user" domainEnvKey string = "INFLUXCLOUD_OAUTH_DOMAIN" diff --git a/providers/linkedin/linkedin.go b/providers/linkedin/linkedin.go index 6154ddc25..5719911d7 100644 --- a/providers/linkedin/linkedin.go +++ b/providers/linkedin/linkedin.go @@ -199,7 +199,7 @@ func userFromReader(reader io.Reader, user *goth.User) error { // only retrieve data where the authorization method allows public (unauthorized) access if element.AuthorizationMethod == "PUBLIC" { for _, identifier := range element.Identifiers { - // check to ensure the identifer type is a url linking to the image + // check to ensure the identifier type is a url linking to the image if identifier.IdentifierType == "EXTERNAL_URL" { avatarURL = identifier.Identifier // we only need the first image url diff --git a/providers/linkedin/session.go b/providers/linkedin/session.go index 29dfdb62f..51dee95d1 100644 --- a/providers/linkedin/session.go +++ b/providers/linkedin/session.go @@ -8,14 +8,14 @@ import ( "github.com/markbates/goth" ) -// Session stores data during the auth process with Linkedin. +// Session stores data during the auth process with LinkedIn. type Session struct { AuthURL string AccessToken string ExpiresAt time.Time } -// GetAuthURL will return the URL set by calling the `BeginAuth` function on the Linkedin provider. +// GetAuthURL will return the URL set by calling the `BeginAuth` function on the LinkedIn provider. func (s Session) GetAuthURL() (string, error) { if s.AuthURL == "" { return "", errors.New(goth.NoAuthUrlErrorMessage) @@ -23,7 +23,7 @@ func (s Session) GetAuthURL() (string, error) { return s.AuthURL, nil } -// Authorize the session with Linkedin and return the access token to be stored for future use. +// Authorize the session with LinkedIn and return the access token to be stored for future use. func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) { p := provider.(*Provider) token, err := p.config.Exchange(goth.ContextForClient(p.Client()), params.Get("code")) diff --git a/providers/mailru/mailru.go b/providers/mailru/mailru.go index a49a7817f..fa32976a4 100644 --- a/providers/mailru/mailru.go +++ b/providers/mailru/mailru.go @@ -45,7 +45,7 @@ func New(clientID, clientSecret, redirectURL string, scopes ...string) *Provider } } -// Provider is the implementation of `goth.Provider` for accessing Github. +// Provider is the implementation of `goth.Provider` for accessing MAILRU. type Provider struct { name string clientID string diff --git a/providers/microsoftonline/microsoftonline.go b/providers/microsoftonline/microsoftonline.go index 08df8a56f..abf5db21c 100644 --- a/providers/microsoftonline/microsoftonline.go +++ b/providers/microsoftonline/microsoftonline.go @@ -112,7 +112,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { } // RefreshTokenAvailable refresh token is provided by auth provider or not -// not available for microsoft online as session size hit the limit of max cookie size +// available for microsoft online as session size hit the limit of max cookie size func (p *Provider) RefreshTokenAvailable() bool { return false } diff --git a/providers/nextcloud/README.md b/providers/nextcloud/README.md index 3047934eb..841668fdc 100644 --- a/providers/nextcloud/README.md +++ b/providers/nextcloud/README.md @@ -70,7 +70,7 @@ SESSION_SECRET=1 \ ./examples ``` -Afterwards, you should be able to login via Nextcloud in the examples app. +Afterwards, you should be able to log in via Nextcloud in the examples app. ## Running the Provider Test diff --git a/providers/onedrive/onedrive.go b/providers/onedrive/onedrive.go index 3ed98739a..dcb96e9cb 100644 --- a/providers/onedrive/onedrive.go +++ b/providers/onedrive/onedrive.go @@ -142,7 +142,7 @@ func userFromReader(r io.Reader, user *goth.User) error { user.Email = u.Email["account"] user.Name = u.Name user.NickName = u.Name - user.UserID = u.Email["account"] //onedrive doesn't provide separate user_id + user.UserID = u.Email["account"] // onedrive doesn't provide separate user_id return nil } diff --git a/providers/openidConnect/openidConnect.go b/providers/openidConnect/openidConnect.go index 43daba2c9..d21b04775 100644 --- a/providers/openidConnect/openidConnect.go +++ b/providers/openidConnect/openidConnect.go @@ -190,7 +190,7 @@ func (p *Provider) BeginAuth(state string) (goth.Session, error) { return session, nil } -// FetchUser will use the the id_token and access requested information about the user. +// FetchUser will use the id_token and access requested information about the user. func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { sess := session.(*Session) diff --git a/providers/oura/errors.go b/providers/oura/errors.go index 1ca945f32..596c33676 100644 --- a/providers/oura/errors.go +++ b/providers/oura/errors.go @@ -6,7 +6,7 @@ type APIError struct { Description string } -// NewAPIError initializes an oura APIError +// NewAPIError initializes an Oura APIError func NewAPIError(code int, description string) APIError { return APIError{code, description} } diff --git a/providers/oura/session.go b/providers/oura/session.go index a7cfb0347..b164293bf 100644 --- a/providers/oura/session.go +++ b/providers/oura/session.go @@ -27,7 +27,7 @@ func (s Session) GetAuthURL() (string, error) { return s.AuthURL, nil } -// Authorize completes the the authorization with Oura and returns the access +// Authorize completes the authorization with Oura and returns the access // token to be stored for future use. func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) { p := provider.(*Provider) diff --git a/providers/paypal/session.go b/providers/paypal/session.go index d87f367d2..0e099b3f2 100644 --- a/providers/paypal/session.go +++ b/providers/paypal/session.go @@ -9,7 +9,7 @@ import ( "github.com/markbates/goth" ) -// Session stores data during the auth process with Paypal. +// Session stores data during the auth process with PayPal. type Session struct { AuthURL string AccessToken string @@ -19,7 +19,7 @@ type Session struct { var _ goth.Session = &Session{} -// GetAuthURL will return the URL set by calling the `BeginAuth` function on the Paypal provider. +// GetAuthURL will return the URL set by calling the `BeginAuth` function on the PayPal provider. func (s Session) GetAuthURL() (string, error) { if s.AuthURL == "" { return "", errors.New(goth.NoAuthUrlErrorMessage) @@ -27,7 +27,7 @@ func (s Session) GetAuthURL() (string, error) { return s.AuthURL, nil } -// Authorize the session with Paypal and return the access token to be stored for future use. +// Authorize the session with PayPal and return the access token to be stored for future use. func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) { p := provider.(*Provider) token, err := p.config.Exchange(goth.ContextForClient(p.Client()), params.Get("code")) diff --git a/providers/salesforce/session.go b/providers/salesforce/session.go index 08d328f99..1d2ffd12e 100644 --- a/providers/salesforce/session.go +++ b/providers/salesforce/session.go @@ -17,12 +17,12 @@ import ( // On salesforce.com, navigate to where you app is configured. (Setup > Create > Apps) // Under Connected Apps, click on your application's name to view its settings, then click Edit. // Under Selected OAuth Scopes, ensure that "Perform requests on your behalf at any time" is selected. You must include this even if you already chose "Full access". -// Save, then try your OAuth flow again. It make take a short while for the update to propagate. +// Save, then try your OAuth flow again. It takes a short while for the update to propagate. type Session struct { AuthURL string AccessToken string RefreshToken string - ID string //Required to get the user info from sales force + ID string // Required to get the user info from sales force } var _ goth.Session = &Session{} @@ -50,7 +50,7 @@ func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, s.AccessToken = token.AccessToken s.RefreshToken = token.RefreshToken - s.ID = token.Extra("id").(string) //Required to get the user info from sales force + s.ID = token.Extra("id").(string) // Required to get the user info from sales force return token.AccessToken, err } diff --git a/providers/slack/slack.go b/providers/slack/slack.go index efb2744a3..84036ea96 100644 --- a/providers/slack/slack.go +++ b/providers/slack/slack.go @@ -91,7 +91,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { return user, fmt.Errorf("%s cannot get user information without accessToken", p.providerName) } - // Get the userID, slack needs userID in order to get user profile info + // Get the userID, Slack needs userID in order to get user profile info req, _ := http.NewRequest("GET", endpointUser, nil) req.Header.Add("Authorization", "Bearer "+sess.AccessToken) response, err := p.Client().Do(req) diff --git a/providers/spotify/session.go b/providers/spotify/session.go index 567cec8ad..3d106faf1 100644 --- a/providers/spotify/session.go +++ b/providers/spotify/session.go @@ -25,7 +25,7 @@ func (s Session) GetAuthURL() (string, error) { return s.AuthURL, nil } -// Authorize completes the the authorization with Spotify and returns the access +// Authorize completes the authorization with Spotify and returns the access // token to be stored for future use. func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) { p := provider.(*Provider) diff --git a/providers/twitch/session.go b/providers/twitch/session.go index 53af0a5e6..109962d91 100644 --- a/providers/twitch/session.go +++ b/providers/twitch/session.go @@ -52,7 +52,7 @@ func (s Session) Marshal() string { } // String is equivalent to Marshal. It returns a JSON representation of the -// of the session. +// session. func (s Session) String() string { return s.Marshal() } diff --git a/providers/typetalk/typetalk.go b/providers/typetalk/typetalk.go index e90c258f6..73aa755cd 100644 --- a/providers/typetalk/typetalk.go +++ b/providers/typetalk/typetalk.go @@ -89,7 +89,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { return user, fmt.Errorf("%s cannot get user information without accessToken", p.providerName) } - // Get user name + // Get username response, err := p.Client().Get(endpointProfile + "?access_token=" + url.QueryEscape(sess.AccessToken)) if err != nil { if response != nil { diff --git a/providers/vk/vk.go b/providers/vk/vk.go index 6b13497cf..615c81fbd 100644 --- a/providers/vk/vk.go +++ b/providers/vk/vk.go @@ -37,7 +37,7 @@ func New(clientKey, secret, callbackURL string, scopes ...string) *Provider { return p } -// Provider is the implementation of `goth.Provider` for accessing Github. +// Provider is the implementation of `goth.Provider` for accessing VK. type Provider struct { ClientKey string Secret string diff --git a/providers/wepay/wepay.go b/providers/wepay/wepay.go index fca319b76..ad8fdf248 100644 --- a/providers/wepay/wepay.go +++ b/providers/wepay/wepay.go @@ -106,7 +106,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) { } func newConfig(provider *Provider, scopes []string) *oauth2.Config { - //Wepay is not recoginsing scope, if scope is not present as first paremeter + // Wepay is not recognising scope, if scope is not present as first parameter newAuthURL := authURL if len(scopes) > 0 { diff --git a/user.go b/user.go index 0cc583051..3a8fd6c54 100644 --- a/user.go +++ b/user.go @@ -10,7 +10,7 @@ func init() { } // User contains the information common amongst most OAuth and OAuth2 providers. -// All of the "raw" datafrom the provider can be found in the `RawData` field. +// All the "raw" data from the provider can be found in the `RawData` field. type User struct { RawData map[string]interface{} Provider string