apiserver

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIPublicKeyConfigMap is the uploadProxy Public key
	APIPublicKeyConfigMap = "cdi-api-public"
)

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(pvcName string, namespace string, signingKey *rsa.PrivateKey) (string, error)

GenerateToken generates a token from the given parameters

func UploadTokenRequestAPI added in v1.5.0

func UploadTokenRequestAPI() []*restful.WebService

UploadTokenRequestAPI returns web service for swagger generation

Types

type AuthConfig added in v1.9.3

type AuthConfig struct {
	AllowedNames       []string
	UserHeaders        []string
	GroupHeaders       []string
	ExtraPrefixHeaders []string

	ClientCABytes              []byte
	RequestheaderClientCABytes []byte

	CertPool *x509.CertPool
}

AuthConfig contains extension-apiserver-authentication data

type AuthConfigWatcher added in v1.9.3

type AuthConfigWatcher interface {
	GetAuthConfig() *AuthConfig
}

AuthConfigWatcher is the interface of authConfigWatcher

func NewAuthConfigWatcher added in v1.9.3

func NewAuthConfigWatcher(client kubernetes.Interface, stopCh <-chan struct{}) AuthConfigWatcher

NewAuthConfigWatcher crates a new authConfigWatcher

type CdiAPIAuthorizer

type CdiAPIAuthorizer interface {
	Authorize(req *restful.Request) (bool, string, error)
}

CdiAPIAuthorizer defines methods to authorize api requests

func NewAuthorizorFromConfig

func NewAuthorizorFromConfig(config *restclient.Config, authConfigWatcher AuthConfigWatcher) (CdiAPIAuthorizer, error)

NewAuthorizorFromConfig creates a new CdiAPIAuthorizor

type CdiAPIServer added in v1.4.0

type CdiAPIServer interface {
	Start(<-chan struct{}) error
}

CdiAPIServer is the public interface to the CDI API

func NewCdiAPIServer added in v1.4.0

func NewCdiAPIServer(bindAddress string,
	bindPort uint,
	client kubernetes.Interface,
	aggregatorClient aggregatorclient.Interface,
	authorizor CdiAPIAuthorizer,
	authConfigWatcher AuthConfigWatcher) (CdiAPIServer, error)

NewCdiAPIServer returns an initialized CDI api server

type TokenData

type TokenData struct {
	PvcName           string    `json:"pvcName"`
	Namespace         string    `json:"namespace"`
	CreationTimestamp time.Time `json:"creationTimestamp"`
}

TokenData defines the data in the upload token

func VerifyToken

func VerifyToken(token string, publicKey *rsa.PublicKey) (*TokenData, error)

VerifyToken checks the token signature and returns the contents

Directories

Path Synopsis
webhooks

Jump to

Keyboard shortcuts

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