Remove provider configuration from validation package

This commit is contained in:
Joel Speed
2022-02-16 10:38:06 +00:00
parent d162b018a8
commit 2e15f57b70
3 changed files with 4 additions and 327 deletions
+4
View File
@@ -3,6 +3,7 @@ package validation
import (
"fmt"
"io/ioutil"
"os"
"github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/options"
)
@@ -77,7 +78,10 @@ func validateGoogleConfig(provider options.Provider) []string {
}
if provider.GoogleConfig.ServiceAccountJSON == "" {
msgs = append(msgs, "missing setting: google-service-account-json")
} else if _, err := os.Stat(provider.GoogleConfig.ServiceAccountJSON); err != nil {
msgs = append(msgs, fmt.Sprintf("invalid Google credentials file: %s", provider.GoogleConfig.ServiceAccountJSON))
}
}
return msgs
}