sso

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoConfiguration = errors.New("no SSO configuration found")
	ErrUnverifiedEmail = errors.New("user email address is not verified")
)

Functions

func RandomString

func RandomString(flat int) string

RandomString is just interface to getRandomString

func UpdateConfigMap

func UpdateConfigMap(k kubernetes.Interface, conf Config) error

Types

type Config

type Config struct {
	ProviderURL      string `json:"providerURL" toml:"provider_url"`
	ProviderCAFile   string `json:"providerCAFile" toml:"provider_ca_file"`
	DexProxyEndpoint string `json:"dexProxyEndpoint"`
}

TODO(ktravis): we can get rid of almost all of this if we rely on the dex client config instead

func NewFromConfigMap

func NewFromConfigMap(k kubernetes.Interface) (Config, error)

type Connector

type Connector interface {
	RedirectURL(string, ...URLParam) string
	Authenticate(string) (*UserInfo, error)
}

func NewConnector

func NewConnector(provider string, oc *oauth2.Config, hc *http.Client) (Connector, error)

type URLParam

type URLParam = oauth2.AuthCodeOption

func SetQuery

func SetQuery(k, v string) URLParam

type UserInfo

type UserInfo struct {
	Name         string   `json:"name"`
	Email        string   `json:"email"`
	Groups       []string `json:"groups"`
	Token        string   `json:"token"`
	RefreshToken string   `json:"refresh_token"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL