Documentation ¶
Index ¶
- func ConstructAuthUrl(discoverySpec DiscoverySpec, scopes string, redirectUri string, ...) string
- func GenerateAuthInfo(issuer, clientId, clientSecret, idToken, refreshToken string) *clientcmdapi.AuthInfo
- func GetUserClaim(ds DiscoverySpec, accessToken, userClaim string) (string, error)
- func LaunchBrowser(openBrowser bool, oauthUrl string)
- type APConfig
- type AuthProvider
- type ConfigFile
- type DiscoverySpec
- type GoogleConfig
- type KubeUserInfo
- type KubectlUser
- type TokenResponse
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructAuthUrl ¶ added in v0.2.0
func ConstructAuthUrl(discoverySpec DiscoverySpec, scopes string, redirectUri string, clientID string) string
func GenerateAuthInfo ¶
func GenerateAuthInfo(issuer, clientId, clientSecret, idToken, refreshToken string) *clientcmdapi.AuthInfo
func GetUserClaim ¶ added in v0.2.0
func GetUserClaim(ds DiscoverySpec, accessToken, userClaim string) (string, error)
func LaunchBrowser ¶
Types ¶
type AuthProvider ¶
type ConfigFile ¶
type ConfigFile struct {
Installed *GoogleConfig `json:"installed"`
}
type DiscoverySpec ¶ added in v0.2.0
type DiscoverySpec struct { AuthorizationEndpoint string `json:"authorization_endpoint"` TokenEndpoint string `json:"token_endpoint"` ScopesSupported []string `json:"scopes_supported"` ResponseTypesSupported []string `json:"response_types_supported"` UserinfoEndpoint string `json:"userinfo_endpoint"` }
func GetDiscoverySpec ¶ added in v0.2.0
func GetDiscoverySpec(issuer string) (DiscoverySpec, error)
type GoogleConfig ¶
type GoogleConfig struct { ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` }
func ReadConfig ¶
func ReadConfig(path string) (*GoogleConfig, error)
type KubeUserInfo ¶
type KubeUserInfo struct {
AuthProvider *AuthProvider `yaml:"auth-provider"`
}
type KubectlUser ¶
type KubectlUser struct { Name string `yaml:"name"` KubeUserInfo *KubeUserInfo `yaml:"user"` }
type TokenResponse ¶
type TokenResponse struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` IdToken string `json:"id_token"` }
func GetToken ¶
func GetToken(ds DiscoverySpec, clientID, clientSecret, code string, redirectUri string) (*TokenResponse, error)
Get the id_token and refresh_token from google
Click to show internal directories.
Click to hide internal directories.