@@ -3,6 +3,7 @@ package options
33import (
44 "fmt"
55 "net/url"
6+ "reflect"
67 "strconv"
78 "strings"
89 "time"
@@ -494,7 +495,8 @@ type LegacyProvider struct {
494495 GitHubUsers []string `flag:"github-user" cfg:"github_users"`
495496 GitLabGroup []string `flag:"gitlab-group" cfg:"gitlab_groups"`
496497 GitLabProjects []string `flag:"gitlab-project" cfg:"gitlab_projects"`
497− GoogleGroups []string `flag:"google-group" cfg:"google_group"`
498+ GoogleGroupsLegacy []string `flag:"google-group" cfg:"google_group"`
499+ GoogleGroups []string `flag:"google-group" cfg:"google_groups"`
498500 GoogleAdminEmail string `flag:"google-admin-email" cfg:"google_admin_email"`
499501 GoogleServiceAccountJSON string `flag:"google-service-account-json" cfg:"google_service_account_json"`
500502 GoogleUseApplicationDefaultCredentials bool `flag:"google-use-application-default-credentials" cfg:"google_use_application_default_credentials"`
@@ -727,6 +729,13 @@ func (l *LegacyProvider) convert() (Providers, error) {
727729 Repository: l.BitbucketRepository,
728730 }
729731 case "google":
732+ if len(l.GoogleGroupsLegacy) != 0 && !reflect.DeepEqual(l.GoogleGroupsLegacy, l.GoogleGroups) {
733+ // Log the deprecation notice
734+ logger.Error(
735+ "WARNING: The 'OAUTH2_PROXY_GOOGLE_GROUP' environment variable is deprecated and will likely be removed in the next major release. Use 'OAUTH2_PROXY_GOOGLE_GROUPS' instead.",
736+ )
737+ l.GoogleGroups = l.GoogleGroupsLegacy
738+ }
730739 provider.GoogleConfig = GoogleOptions{
731740 Groups: l.GoogleGroups,
732741 AdminEmail: l.GoogleAdminEmail,