tokenreview

package
v0.0.0-...-fe632b3 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8sSvcAcctAuthn

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

K8sSvcAcctAuthn authenticates a k8s service account (JWT) through the k8s TokenReview API.

func NewK8sSvcAcctAuthn

func NewK8sSvcAcctAuthn(apiServerAddr string, apiServerCert []byte, callerToken string) *K8sSvcAcctAuthn

NewK8sSvcAcctAuthn creates a new authenticator for authenticating k8s JWTs. It creates an HTTP client singleton to talk to the apiserver TokenReview API. apiServerAddr: the URL of k8s API Server apiServerCert: the CA certificate of k8s API Server callerToken: the JWT of the caller to authenticate to k8s API server

func (*K8sSvcAcctAuthn) ValidateK8sJwt

func (authn *K8sSvcAcctAuthn) ValidateK8sJwt(targetToken string) ([]string, error)

ValidateK8sJwt validates a k8s JWT at API server. Return {<namespace>, <serviceaccountname>} in the targetToken when the validation passes. Otherwise, return the error. targetToken: the JWT of the K8s service account to be reviewed

Jump to

Keyboard shortcuts

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