Skip to content

Commit

Permalink
Typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Jleagle committed Nov 5, 2022
1 parent 4902a49 commit 24d1721
Show file tree
Hide file tree
Showing 28 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions gothic/gothic.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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".
Expand Down
2 changes: 1 addition & 1 deletion providers/azureadv2/azureadv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion providers/digitalocean/digitalocean.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion providers/discord/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion providers/dropbox/dropbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion providers/fitbit/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions providers/github/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ 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)
}
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"))
Expand Down
6 changes: 3 additions & 3 deletions providers/google/google.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion providers/influxcloud/influxcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion providers/linkedin/linkedin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions providers/linkedin/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ 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)
}
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"))
Expand Down
2 changes: 1 addition & 1 deletion providers/mailru/mailru.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion providers/microsoftonline/microsoftonline.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion providers/nextcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion providers/onedrive/onedrive.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion providers/openidConnect/openidConnect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion providers/oura/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
Expand Down
2 changes: 1 addition & 1 deletion providers/oura/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions providers/paypal/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,15 +19,15 @@ 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)
}
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"))
Expand Down
6 changes: 3 additions & 3 deletions providers/salesforce/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion providers/slack/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion providers/spotify/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion providers/twitch/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion providers/typetalk/typetalk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion providers/vk/vk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion providers/wepay/wepay.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 24d1721

Please sign in to comment.