apiserver

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2018 License: Apache-2.0 Imports: 31 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

Types

type CdiAPIAuthorizer

type CdiAPIAuthorizer interface {
	Authorize(req *restful.Request) (bool, string, error)
	AddUserHeaders(header []string)
	GetUserHeaders() []string
	AddGroupHeaders(header []string)
	GetGroupHeaders() []string
	AddExtraPrefixHeaders(header []string)
	GetExtraPrefixHeaders() []string
}

CdiAPIAuthorizer defines methods to authorize api requests

func NewAuthorizorFromConfig

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

NewAuthorizorFromConfig creates a new CdiAPIAuthorizor

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

type UploadAPIServer

type UploadAPIServer interface {
	Start() error
}

UploadAPIServer is the public interface to the upload API

func NewUploadAPIServer

func NewUploadAPIServer(bindAddress string,
	bindPort uint,
	client kubernetes.Interface,
	aggregatorClient aggregatorclient.Interface,
	authorizor CdiAPIAuthorizer) (UploadAPIServer, error)

NewUploadAPIServer returns an initialized upload api server

Jump to

Keyboard shortcuts

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