Documentation
¶
Index ¶
Constants ¶
const ( // DefaultKubeCfgEndpoint is the default endpoint to which clients should // be redirected after authentication. DefaultKubeCfgEndpoint = "ui" // DefaultAPITokenMountPath is the default mount path for API tokens DefaultAPITokenMountPath = "/var/run/secrets/kubernetes.io/serviceaccount" )
Variables ¶
var ( // DefaultScopes are the minimum required oauth2 scopes for every // authentication request. DefaultScopes = []string{oidc.ScopeOpenID} // ErrInvalidKubeCfgEndpoint indicates an unparseable redirect endpoint. ErrInvalidKubeCfgEndpoint = errors.New("invalid redirect endpoint") // ErrInvalidState indicates the provided state param was not as expected. ErrInvalidState = errors.New("invalid state parameter: user agent or IP address changed between requests") // ErrMissingCode indicates a response without an OAuth 2.0 authorization // code ErrMissingCode = errors.New("response missing authorization code") // ErrNoYAMLSerializer indicates we're unable to serialize Kubernetes // objects as YAML. ErrNoYAMLSerializer = errors.New("no YAML serializer registered") )
Functions ¶
func OfflineAsScope ¶
OfflineAsScope determines whether an offline refresh token is requested via a scope per the spec or via Google's custom access_type=offline method.
See http://openid.net/specs/openid-connect-core-1_0.html#OfflineAccess and https://developers.google.com/identity/protocols/OAuth2WebServer#offline
Types ¶
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers provides HTTP handlers for the Kubernary service.
func NewHandlers ¶
NewHandlers returns a new set of Kuberos HTTP handlers.
type Option ¶
An Option represents a Handlers option.
func AuthCodeOptions ¶
func AuthCodeOptions(oo []oauth2.AuthCodeOption) Option
AuthCodeOptions allows the use of bespoke OAuth2 options.
func HTTPClient ¶
HTTPClient allows the use of a bespoke HTTP client for OIDC requests.
func StateFunction ¶
StateFunction allows the use of a bespoke state generator function.
type ScopeRequests ¶
ScopeRequests configures the oauth2 scopes to request during authentication.
func (*ScopeRequests) Get ¶
func (r *ScopeRequests) Get() []string
Get the scopes to request during authentication.
