middleware

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 31 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// audit template name
	AuditCordonNode      = "cordonNode"
	AuditUncordonNode    = "uncordonNode"
	AuditLabelNode       = "labelNode"
	AuditUnLabelNode     = "unLabelNode"
	AuditDrainNode       = "drainNode"
	AuditOfflineNode     = "offlineNode"
	AuditOnlineNode      = "onlineNode"
	AuditUpdateResource  = "updateK8SResource"
	AuditCreateResource  = "createK8SResource"
	AuditDeleteResource  = "deleteK8SResource"
	AuditKubectlShell    = "kubectlShell"
	AuditRestartWorkload = "restartWorkload"

	// audit template params
	AuditClusterName  = "clusterName"
	AuditNamespace    = "namespace"
	AuditResourceType = "resourceType"
	AuditResourceName = "name"
	AuditTargetLabel  = "targetLabel"
	AuditCommands     = "commands"
)

Variables

View Source
var (
	OutOfLengthSize = errors.New("cmd length out of buffer limit")
)

Functions

func NewDispatcher

func NewDispatcher(auditReqChan chan *cmdWithTimestamp, closeChan chan struct{}) *dispatcher

Types

type Auditor

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

func NewAuditor

func NewAuditor(bdl *bundle.Bundle) *Auditor

NewAuditor return a steve Auditor with bundle. bdl needs withCoreServices to create audit events.

func (*Auditor) AuditMiddleWare

func (a *Auditor) AuditMiddleWare(next http.Handler) http.Handler

AuditMiddleWare audit for steve server by bundle.

type Authenticator

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

func NewAuthenticator

func NewAuthenticator(bdl *bundle.Bundle) *Authenticator

NewAuthenticator return a steve Authenticator with bundle. bdl need withCoreServices to check permission.

func (*Authenticator) AuthMiddleware

func (a *Authenticator) AuthMiddleware(next http.Handler) http.Handler

AuthMiddleware authenticate for steve server by bundle.

type Chain

type Chain []mux.MiddlewareFunc

func (Chain) Handler

func (c Chain) Handler(handler http.Handler) http.Handler

type Queue

type Queue interface {
	Front() string

	Back() string

	Size() int
	Get(i int) (string, error)
	Set(i int, str string) error
	Begin() int
	// contains filtered or unexported methods
}

type ShellHandler

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

func NewShellHandler

func NewShellHandler(ctx context.Context) *ShellHandler

NewShellHandler create a new ShellHandler

func (*ShellHandler) HandleShell

func (s *ShellHandler) HandleShell(next http.Handler) http.Handler

HandleShell forwards the request to cluster-agent pod

Jump to

Keyboard shortcuts

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