Add client auth plugin framework for kubectl with GCP auth plugin.

This commit is contained in:
CJ Cullen
2016-03-05 18:00:36 -08:00
parent 6320e41b4f
commit 03f9b5adc0
11 changed files with 375 additions and 12 deletions

View File

@@ -172,6 +172,9 @@ func getUserIdentificationPartialConfig(configAuthInfo clientcmdapi.AuthInfo, fa
mergedConfig.Username = configAuthInfo.Username
mergedConfig.Password = configAuthInfo.Password
}
if configAuthInfo.AuthProvider != nil {
mergedConfig.AuthProvider = configAuthInfo.AuthProvider
}
// if there still isn't enough information to authenticate the user, try prompting
if !canIdentifyUser(*mergedConfig) && (fallbackReader != nil) {
@@ -212,8 +215,8 @@ func makeServerIdentificationConfig(info clientauth.Info) restclient.Config {
func canIdentifyUser(config restclient.Config) bool {
return len(config.Username) > 0 ||
(len(config.CertFile) > 0 || len(config.CertData) > 0) ||
len(config.BearerToken) > 0
len(config.BearerToken) > 0 ||
config.AuthProvider != nil
}
// Namespace implements KubeConfig