Skip to content

Commit d6995e2

Browse files
Merge pull request #480 from Jleagle/master
Typos
2 parents f842162 + b41bcac commit d6995e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+89
-89
lines changed

examples/main.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ func main() {
113113
eveonline.New(os.Getenv("EVEONLINE_KEY"), os.Getenv("EVEONLINE_SECRET"), "http://localhost:3000/auth/eveonline/callback"),
114114
kakao.New(os.Getenv("KAKAO_KEY"), os.Getenv("KAKAO_SECRET"), "http://localhost:3000/auth/kakao/callback"),
115115

116-
//Pointed localhost.com to http://localhost:3000/auth/yahoo/callback through proxy as yahoo
116+
// Pointed localhost.com to http://localhost:3000/auth/yahoo/callback through proxy as yahoo
117117
// does not allow to put custom ports in redirection uri
118118
yahoo.New(os.Getenv("YAHOO_KEY"), os.Getenv("YAHOO_SECRET"), "http://localhost.com"),
119119
typetalk.New(os.Getenv("TYPETALK_KEY"), os.Getenv("TYPETALK_SECRET"), "http://localhost:3000/auth/typetalk/callback", "my"),
120120
slack.New(os.Getenv("SLACK_KEY"), os.Getenv("SLACK_SECRET"), "http://localhost:3000/auth/slack/callback"),
121121
stripe.New(os.Getenv("STRIPE_KEY"), os.Getenv("STRIPE_SECRET"), "http://localhost:3000/auth/stripe/callback"),
122122
wepay.New(os.Getenv("WEPAY_KEY"), os.Getenv("WEPAY_SECRET"), "http://localhost:3000/auth/wepay/callback", "view_user"),
123-
//By default paypal production auth urls will be used, please set PAYPAL_ENV=sandbox as environment variable for testing
124-
//in sandbox environment
123+
// By default paypal production auth urls will be used, please set PAYPAL_ENV=sandbox as environment variable for testing
124+
// in sandbox environment
125125
paypal.New(os.Getenv("PAYPAL_KEY"), os.Getenv("PAYPAL_SECRET"), "http://localhost:3000/auth/paypal/callback"),
126126
steam.New(os.Getenv("STEAM_KEY"), "http://localhost:3000/auth/steam/callback"),
127127
heroku.New(os.Getenv("HEROKU_KEY"), os.Getenv("HEROKU_SECRET"), "http://localhost:3000/auth/heroku/callback"),
@@ -133,7 +133,7 @@ func main() {
133133
discord.New(os.Getenv("DISCORD_KEY"), os.Getenv("DISCORD_SECRET"), "http://localhost:3000/auth/discord/callback", discord.ScopeIdentify, discord.ScopeEmail),
134134
meetup.New(os.Getenv("MEETUP_KEY"), os.Getenv("MEETUP_SECRET"), "http://localhost:3000/auth/meetup/callback"),
135135

136-
//Auth0 allocates domain per customer, a domain must be provided for auth0 to work
136+
// Auth0 allocates domain per customer, a domain must be provided for auth0 to work
137137
auth0.New(os.Getenv("AUTH0_KEY"), os.Getenv("AUTH0_SECRET"), "http://localhost:3000/auth/auth0/callback", os.Getenv("AUTH0_DOMAIN")),
138138
xero.New(os.Getenv("XERO_KEY"), os.Getenv("XERO_SECRET"), "http://localhost:3000/auth/xero/callback"),
139139
vk.New(os.Getenv("VK_KEY"), os.Getenv("VK_SECRET"), "http://localhost:3000/auth/vk/callback"),
@@ -152,7 +152,7 @@ func main() {
152152
)
153153

154154
// OpenID Connect is based on OpenID Connect Auto Discovery URL (https://openid.net/specs/openid-connect-discovery-1_0-17.html)
155-
// because the OpenID Connect provider initialize it self in the New(), it can return an error which should be handled or ignored
155+
// because the OpenID Connect provider initialize itself in the New(), it can return an error which should be handled or ignored
156156
// ignore the error for now
157157
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"))
158158
if openidConnect != nil {

gothic/gothic.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
Package gothic wraps common behaviour when using Goth. This makes it quick, and easy, to get up
3-
and running with Goth. Of course, if you want complete control over how things flow, in regards
3+
and running with Goth. Of course, if you want complete control over how things flow, in regard
44
to the authentication process, feel free and use Goth directly.
55
66
See https://github.com/markbates/goth/blob/master/examples/main.go to see this in action.
@@ -45,7 +45,7 @@ func init() {
4545
key := []byte(os.Getenv("SESSION_SECRET"))
4646
keySet = len(key) != 0
4747

48-
cookieStore := sessions.NewCookieStore([]byte(key))
48+
cookieStore := sessions.NewCookieStore(key)
4949
cookieStore.Options.HttpOnly = true
5050
Store = cookieStore
5151
defaultStore = Store
@@ -151,7 +151,7 @@ func GetAuthURL(res http.ResponseWriter, req *http.Request) (string, error) {
151151

152152
/*
153153
CompleteUserAuth does what it says on the tin. It completes the authentication
154-
process and fetches all of the basic information about the user from the provider.
154+
process and fetches all the basic information about the user from the provider.
155155
156156
It expects to be able to get the name of the provider from the query parameters
157157
as either "provider" or ":provider".

gothic/gothic_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func Test_CompleteUserAuthWithSessionDeducedProvider(t *testing.T) {
149149
a := assert.New(t)
150150

151151
res := httptest.NewRecorder()
152-
// Inteintionally omit a provider argument, force looking in session.
152+
// Intentionally omit a provider argument, force looking in session.
153153
req, err := http.NewRequest("GET", "/auth/callback", nil)
154154
a.NoError(err)
155155

provider.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ type Provider interface {
1717
UnmarshalSession(string) (Session, error)
1818
FetchUser(Session) (User, error)
1919
Debug(bool)
20-
RefreshToken(refreshToken string) (*oauth2.Token, error) //Get new access token based on the refresh token
21-
RefreshTokenAvailable() bool //Refresh token is provided by auth provider or not
20+
RefreshToken(refreshToken string) (*oauth2.Token, error) // Get new access token based on the refresh token
21+
RefreshTokenAvailable() bool // Refresh token is provided by auth provider or not
2222
}
2323

2424
const NoAuthUrlErrorMessage = "an AuthURL has not been set"

providers/apple/apple_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ nNFzkp23qt9IJDivieB/BBJct1UvhoICg5eZDhSR+x7UH3Uhog8qgoIC
7171
})
7272
a.NoError(err)
7373
a.NotZero(ss)
74-
//fmt.Printf("signed secret: %s", *ss)
74+
// fmt.Printf("signed secret: %s", *ss)
7575
}
7676

7777
func TestAuthorize(t *testing.T) {

providers/auth0/auth0_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func Test_SessionFromJSON(t *testing.T) {
5454
}
5555

5656
func Test_FetchUser(t *testing.T) {
57-
//t.Parallel()
57+
// t.Parallel()
5858
a := assert.New(t)
5959

6060
httpmock.Activate()

providers/azuread/azuread.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func userFromReader(r io.Reader, user *goth.User) error {
177177
user.LastName = u.LastName
178178
user.NickName = u.Name
179179
user.Location = u.Location
180-
user.UserID = u.UserPrincipalName //AzureAD doesn't provide separate user_id
180+
user.UserID = u.UserPrincipalName // AzureAD doesn't provide separate user_id
181181

182182
return nil
183183
}

providers/azureadv2/azureadv2.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func userFromReader(r io.Reader, user *goth.User) error {
216216
user.Location = u.OfficeLocation
217217
user.UserID = u.ID
218218
user.AvatarURL = graphAPIResource + fmt.Sprintf("users/%s/photo/$value", u.ID)
219-
// Make sure all of the information returned is available via RawData
219+
// Make sure all the information returned is available via RawData
220220
if err := json.Unmarshal(userBytes, &user.RawData); err != nil {
221221
return err
222222
}

providers/bitbucket/bitbucket.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ func (p *Provider) getEmail(user *goth.User, sess *Session) error {
162162
return fmt.Errorf("%s responded with a %d trying to fetch email addresses", p.providerName, response.StatusCode)
163163
}
164164

165-
var mailList = []struct {
165+
var mailList []struct {
166166
Email string `json:"email"`
167167
Primary bool `json:"is_primary"`
168168
Confirmed bool `json:"is_confirmed"`
169-
}{}
169+
}
170170
err = json.NewDecoder(response.Body).Decode(&mailList)
171171
if err != nil {
172172
return err

providers/digitalocean/digitalocean.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (p *Provider) Client() *http.Client {
6464
// Debug is a no-op for the digitalocean package.
6565
func (p *Provider) Debug(debug bool) {}
6666

67-
// BeginAuth asks Github for an authentication end-point.
67+
// BeginAuth asks DigitalOcean for an authentication end-point.
6868
func (p *Provider) BeginAuth(state string) (goth.Session, error) {
6969
url := p.config.AuthCodeURL(state)
7070
session := &Session{

providers/discord/session.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func (s Session) Marshal() string {
5353
}
5454

5555
// String is equivalent to Marshal. It returns a JSON representation of the
56-
// of the session.
56+
// session.
5757
func (s Session) String() string {
5858
return s.Marshal()
5959
}

providers/dropbox/dropbox.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func userFromReader(r io.Reader, user *goth.User) error {
193193
user.FirstName = u.Name.GivenName
194194
user.LastName = u.Name.Surname
195195
user.Name = strings.TrimSpace(fmt.Sprintf("%s %s", u.Name.GivenName, u.Name.Surname))
196-
user.Description = u.Name.DisplayName // Full name plus parenthetical team naem
196+
user.Description = u.Name.DisplayName // Full name plus parenthetical team name
197197
user.Email = u.Email
198198
user.NickName = u.Email // Email is the dropbox username
199199
user.Location = u.Country

providers/fitbit/fitbit.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) {
123123
return user, fmt.Errorf("%s responded with a %d trying to fetch user information", p.providerName, resp.StatusCode)
124124
}
125125

126-
//err = userFromReader(io.TeeReader(resp.Body, os.Stdout), &user)
126+
// err = userFromReader(io.TeeReader(resp.Body, os.Stdout), &user)
127127
err = userFromReader(resp.Body, &user)
128128
return user, err
129129
}

providers/fitbit/session.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (s Session) GetAuthURL() (string, error) {
2727
return s.AuthURL, nil
2828
}
2929

30-
// Authorize completes the the authorization with Fitbit and returns the access
30+
// Authorize completes the authorization with Fitbit and returns the access
3131
// token to be stored for future use.
3232
func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) {
3333
p := provider.(*Provider)

providers/github/github.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ func getPrivateMail(p *Provider, sess *Session) (email string, err error) {
193193
return email, fmt.Errorf("GitHub API responded with a %d trying to fetch user email", response.StatusCode)
194194
}
195195

196-
var mailList = []struct {
196+
var mailList []struct {
197197
Email string `json:"email"`
198198
Primary bool `json:"primary"`
199199
Verified bool `json:"verified"`
200-
}{}
200+
}
201201
err = json.NewDecoder(response.Body).Decode(&mailList)
202202
if err != nil {
203203
return email, err

providers/github/session.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ import (
88
"github.com/markbates/goth"
99
)
1010

11-
// Session stores data during the auth process with Github.
11+
// Session stores data during the auth process with GitHub.
1212
type Session struct {
1313
AuthURL string
1414
AccessToken string
1515
}
1616

17-
// GetAuthURL will return the URL set by calling the `BeginAuth` function on the Github provider.
17+
// GetAuthURL will return the URL set by calling the `BeginAuth` function on the GitHub provider.
1818
func (s Session) GetAuthURL() (string, error) {
1919
if s.AuthURL == "" {
2020
return "", errors.New(goth.NoAuthUrlErrorMessage)
2121
}
2222
return s.AuthURL, nil
2323
}
2424

25-
// Authorize the session with Github and return the access token to be stored for future use.
25+
// Authorize the session with GitHub and return the access token to be stored for future use.
2626
func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) {
2727
p := provider.(*Provider)
2828
token, err := p.config.Exchange(goth.ContextForClient(p.Client()), params.Get("code"))

providers/google/google.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ func (p *Provider) SetHostedDomain(hd string) {
190190
p.authCodeOptions = append(p.authCodeOptions, oauth2.SetAuthURLParam("hd", hd))
191191
}
192192

193-
// SetLoginHint sets the login_hint parameter for the google OAuth call.
194-
// Use this to prompt the user to login with a specific account.
193+
// SetLoginHint sets the login_hint parameter for the Google OAuth call.
194+
// Use this to prompt the user to log in with a specific account.
195195
// See https://developers.google.com/identity/protocols/oauth2/openid-connect#login-hint
196196
func (p *Provider) SetLoginHint(loginHint string) {
197197
if loginHint == "" {
@@ -200,7 +200,7 @@ func (p *Provider) SetLoginHint(loginHint string) {
200200
p.authCodeOptions = append(p.authCodeOptions, oauth2.SetAuthURLParam("login_hint", loginHint))
201201
}
202202

203-
// SetAccessType sets the access_type parameter for the google OAuth call.
203+
// SetAccessType sets the access_type parameter for the Google OAuth call.
204204
// If an access token is being requested, the client does not receive a refresh token unless a value of offline is specified.
205205
// See https://developers.google.com/identity/protocols/oauth2/openid-connect#access-type-param
206206
func (p *Provider) SetAccessType(at string) {

providers/gplus/gplus.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ func userFromReader(reader io.Reader, user *goth.User) error {
137137
user.LastName = u.LastName
138138
user.NickName = u.Name
139139
user.Email = u.Email
140-
//user.Description = u.Bio
140+
// user.Description = u.Bio
141141
user.AvatarURL = u.Picture
142142
user.UserID = u.ID
143-
//user.Location = u.Location.Name
143+
// user.Location = u.Location.Name
144144

145145
return err
146146
}

providers/influxcloud/influxcloud.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020

2121
const (
2222
// The hard coded domain is difficult here because influx cloud has an acceptance
23-
// domain that is different and we will need that for enterprise development.
23+
// domain that is different, and we will need that for enterprise development.
2424
defaultDomain string = "cloud.influxdata.com"
2525
userAPIPath string = "/api/v1/user"
2626
domainEnvKey string = "INFLUXCLOUD_OAUTH_DOMAIN"

providers/influxcloud/influxcloud_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func Test_BeginAuth(t *testing.T) {
6363
session, err := provider.BeginAuth("test_state")
6464
s := session.(*Session)
6565
a.NoError(err)
66-
//FIXME: we really need to be able to run this against the acceptance server, too.
66+
// FIXME: we really need to be able to run this against the acceptance server, too.
6767
// How should we do this? Maybe a test envvar switch?
6868
a.Contains(s.AuthURL, "cloud.influxdata.com/oauth/authorize")
6969
a.Contains(s.AuthURL, fmt.Sprintf("client_id=%s", os.Getenv("INFLUXCLOUD_KEY")))
@@ -76,7 +76,7 @@ func Test_SessionFromJSON(t *testing.T) {
7676

7777
provider := influxcloudProvider()
7878

79-
//FIXME: What is this testing exactly?
79+
// FIXME: What is this testing exactly?
8080
s, err := provider.UnmarshalSession(`{"AuthURL":"http://github.com/auth_url","AccessToken":"1234567890"}`)
8181
a.NoError(err)
8282
session := s.(*Session)

providers/intercom/intercom.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import (
1616
)
1717

1818
var (
19-
authURL string = "https://app.intercom.io/oauth"
20-
tokenURL string = "https://api.intercom.io/auth/eagle/token?client_secret=%s"
21-
UserURL string = "https://api.intercom.io/me"
19+
authURL = "https://app.intercom.io/oauth"
20+
tokenURL = "https://api.intercom.io/auth/eagle/token?client_secret=%s"
21+
UserURL = "https://api.intercom.io/me"
2222
)
2323

2424
// New creates the new Intercom provider

providers/linkedin/linkedin.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ const (
2121
authURL string = "https://www.linkedin.com/oauth/v2/authorization"
2222
tokenURL string = "https://www.linkedin.com/oauth/v2/accessToken"
2323

24-
//userEndpoint requires scope "r_liteprofile"
24+
// userEndpoint requires scope "r_liteprofile"
2525
userEndpoint string = "//api.linkedin.com/v2/me?projection=(id,firstName,lastName,profilePicture(displayImage~:playableStreams))"
26-
//emailEndpoint requires scope "r_emailaddress"
26+
// emailEndpoint requires scope "r_emailaddress"
2727
emailEndpoint string = "//api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))"
2828
)
2929

@@ -199,7 +199,7 @@ func userFromReader(reader io.Reader, user *goth.User) error {
199199
// only retrieve data where the authorization method allows public (unauthorized) access
200200
if element.AuthorizationMethod == "PUBLIC" {
201201
for _, identifier := range element.Identifiers {
202-
// check to ensure the identifer type is a url linking to the image
202+
// check to ensure the identifier type is a url linking to the image
203203
if identifier.IdentifierType == "EXTERNAL_URL" {
204204
avatarURL = identifier.Identifier
205205
// we only need the first image url

providers/linkedin/session.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ import (
88
"github.com/markbates/goth"
99
)
1010

11-
// Session stores data during the auth process with Linkedin.
11+
// Session stores data during the auth process with LinkedIn.
1212
type Session struct {
1313
AuthURL string
1414
AccessToken string
1515
ExpiresAt time.Time
1616
}
1717

18-
// GetAuthURL will return the URL set by calling the `BeginAuth` function on the Linkedin provider.
18+
// GetAuthURL will return the URL set by calling the `BeginAuth` function on the LinkedIn provider.
1919
func (s Session) GetAuthURL() (string, error) {
2020
if s.AuthURL == "" {
2121
return "", errors.New(goth.NoAuthUrlErrorMessage)
2222
}
2323
return s.AuthURL, nil
2424
}
2525

26-
// Authorize the session with Linkedin and return the access token to be stored for future use.
26+
// Authorize the session with LinkedIn and return the access token to be stored for future use.
2727
func (s *Session) Authorize(provider goth.Provider, params goth.Params) (string, error) {
2828
p := provider.(*Provider)
2929
token, err := p.config.Exchange(goth.ContextForClient(p.Client()), params.Get("code"))

providers/mailru/mailru.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func New(clientID, clientSecret, redirectURL string, scopes ...string) *Provider
4545
}
4646
}
4747

48-
// Provider is the implementation of `goth.Provider` for accessing Github.
48+
// Provider is the implementation of `goth.Provider` for accessing MAILRU.
4949
type Provider struct {
5050
name string
5151
clientID string

providers/microsoftonline/microsoftonline.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) {
112112
}
113113

114114
// RefreshTokenAvailable refresh token is provided by auth provider or not
115-
// not available for microsoft online as session size hit the limit of max cookie size
115+
// available for microsoft online as session size hit the limit of max cookie size
116116
func (p *Provider) RefreshTokenAvailable() bool {
117117
return false
118118
}

providers/nextcloud/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ SESSION_SECRET=1 \
7070
./examples
7171
```
7272

73-
Afterwards, you should be able to login via Nextcloud in the examples app.
73+
Afterwards, you should be able to log in via Nextcloud in the examples app.
7474

7575
## Running the Provider Test
7676

providers/onedrive/onedrive.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func userFromReader(r io.Reader, user *goth.User) error {
142142
user.Email = u.Email["account"]
143143
user.Name = u.Name
144144
user.NickName = u.Name
145-
user.UserID = u.Email["account"] //onedrive doesn't provide separate user_id
145+
user.UserID = u.Email["account"] // onedrive doesn't provide separate user_id
146146

147147
return nil
148148
}

providers/openidConnect/openidConnect.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ type RefreshTokenResponse struct {
9595
// The OAuth spec defines the refresh token as an optional response field in the
9696
// refresh token flow. As a result, a new refresh token may not be returned in a successful
9797
// response.
98-
//See more: https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/
98+
// See more: https://www.oauth.com/oauth2-servers/making-authenticated-requests/refreshing-an-access-token/
9999
RefreshToken string `json:"refresh_token,omitempty"`
100100
}
101101

@@ -190,7 +190,7 @@ func (p *Provider) BeginAuth(state string) (goth.Session, error) {
190190
return session, nil
191191
}
192192

193-
// FetchUser will use the the id_token and access requested information about the user.
193+
// FetchUser will use the id_token and access requested information about the user.
194194
func (p *Provider) FetchUser(session goth.Session) (goth.User, error) {
195195
sess := session.(*Session)
196196

providers/oura/errors.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type APIError struct {
66
Description string
77
}
88

9-
// NewAPIError initializes an oura APIError
9+
// NewAPIError initializes an Oura APIError
1010
func NewAPIError(code int, description string) APIError {
1111
return APIError{code, description}
1212
}

0 commit comments

Comments
 (0)