You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-08-08 22:46:33 +02:00
feat: make google-groups argument optional (#3138)
add test cases update documentation refactor code and some cleanup update changelog Signed-off-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
@@ -94,18 +94,14 @@ func validateClientSecret(provider options.Provider) []string {
|
||||
func validateGoogleConfig(provider options.Provider) []string {
|
||||
msgs := []string{}
|
||||
|
||||
hasGoogleGroups := len(provider.GoogleConfig.Groups) >= 1
|
||||
hasAdminEmail := provider.GoogleConfig.AdminEmail != ""
|
||||
hasSAJSON := provider.GoogleConfig.ServiceAccountJSON != ""
|
||||
useADC := provider.GoogleConfig.UseApplicationDefaultCredentials
|
||||
|
||||
if !hasGoogleGroups && !hasAdminEmail && !hasSAJSON && !useADC {
|
||||
if !hasAdminEmail && !hasSAJSON && !useADC {
|
||||
return msgs
|
||||
}
|
||||
|
||||
if !hasGoogleGroups {
|
||||
msgs = append(msgs, "missing setting: google-group")
|
||||
}
|
||||
if !hasAdminEmail {
|
||||
msgs = append(msgs, "missing setting: google-admin-email")
|
||||
}
|
||||
|
Reference in New Issue
Block a user