1
0
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:
Sourav Agrawal
2025-07-24 11:25:54 +05:30
committed by GitHub
parent b905f2cd93
commit e75a258299
6 changed files with 135 additions and 25 deletions

View File

@@ -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")
}