oidc

package
v0.0.0-...-cbad420 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// See cmd/oidc.go for documentation on these cli parameters
	OIDCIssuer              = "issuer"
	OIDCIssuerAuthorizePath = "issuer-authorize-path"
	OIDCIssuerTokenPath     = "issuer-token-path"
	OIDCIssuerCA            = "issuer-ca"
	OIDCIssuerUserScope     = "issuer-user-scope"

	OIDCClientID     = "client-id"
	OIDCRefreshToken = "refresh-token"

	OIDCCallbackAddr          = "callback-addr"
	OIDCCallbackAuthorizePath = "callback-authorize-path"

	KubernetesClusterID = "cluster-id"
	KubernetesReauth    = "reauth"
)

Variables

This section is empty.

Functions

func Login

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

Types

type OIDCAuthorizeRequest

type OIDCAuthorizeRequest struct {
	ClientID     string
	Nonce        string
	RedirectURI  string
	ResponseType string
	State        string
	Scope        string

	// Required PKCE fields
	CodeChallenge        string
	CodeChallengeMedthod string
}

func (OIDCAuthorizeRequest) ToURLParams

func (r OIDCAuthorizeRequest) ToURLParams(issuer url.URL, authorizePath string) string

type OIDCAuthorizeResponse

type OIDCAuthorizeResponse struct {
	Code  string
	State string
	Error error
}

type OIDCConfig

type OIDCConfig struct {
	Issuer              *url.URL
	IssuerAuthorizePath string
	IssuerTokenPath     string
	IssuerCAPath        string
	IssuerUserScope     string

	ClientID      string
	OfflineAccess bool

	CallbackAddr          string
	CallbackAuthorizePath string

	KubernetesClusterID string
	KubernetesReauth    bool
}

func (*OIDCConfig) FromCobraCommand

func (o *OIDCConfig) FromCobraCommand(cmd *cobra.Command) error

type OIDCTokenRequest

type OIDCTokenRequest struct {
	ClientID     string
	Code         string
	GrantType    string
	RedirectURI  string
	RefreshToken string
	Scope        string

	// Required PKCE field in lieu of client secret
	CodeVerifier string
}

func (OIDCTokenRequest) ToFormData

func (r OIDCTokenRequest) ToFormData() string

type OIDCTokenResponse

type OIDCTokenResponse struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
	IDToken      string `json:"id_token"`
	Scope        string `json:"scope"`

	// Set by handler
	Error error
}

Jump to

Keyboard shortcuts

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