cmd

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (

)

Variables

View Source
var (

	// Cobra command
	AuthCmd = &cobra.Command{
		Use:   "auth",
		Short: "Authenticate with OIDC provider",
		Long: `Use a provider sub-command to authenticate against your identity provider of choice.
For details go to: https://blog.gini.net/
`,
		RunE: DefaultCommand,
	}
)

Functions

func AuthenticateToProvider added in v0.4.0

func AuthenticateToProvider(provider OIDCProvider) error

initiate the OIDC flow. This func should be called in each cobra command

func AzureCommand added in v0.4.0

func AzureCommand(cmd *cobra.Command, args []string) error

func DefaultCommand added in v0.4.1

func DefaultCommand(cmd *cobra.Command, args []string) error

support build time providers. If the variable buildTimeProvider is set run the provider. FR: https://github.com/gini/dexter/issues/29

func Execute

func Execute() error

Execute executes the root command.

func ExtractAuthInfo added in v0.4.0

func ExtractAuthInfo(kubeConfig string) (*clientCmdApi.AuthInfo, error)

extract relevant authentication data from the given kube config

func GoogleCommand added in v0.4.0

func GoogleCommand(cmd *cobra.Command, args []string) error

Types

type AzureOIDC added in v0.4.0

type AzureOIDC struct {
	DexterOIDC // embed the base provider
	// contains filtered or unexported fields
}

func (*AzureOIDC) Autopilot added in v0.4.0

func (a *AzureOIDC) Autopilot() error

type CustomClaim added in v0.3.0

type CustomClaim struct {
	Email string `json:"email"`
}

helper type to render the k8s config

type DexterOIDC added in v0.4.0

type DexterOIDC struct {
	Oauth2Config *oauth2.Config // oauth2 configuration
	// contains filtered or unexported fields
}

DexterOIDC: struct to store the required data and provide methods to authenticate with OpenID providers

func (*DexterOIDC) AuthInfoToOauth2 added in v0.4.0

func (d *DexterOIDC) AuthInfoToOauth2(authInfo *clientCmdApi.AuthInfo)

create Oauth2 configuration

func (*DexterOIDC) Autopilot added in v0.4.0

func (d *DexterOIDC) Autopilot() error

func (*DexterOIDC) ConfigureOAuth2Manully added in v0.4.0

func (d *DexterOIDC) ConfigureOAuth2Manully() error

attempt to set client credentials

func (DexterOIDC) GenerateAuthUrl added in v0.4.0

func (d DexterOIDC) GenerateAuthUrl() string

func (DexterOIDC) PreflightCheck added in v0.4.0

func (d DexterOIDC) PreflightCheck() error

ensure that the required parameters are defined and that the values make sense

func (DexterOIDC) StartHTTPServer added in v0.4.0

func (d DexterOIDC) StartHTTPServer() error

start HTTP server to receive callbacks. This has to be run in a go routine

type GoogleOIDC added in v0.4.0

type GoogleOIDC struct {
	DexterOIDC
}

type OIDCProvider added in v0.4.0

type OIDCProvider interface {
	ConfigureOAuth2Manully() error
	Autopilot() error
	PreflightCheck() error
	GenerateAuthUrl() string
	StartHTTPServer() error
}

interface that all OIDC providers need to implement

Jump to

Keyboard shortcuts

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