webhook

package
v0.22.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 17 Imported by: 133

Documentation

Overview

Package webhook implements the authenticator.Token interface using HTTP webhooks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRetryBackoff added in v0.20.0

func DefaultRetryBackoff() *wait.Backoff

DefaultRetryBackoff returns the default backoff parameters for webhook retry.

Types

type WebhookTokenAuthenticator

type WebhookTokenAuthenticator struct {
	// contains filtered or unexported fields
}

func New

func New(kubeConfigFile string, version string, implicitAuds authenticator.Audiences, retryBackoff wait.Backoff, customDial utilnet.DialFunc) (*WebhookTokenAuthenticator, error)

New creates a new WebhookTokenAuthenticator from the provided kubeconfig file. It is recommend to wrap this authenticator with the token cache authenticator implemented in k8s.io/apiserver/pkg/authentication/token/cache.

func NewFromInterface

func NewFromInterface(tokenReview authenticationv1client.TokenReviewInterface, implicitAuds authenticator.Audiences, retryBackoff wait.Backoff, requestTimeout time.Duration) (*WebhookTokenAuthenticator, error)

NewFromInterface creates a webhook authenticator using the given tokenReview client. It is recommend to wrap this authenticator with the token cache authenticator implemented in k8s.io/apiserver/pkg/authentication/token/cache.

func (*WebhookTokenAuthenticator) AuthenticateToken

func (w *WebhookTokenAuthenticator) AuthenticateToken(ctx context.Context, token string) (*authenticator.Response, bool, error)

AuthenticateToken implements the authenticator.Token interface.

Jump to

Keyboard shortcuts

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