1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-12-03 22:59:10 +02:00

*: rename Url to URL everywhere

Go coding style says that acronyms should be all lower or all upper. Fix
Url to URL.
This commit is contained in:
Brandon Philips
2015-11-09 00:47:44 +01:00
parent 1b0144ba75
commit 51a2e4e48c
15 changed files with 151 additions and 151 deletions

View File

@@ -15,23 +15,23 @@ type LinkedInProvider struct {
func NewLinkedInProvider(p *ProviderData) *LinkedInProvider {
p.ProviderName = "LinkedIn"
if p.LoginUrl.String() == "" {
p.LoginUrl = &url.URL{Scheme: "https",
if p.LoginURL.String() == "" {
p.LoginURL = &url.URL{Scheme: "https",
Host: "www.linkedin.com",
Path: "/uas/oauth2/authorization"}
}
if p.RedeemUrl.String() == "" {
p.RedeemUrl = &url.URL{Scheme: "https",
if p.RedeemURL.String() == "" {
p.RedeemURL = &url.URL{Scheme: "https",
Host: "www.linkedin.com",
Path: "/uas/oauth2/accessToken"}
}
if p.ProfileUrl.String() == "" {
p.ProfileUrl = &url.URL{Scheme: "https",
if p.ProfileURL.String() == "" {
p.ProfileURL = &url.URL{Scheme: "https",
Host: "www.linkedin.com",
Path: "/v1/people/~/email-address"}
}
if p.ValidateUrl.String() == "" {
p.ValidateUrl = p.ProfileUrl
if p.ValidateURL.String() == "" {
p.ValidateURL = p.ProfileURL
}
if p.Scope == "" {
p.Scope = "r_emailaddress r_basicprofile"
@@ -51,7 +51,7 @@ func (p *LinkedInProvider) GetEmailAddress(s *SessionState) (string, error) {
if s.AccessToken == "" {
return "", errors.New("missing access token")
}
req, err := http.NewRequest("GET", p.ProfileUrl.String()+"?format=json", nil)
req, err := http.NewRequest("GET", p.ProfileURL.String()+"?format=json", nil)
if err != nil {
return "", err
}