github.com/DaAlbrecht/cf-cli@v0.0.0-20231128151943-1fe19bb400b9/util/configv3/kubernetes_user_config.go (about)

     1  package configv3
     2  
     3  type KubernetesUserConfig struct {
     4  	// ConfigFile stores the configuration from the .cf/config
     5  	ConfigFile *JSONConfig
     6  }
     7  
     8  // CurrentUser returns user information decoded from the JWT access token in
     9  // .cf/config.json.
    10  func (config KubernetesUserConfig) CurrentUser() (User, error) {
    11  	return User{Name: config.ConfigFile.CFOnK8s.AuthInfo}, nil
    12  }
    13  
    14  // CurrentUserName returns the name of a user as returned by CurrentUser()
    15  func (config KubernetesUserConfig) CurrentUserName() (string, error) {
    16  	return config.ConfigFile.CFOnK8s.AuthInfo, nil
    17  }