server

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: MPL-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrettyStruct

func PrettyStruct(data interface{}) (string, error)

Types

type AuthInfo

type AuthInfo struct {
	IdentityToken string
	PublicKey     ssh.PublicKey
}

type Opt

type Opt struct {
	Debug       bool
	KubeConfig  string
	HostKeyPath string
}

type Server

type Server struct {
	Router      *gin.Engine
	AdminRouter *gin.Engine
	// contains filtered or unexported fields
}

func New

func New(opt Opt) (*Server, error)

func (*Server) AuthMiddleware added in v0.0.4

func (s *Server) AuthMiddleware() gin.HandlerFunc

func (*Server) OnConfig

func (s *Server) OnConfig(c *gin.Context)

@Summary Update the config of containerssh. @Description It is called by the containerssh webhook. and is not expected to be used externally. @Tags ssh-internal @Accept json @Produce json @Param request body config.Request true "query params" @Success 200 @Router /config [post]

func (*Server) OnPubKey

func (s *Server) OnPubKey(c *gin.Context)

@Summary authenticate the public key. @Description It is called by the containerssh webhook. and is not expected to be used externally. @Tags ssh-internal @Accept json @Produce json @Param request body auth.PublicKeyAuthRequest true "query params" @Success 200 {object} auth.ResponseBody @Router /pubkey [post]

func (*Server) Run

func (s *Server) Run() error

Jump to

Keyboard shortcuts

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