Documentation
¶
Index ¶
- Constants
- func ConstructNodeTree(assetNodes []model.Node) (treeprint.Tree, []model.Node)
- func GetInputUsername(sess io.ReadWriteCloser) (username string, err error)
- func GetMatchedAccounts(accounts []model.PermAccount, username string) []model.PermAccount
- func IsScpCommand(rawStr string) bool
- func NewReaderAt(f *srvconn.SftpFile) io.ReaderAt
- func NewWriterAt(f *srvconn.SftpFile, recorder *proxy.FTPFileRecorder) io.WriterAt
- func PrettyContent(s string) string
- type Announcement
- type ColorMeta
- type DirectHandler
- func (d *DirectHandler) Dispatch()
- func (d *DirectHandler) GetPtyWinSize() (width, height int)
- func (d *DirectHandler) LoginAsset()
- func (d *DirectHandler) LoginConnectToken(connectToken *model.ConnectToken)
- func (d *DirectHandler) NewSFTPHandler() *SftpHandler
- func (d *DirectHandler) Proxy(asset model.PermAsset)
- func (d *DirectHandler) WatchWinSizeChange(winChan <-chan ssh.Window)
- type DirectOpt
- func DirectAssets(assets []model.PermAsset) DirectOpt
- func DirectConnectProtocol(protocol string) DirectOpt
- func DirectConnectSftpMode(sftpMode bool) DirectOpt
- func DirectConnectToken(tokenInfo *model.ConnectToken) DirectOpt
- func DirectFormatType(format FormatType) DirectOpt
- func DirectTargetAccount(username string) DirectOpt
- func DirectTerminalConf(conf *model.TerminalConfig) DirectOpt
- func DirectUser(User *model.User) DirectOpt
- type FormatType
- type InteractiveHandler
- type LoginReviewHandler
- type Menu
- type MenuItem
- type Server
- func (s *Server) DirectTCPIPChannelHandler(ctx ssh.Context, newChan gossh.NewChannel, destAddr string)
- func (s *Server) GetTerminalConfig() model.TerminalConfig
- func (s *Server) HandleSSHRequest(ctx ssh.Context, srv *ssh.Server, req *gossh.Request) (bool, []byte)
- func (s *Server) LocalPortForwardingPermission(ctx ssh.Context, dstHost string, dstPort uint32) bool
- func (s *Server) NewSftpHandler(user *model.User, addr string) *SftpHandler
- func (s *Server) PasswordAuth(ctx ssh.Context, password string) error
- func (s *Server) PublicKeyAuth(ctx ssh.Context, key ssh.PublicKey) error
- func (s *Server) ReversePortForwardingPermission(ctx ssh.Context, dstHost string, dstPort uint32) bool
- func (s *Server) SFTPHandler(sess ssh.Session)
- func (s *Server) SessionHandler(sess ssh.Session)
- func (s *Server) UpdateTerminalConfig(conf model.TerminalConfig)
- type SftpHandler
- type UserSelectHandler
- func (u *UserSelectHandler) AutoCompletion()
- func (p UserSelectHandler) CurrentOffSet() int
- func (p UserSelectHandler) CurrentPage() int
- func (u *UserSelectHandler) DisplayCurrentResult()
- func (u *UserSelectHandler) HasNext() bool
- func (u *UserSelectHandler) HasPrev() bool
- func (u *UserSelectHandler) MoveNextPage()
- func (u *UserSelectHandler) MovePrePage()
- func (p UserSelectHandler) PageSize() int
- func (u *UserSelectHandler) Proxy(target model.PermAsset)
- func (u *UserSelectHandler) Retrieve(pageSize, offset int, searches ...string) []model.PermAsset
- func (u *UserSelectHandler) Search(key string)
- func (u *UserSelectHandler) SearchAgain(key string)
- func (u *UserSelectHandler) SearchOrProxy(key string)
- func (u *UserSelectHandler) SetAllLocalData(data []model.PermAsset)
- func (u *UserSelectHandler) SetLoadPolicy(policy dataSource)
- func (u *UserSelectHandler) SetNode(node model.Node)
- func (u *UserSelectHandler) SetSelectType(s selectType)
- func (p UserSelectHandler) TotalCount() int
- func (p UserSelectHandler) TotalPage() int
- type WrapperSession
- func (w *WrapperSession) Close() error
- func (w *WrapperSession) Context() context.Context
- func (w *WrapperSession) HandleRoomEvent(event string, msg *exchange.RoomMessage)
- func (w *WrapperSession) ID() string
- func (w *WrapperSession) LoginFrom() string
- func (w *WrapperSession) Pty() ssh.Pty
- func (w *WrapperSession) Read(p []byte) (int, error)
- func (w *WrapperSession) RemoteAddr() string
- func (w *WrapperSession) SetWin(win ssh.Window)
- func (w *WrapperSession) WinCh() (winch <-chan ssh.Window)
- func (w *WrapperSession) Write(p []byte) (int, error)
Constants ¶
View Source
const ( TypeAsset selectType = iota + 1 TypeNodeAsset TypeK8s TypeDatabase TypeHost )
View Source
const ( ChannelTCPIPForward = "tcpip-forward" ChannelCancelTCPIPForward = "cancel-tcpip-forward" ChannelForwardedTCPIP = "forwarded-tcpip" )
View Source
const PAGESIZEALL = 0
Variables ¶
This section is empty.
Functions ¶
func ConstructNodeTree ¶
func GetInputUsername ¶
func GetInputUsername(sess io.ReadWriteCloser) (username string, err error)
func GetMatchedAccounts ¶
func GetMatchedAccounts(accounts []model.PermAccount, username string) []model.PermAccount
func IsScpCommand ¶
func NewWriterAt ¶
func PrettyContent ¶
Types ¶
type Announcement ¶
type DirectHandler ¶
type DirectHandler struct {
// contains filtered or unexported fields
}
func NewDirectHandler ¶
func (*DirectHandler) Dispatch ¶
func (d *DirectHandler) Dispatch()
func (*DirectHandler) GetPtyWinSize ¶
func (d *DirectHandler) GetPtyWinSize() (width, height int)
func (*DirectHandler) LoginAsset ¶
func (d *DirectHandler) LoginAsset()
func (*DirectHandler) LoginConnectToken ¶
func (d *DirectHandler) LoginConnectToken(connectToken *model.ConnectToken)
func (*DirectHandler) NewSFTPHandler ¶
func (d *DirectHandler) NewSFTPHandler() *SftpHandler
func (*DirectHandler) Proxy ¶
func (d *DirectHandler) Proxy(asset model.PermAsset)
func (*DirectHandler) WatchWinSizeChange ¶
func (d *DirectHandler) WatchWinSizeChange(winChan <-chan ssh.Window)
type DirectOpt ¶
type DirectOpt func(*directOpt)
func DirectAssets ¶
func DirectConnectProtocol ¶
func DirectConnectSftpMode ¶
func DirectConnectToken ¶
func DirectConnectToken(tokenInfo *model.ConnectToken) DirectOpt
func DirectFormatType ¶
func DirectFormatType(format FormatType) DirectOpt
func DirectTargetAccount ¶
func DirectTerminalConf ¶
func DirectTerminalConf(conf *model.TerminalConfig) DirectOpt
func DirectUser ¶
type InteractiveHandler ¶
type InteractiveHandler struct {
// contains filtered or unexported fields
}
func NewInteractiveHandler ¶
func NewInteractiveHandler(sess ssh.Session, user *model.User, jmsService *service.JMService, termConfig model.TerminalConfig) *InteractiveHandler
func (*InteractiveHandler) ChangeLang ¶
func (h *InteractiveHandler) ChangeLang()
func (*InteractiveHandler) Dispatch ¶
func (h *InteractiveHandler) Dispatch()
func (*InteractiveHandler) GetPtySize ¶
func (h *InteractiveHandler) GetPtySize() (int, int)
func (*InteractiveHandler) Initial ¶
func (h *InteractiveHandler) Initial()
func (*InteractiveHandler) WatchWinSizeChange ¶
func (h *InteractiveHandler) WatchWinSizeChange(winChan <-chan ssh.Window)
type LoginReviewHandler ¶
type LoginReviewHandler struct {
// contains filtered or unexported fields
}
func (*LoginReviewHandler) GetTokenInfo ¶
func (l *LoginReviewHandler) GetTokenInfo() model.ConnectTokenInfo
func (*LoginReviewHandler) WaitReview ¶
func (l *LoginReviewHandler) WaitReview(ctx context.Context) (bool, error)
func (*LoginReviewHandler) WaitTicketReview ¶
func (l *LoginReviewHandler) WaitTicketReview(ctx context.Context, srv *auth.LoginReviewService) (bool, error)
type Server ¶
func NewServer ¶
func NewServer(termCfg model.TerminalConfig, jmsService *service.JMService) *Server
func (*Server) DirectTCPIPChannelHandler ¶
func (*Server) GetTerminalConfig ¶
func (s *Server) GetTerminalConfig() model.TerminalConfig
func (*Server) HandleSSHRequest ¶
func (*Server) LocalPortForwardingPermission ¶
func (*Server) NewSftpHandler ¶
func (s *Server) NewSftpHandler(user *model.User, addr string) *SftpHandler
func (*Server) PublicKeyAuth ¶
func (*Server) ReversePortForwardingPermission ¶
func (*Server) SFTPHandler ¶
func (*Server) SessionHandler ¶
func (*Server) UpdateTerminalConfig ¶
func (s *Server) UpdateTerminalConfig(conf model.TerminalConfig)
type SftpHandler ¶
type SftpHandler struct { *srvconn.UserSftpConn // contains filtered or unexported fields }
func (*SftpHandler) Close ¶
func (s *SftpHandler) Close()
type UserSelectHandler ¶
type UserSelectHandler struct {
// contains filtered or unexported fields
}
func (*UserSelectHandler) AutoCompletion ¶
func (u *UserSelectHandler) AutoCompletion()
func (UserSelectHandler) CurrentOffSet ¶
func (p UserSelectHandler) CurrentOffSet() int
func (UserSelectHandler) CurrentPage ¶
func (p UserSelectHandler) CurrentPage() int
func (*UserSelectHandler) DisplayCurrentResult ¶
func (u *UserSelectHandler) DisplayCurrentResult()
func (*UserSelectHandler) HasNext ¶
func (u *UserSelectHandler) HasNext() bool
func (*UserSelectHandler) HasPrev ¶
func (u *UserSelectHandler) HasPrev() bool
func (*UserSelectHandler) MoveNextPage ¶
func (u *UserSelectHandler) MoveNextPage()
func (*UserSelectHandler) MovePrePage ¶
func (u *UserSelectHandler) MovePrePage()
func (*UserSelectHandler) Proxy ¶
func (u *UserSelectHandler) Proxy(target model.PermAsset)
func (*UserSelectHandler) Retrieve ¶
func (u *UserSelectHandler) Retrieve(pageSize, offset int, searches ...string) []model.PermAsset
func (*UserSelectHandler) Search ¶
func (u *UserSelectHandler) Search(key string)
func (*UserSelectHandler) SearchAgain ¶
func (u *UserSelectHandler) SearchAgain(key string)
func (*UserSelectHandler) SearchOrProxy ¶
func (u *UserSelectHandler) SearchOrProxy(key string)
func (*UserSelectHandler) SetAllLocalData ¶
func (u *UserSelectHandler) SetAllLocalData(data []model.PermAsset)
func (*UserSelectHandler) SetLoadPolicy ¶
func (u *UserSelectHandler) SetLoadPolicy(policy dataSource)
func (*UserSelectHandler) SetNode ¶
func (u *UserSelectHandler) SetNode(node model.Node)
func (*UserSelectHandler) SetSelectType ¶
func (u *UserSelectHandler) SetSelectType(s selectType)
func (UserSelectHandler) TotalCount ¶
func (p UserSelectHandler) TotalCount() int
type WrapperSession ¶
type WrapperSession struct { Uuid string Sess ssh.Session // contains filtered or unexported fields }
func NewWrapperSession ¶
func NewWrapperSession(sess ssh.Session) *WrapperSession
func (*WrapperSession) Close ¶
func (w *WrapperSession) Close() error
func (*WrapperSession) Context ¶
func (w *WrapperSession) Context() context.Context
func (*WrapperSession) HandleRoomEvent ¶
func (w *WrapperSession) HandleRoomEvent(event string, msg *exchange.RoomMessage)
func (*WrapperSession) ID ¶
func (w *WrapperSession) ID() string
func (*WrapperSession) LoginFrom ¶
func (w *WrapperSession) LoginFrom() string
func (*WrapperSession) Pty ¶
func (w *WrapperSession) Pty() ssh.Pty
func (*WrapperSession) RemoteAddr ¶
func (w *WrapperSession) RemoteAddr() string
func (*WrapperSession) SetWin ¶
func (w *WrapperSession) SetWin(win ssh.Window)
func (*WrapperSession) WinCh ¶
func (w *WrapperSession) WinCh() (winch <-chan ssh.Window)
Click to show internal directories.
Click to hide internal directories.