Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
refactor: switch from function to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe committed Feb 10, 2020
1 parent f69a268 commit e498c15
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions oauth/oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ const (
noPortURL = "urn:ietf:wg:oauth:2.0:oob"
)

// googleOAuthScopes return a list of scopes used by kamanda
var googleOAuthScopes = []string{
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase",
}

// GoogleAPIUserInfo the user data returned from Google API Services
type GoogleAPIUserInfo struct {
Email string `json:"email"`
Expand Down Expand Up @@ -92,20 +99,11 @@ func getGoogleOAuthConfig(port string) *oauth2.Config {
RedirectURL: redirectURL,
ClientID: viper.GetString(configs.GoogleOAuthClientIDConfigKey),
ClientSecret: viper.GetString(configs.GoogleOAuthClientSecretConfigKey),
Scopes: googleOAuthScopes(),
Scopes: googleOAuthScopes,
Endpoint: google.Endpoint,
}
}

// googleOAuthScopes return a list of scopes used by kamanda
func googleOAuthScopes() []string {
return []string{
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase",
}
}

// LoginWithLocalhost starts a server that can be used to capture OAUTH
// token from Google Auth Server
func LoginWithLocalhost(isCILogin bool) {
Expand Down

0 comments on commit e498c15

Please sign in to comment.