extractor

package
v0.0.0-...-7bc1e72 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingIDToken = errors.New("response missing ID token")

ErrMissingIDToken indicates a response that does not contain an id_token.

Functions

This section is empty.

Types

type OIDC

type OIDC interface {
	Process(ctx context.Context, cfg *oauth2.Config, code string) (*OIDCAuthenticationParams, error)
}

An OIDC extractor performs OIDC validation, extracting and storing the information required for Kubernetes authentication along the way.

func NewOIDC

func NewOIDC(v *oidc.IDTokenVerifier, oo ...Option) (OIDC, error)

NewOIDC creates a new OIDC extractor.

type OIDCAuthenticationParams

type OIDCAuthenticationParams struct {
	Username     string `json:"email" schema:"email"` // TODO(negz): Support other claims.
	ClientID     string `json:"clientID" schema:"clientID"`
	ClientSecret string `json:"clientSecret" schema:"clientSecret"`
	IDToken      string `json:"idToken" schema:"idToken"`
	RefreshToken string `json:"refreshToken" schema:"refreshToken"`
	IssuerURL    string `json:"issuer" schema:"issuer"`
}

OIDCAuthenticationParams are the parameters required for kubectl to authenticate to Kubernetes via OIDC.

type Option

type Option func(*oidcExtractor) error

An Option represents a OIDC extractor option.

func EmailDomain

func EmailDomain(domain string) Option

EmailDomain adds the given email domain to an OIDC extractor

func HTTPClient

func HTTPClient(h *http.Client) Option

HTTPClient allows the use of a bespoke context.

func Logger

func Logger(l *zap.Logger) Option

Logger allows the use of a bespoke Zap logger.

Jump to

Keyboard shortcuts

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