model

package
v0.0.0-...-503ec33 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InputUser   = "@INPUT"
	DynamicUser = "@USER"
	ANONUser    = "@ANON"
)
View Source
const (
	ProtocolSSH    = "ssh"
	ProtocolTelnet = "telnet"
	ProtocolK8S    = "k8s"
	ProtocolSFTP   = "sftp"
	ProtocolRedis  = "redis"
)
View Source
const (
	OperateDownload = "download"
	OperateUpload   = "upload"
)
View Source
const (
	OperateRemoveDir = "rmdir"
	OperateRename    = "rename"
	OperateRenameDir = "rename_dir"
	OperateMkdir     = "mkdir"
	OperateDelete    = "delete"
	OperateSymlink   = "symlink"
)
View Source
const (
	NormalLevel  = 0
	WarningLevel = 4
	RejectLevel  = 5
	ReviewReject = 6
	ReviewAccept = 7
	ReviewCancel = 8
)
View Source
const (
	ActionReject  = "reject"
	ActionAccept  = "accept"
	ActionReview  = "review"
	ActionWarning = "warning"
	ActionUnknown = "Unknown"
)
View Source
const (
	TreeTypeNode  = "node"
	TreeTypeAsset = "asset"
)
View Source
const (
	ActionALL      = "all"
	ActionConnect  = "connect"
	ActionUpload   = "upload"
	ActionDownload = "download"
	ActionCopy     = "copy"
	ActionPaste    = "paste"
	ActionDelete   = "delete"
	ActionShare    = "share"
)
View Source
const (
	SuffixReplayGz = ".replay.gz"
	SuffixCastGz   = ".cast.gz"
	SuffixCast     = ".cast"
	SuffixGz       = ".gz"
)
View Source
const (
	TaskKillSession = "kill_session"

	TaskLockSession   = "lock_session"
	TaskUnlockSession = "unlock_session"
)
View Source
const (
	TicketOpen     = "pending"
	TicketApproved = "approved"
	TicketRejected = "rejected"
	TicketClosed   = "closed"
)
View Source
const (
	ACLReview = "acl_review"
	ACLReject = "acl_reject"
)

Variables

View Source
var (
	AccessKeyNotFound     = errors.New("access key not found")
	AccessKeyFileNotFound = errors.New("access key file not found")
	AccessKeyInvalid      = errors.New("access key not valid")
)
View Source
var EmptyLifecycleLog = SessionLifecycleLog{}

Functions

func SortNodesByKey

func SortNodesByKey(nodes []Node)

Types

type AccessKey

type AccessKey struct {
	ID     string `json:"id"`
	Secret string `json:"secret"`
}

func (*AccessKey) LoadFromFile

func (ak *AccessKey) LoadFromFile(keyPath string) error

func (*AccessKey) LoadFromStr

func (ak *AccessKey) LoadFromStr(key string) error

func (*AccessKey) SaveToFile

func (ak *AccessKey) SaveToFile(path string) error

type Account

type Account struct {
	BaseAccount
	SuFrom *BaseAccount `json:"su_from"`
}

func (*Account) GetBaseAccount

func (a *Account) GetBaseAccount() *BaseAccount

type AccountDetail

type AccountDetail struct {
	ID         string     `json:"id"`
	Name       string     `json:"name"`
	Username   string     `json:"username"`
	Secret     string     `json:"secret"`
	SecretType LabelValue `json:"secret_type"`
	HasSecret  bool       `json:"has_secret"`
	IsActive   bool       `json:"is_active"`
	Privileged bool       `json:"privileged"`
}

type Action

type Action LabelValue

type Actions

type Actions []Action

func (Actions) EnableConnect

func (a Actions) EnableConnect() bool

func (Actions) EnableCopy

func (a Actions) EnableCopy() bool

func (Actions) EnableDelete

func (a Actions) EnableDelete() bool

func (Actions) EnableDownload

func (a Actions) EnableDownload() bool

func (Actions) EnableDrive

func (a Actions) EnableDrive() bool

func (Actions) EnablePaste

func (a Actions) EnablePaste() bool

func (Actions) EnableShare

func (a Actions) EnableShare() bool

func (Actions) EnableUpload

func (a Actions) EnableUpload() bool

func (Actions) Permission

func (a Actions) Permission() Permission

type Asset

type Asset struct {
	ID         string       `json:"id"`
	Address    string       `json:"address"`
	Name       string       `json:"name"`
	OrgID      string       `json:"org_id"`
	Protocols  []Protocol   `json:"protocols"`
	SpecInfo   SpecInfo     `json:"spec_info"`
	SecretInfo SecretInfo   `json:"secret_info"`
	Platform   BasePlatform `json:"platform"`

	Domain *BaseDomain `json:"domain"` // token 方式获取的资产,domain 为 nil

	Comment  string `json:"comment"`
	OrgName  string `json:"org_name"`
	IsActive bool   `json:"is_active"` // 判断资产是否禁用

	Accounts Actions `json:"accounts,omitempty"` // 只有 detail api才会有这个字段
}

func (*Asset) FilterProtocols

func (a *Asset) FilterProtocols(filter func(string) bool) []string

func (*Asset) IsSupportProtocol

func (a *Asset) IsSupportProtocol(protocol string) bool

func (*Asset) ProtocolPort

func (a *Asset) ProtocolPort(protocol string) int

func (*Asset) String

func (a *Asset) String() string

func (*Asset) SupportProtocols

func (a *Asset) SupportProtocols() []string

type AssetList

type AssetList []Asset

func (AssetList) SortBy

func (a AssetList) SortBy(tp string) AssetList

type AssetLoginTicketInfo

type AssetLoginTicketInfo struct {
	TicketId    string `json:"ticket_id"`
	NeedConfirm bool   `json:"need_confirm"`
	TicketInfo
}

type AssetMeta

type AssetMeta struct {
	OrgName     string `json:"org_name"`
	SupportSFTP bool   `json:"sftp"`
}

type AssetNodeSorter

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

func (*AssetNodeSorter) Len

func (a *AssetNodeSorter) Len() int

func (*AssetNodeSorter) Less

func (a *AssetNodeSorter) Less(i, j int) bool

func (*AssetNodeSorter) Swap

func (a *AssetNodeSorter) Swap(i, j int)

type BaseAccount

type BaseAccount struct {
	ID         string     `json:"id"`
	Name       string     `json:"name"`
	Username   string     `json:"username"`
	Secret     string     `json:"secret"`
	SecretType LabelValue `json:"secret_type"`
}

func (*BaseAccount) HashId

func (a *BaseAccount) HashId() string

func (*BaseAccount) IsAnonymous

func (a *BaseAccount) IsAnonymous() bool

func (*BaseAccount) IsNull

func (a *BaseAccount) IsNull() bool

func (*BaseAccount) IsSSHKey

func (a *BaseAccount) IsSSHKey() bool

func (*BaseAccount) String

func (a *BaseAccount) String() string

type BaseDomain

type BaseDomain struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type BasePlatform

type BasePlatform struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type Command

type Command struct {
	SessionID string `json:"session"`
	OrgID     string `json:"org_id"`
	Input     string `json:"input"`
	Output    string `json:"output"`
	User      string `json:"user"`
	Server    string `json:"asset"`
	Account   string `json:"account"`
	Timestamp int64  `json:"timestamp"`
	RiskLevel int64  `json:"risk_level"`

	CmdFilterAclId string `json:"cmd_filter_acl"`
	CmdGroupId     string `json:"cmd_group"`

	DateCreated time.Time `json:"@timestamp"`
}

type CommandACL

type CommandACL struct {
	ID            string              `json:"id"`
	Action        CommandAction       `json:"action"`
	CommandGroups []CommandFilterItem `json:"command_groups"`
	IsActive      bool                `json:"is_active"`
	Name          string              `json:"name"`
	Priority      int                 `json:"priority"`
	Reviewers     []interface{}       `json:"reviewers"`
}

func (*CommandACL) Match

type CommandACLs

type CommandACLs []CommandACL

func (CommandACLs) Len

func (f CommandACLs) Len() int

func (CommandACLs) Less

func (f CommandACLs) Less(i, j int) bool

func (CommandACLs) Swap

func (f CommandACLs) Swap(i, j int)

type CommandAction

type CommandAction string

type CommandFilterItem

type CommandFilterItem struct {
	ID         string `json:"id"`
	Content    string `json:"content"`
	IgnoreCase bool   `json:"ignore_case"`
	Name       string `json:"name"`
	Type       string `json:"type"`
	RePattern  string `json:"pattern"`
	// contains filtered or unexported fields
}

func (*CommandFilterItem) Pattern

func (cf *CommandFilterItem) Pattern() FindStringer

type CommandTicketInfo

type CommandTicketInfo struct {
	TicketInfo
}

type ConnectOptions

type ConnectOptions struct {
	Charset          *string `json:"charset,omitempty"`
	DisableAutoHash  *bool   `json:"disableautohash,omitempty"`
	BackspaceAsCtrlH *bool   `json:"backspaceAsCtrlH,omitempty"`

	FilenameConflictResolution string `json:"file_name_conflict_resolution,omitempty"`
	TerminalThemeName          string `json:"terminal_theme_name,omitempty"`
}

type ConnectToken

type ConnectToken struct {
	Id       string     `json:"id"`
	User     User       `json:"user"`
	Value    string     `json:"value"`
	Account  Account    `json:"account"`
	Actions  Actions    `json:"actions"`
	Asset    Asset      `json:"asset"`
	Protocol string     `json:"protocol"`
	Domain   *Domain    `json:"domain"`
	Gateway  *Gateway   `json:"gateway"`
	ExpireAt ExpireInfo `json:"expire_at"`
	OrgId    string     `json:"org_id"`
	OrgName  string     `json:"org_name"`
	Platform Platform   `json:"platform"`

	ConnectOptions ConnectOptions `json:"connect_options"`

	CommandFilterACLs []CommandACL `json:"command_filter_acls"`

	Ticket     *ObjectId   `json:"from_ticket,omitempty"`
	TicketInfo interface{} `json:"from_ticket_info,omitempty"`

	Code   string `json:"code"`
	Detail string `json:"detail"`
}

func (*ConnectToken) CreateSession

func (c *ConnectToken) CreateSession(addr string,
	loginFrom, SessionType LabelField) Session

type ConnectTokenInfo

type ConnectTokenInfo struct {
	ID          string `json:"id"`
	Value       string `json:"value"`
	ExpireTime  int    `json:"expire_time"`
	AccountName string `json:"account_name"`
	Protocol    string `json:"protocol"`

	Ticket     *ObjectId  `json:"from_ticket,omitempty"`
	TicketInfo TicketInfo `json:"from_ticket_info,omitempty"`

	Code   string `json:"code,omitempty"`
	Detail string `json:"detail,omitempty"`
}

type Domain

type Domain struct {
	ID       string    `json:"id"`
	Name     string    `json:"name"`
	Gateways []Gateway `json:"gateways"`
}

type ExpireInfo

type ExpireInfo int64

func (ExpireInfo) IsExpired

func (e ExpireInfo) IsExpired(now time.Time) bool

type FTPLog

type FTPLog struct {
	ID         string         `json:"id"`
	User       string         `json:"user"`
	Asset      string         `json:"asset"`
	OrgID      string         `json:"org_id"`
	Account    string         `json:"account"`
	RemoteAddr string         `json:"remote_addr"`
	Operate    string         `json:"operate"`
	Path       string         `json:"filename"`
	DateStart  common.UTCTime `json:"date_start"`
	IsSuccess  bool           `json:"is_success"`
	Session    string         `json:"session"`
}

type FindStringer

type FindStringer interface {
	FindString(s string) string
}

type Gateway

type Gateway struct {
	ID        string    `json:"id"`
	Name      string    `json:"Name"`
	Address   string    `json:"address"`
	Protocols Protocols `json:"protocols"`
	Account   Account   `json:"account"`
}

type HeartbeatData

type HeartbeatData struct {
	SessionOnlineIds []string `json:"sessions"`
	SessionOnline    int      `json:"session_online"`
	CpuUsed          float64  `json:"cpu_load"`
	MemoryUsed       float64  `json:"memory_used"`
	DiskUsed         float64  `json:"disk_used"`
}

type KokoBasic

type KokoBasic struct {
	ThemeName string `json:"terminal_theme_name"`
}

type LabelField

type LabelField string
const (
	NORMALType  LabelField = "normal"
	TUNNELType  LabelField = "tunnel"
	COMMANDType LabelField = "command"
	SFTPType    LabelField = "sftp"
)
const (
	LoginFromSSH LabelField = "ST"
	LoginFromWeb LabelField = "WT"
)

func (LabelField) MarshalJSON

func (s LabelField) MarshalJSON() ([]byte, error)

func (*LabelField) UnmarshalJSON

func (s *LabelField) UnmarshalJSON(bytes []byte) error

type LabelValue

type LabelValue struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

type LifecycleEvent

type LifecycleEvent string
const (
	AssetConnectSuccess  LifecycleEvent = "asset_connect_success"
	AssetConnectFinished LifecycleEvent = "asset_connect_finished"
	CreateShareLink      LifecycleEvent = "create_share_link"
	UserJoinSession      LifecycleEvent = "user_join_session"
	UserLeaveSession     LifecycleEvent = "user_leave_session"
	AdminJoinMonitor     LifecycleEvent = "admin_join_monitor"
	AdminExitMonitor     LifecycleEvent = "admin_exit_monitor"
	ReplayConvertStart   LifecycleEvent = "replay_convert_start"
	ReplayConvertSuccess LifecycleEvent = "replay_convert_success"
	ReplayConvertFailure LifecycleEvent = "replay_convert_failure"
	ReplayUploadStart    LifecycleEvent = "replay_upload_start"
	ReplayUploadSuccess  LifecycleEvent = "replay_upload_success"
	ReplayUploadFailure  LifecycleEvent = "replay_upload_failure"
)

type MiniUser

type MiniUser struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Username string `json:"username"`
}

type Node

type Node struct {
	ID           string `json:"id"`
	Key          string `json:"key"`
	Name         string `json:"name"`
	Value        string `json:"value"`
	Parent       string `json:"parent"`
	AssetsAmount int    `json:"assets_amount"`
	OrgID        string `json:"org_id"`
}

type NodeList

type NodeList []Node

type NodeMeta

type NodeMeta struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type NodeTree

type NodeTree struct {
	ID       string   `json:"id"`
	Name     string   `json:"name"`
	Title    string   `json:"title"`
	Pid      string   `json:"pId"`
	IsParent bool     `json:"isParent"`
	Meta     TreeMeta `json:"meta"`

	ChkDisabled bool `json:"chkDisabled"` // 判断资产是否禁用
}

type NodeTreeList

type NodeTreeList []NodeTree

type NodeTreeMeta

type NodeTreeMeta struct {
	NodeMeta
	AssetMeta
}

type ObjectId

type ObjectId struct {
	ID string `json:"id"`
}

type PaginationParam

type PaginationParam struct {
	PageSize int
	Offset   int
	Searches []string
	Refresh  bool

	Order    string
	Category string
	Type     string
	IsActive bool

	Protocols []string
}

type PaginationResponse

type PaginationResponse struct {
	Total       int         `json:"count"`
	NextURL     string      `json:"next"`
	PreviousURL string      `json:"previous"`
	Data        []PermAsset `json:"results"`
}

type PermAccount

type PermAccount struct {
	Name       string  `json:"name"`
	Username   string  `json:"username"`
	SecretType string  `json:"secret_type"`
	HasSecret  bool    `json:"has_secret"`
	Actions    Actions `json:"actions"`
	Alias      string  `json:"alias"`

	Secret string
}

func (*PermAccount) IsAnonymous

func (a *PermAccount) IsAnonymous() bool

func (*PermAccount) IsInputUser

func (a *PermAccount) IsInputUser() bool

func (*PermAccount) IsSSHKey

func (a *PermAccount) IsSSHKey() bool

func (*PermAccount) String

func (a *PermAccount) String() string

type PermAccountList

type PermAccountList []PermAccount

func (PermAccountList) Len

func (a PermAccountList) Len() int

func (PermAccountList) Less

func (a PermAccountList) Less(i, j int) bool

func (PermAccountList) Swap

func (a PermAccountList) Swap(i, j int)

type PermAsset

type PermAsset struct {
	ID       string       `json:"id"`
	Name     string       `json:"name"`
	Address  string       `json:"address"`
	Comment  string       `json:"comment"`
	Platform BasePlatform `json:"platform"`
	OrgID    string       `json:"org_id"`
	OrgName  string       `json:"org_name"`
	IsActive bool         `json:"is_active"`
	Type     LabelField   `json:"type"`
	Category LabelField   `json:"category"`
}

func (*PermAsset) String

func (a *PermAsset) String() string

type PermAssetDetail

type PermAssetDetail struct {
	ID              string        `json:"id"`
	Name            string        `json:"name"`
	Address         string        `json:"address"`
	Comment         string        `json:"comment"`
	Platform        BasePlatform  `json:"platform"`
	OrgID           string        `json:"org_id"`
	OrgName         string        `json:"org_name"`
	IsActive        bool          `json:"is_active"`
	Type            LabelField    `json:"type"`
	Category        LabelField    `json:"category"`
	PermedAccounts  []PermAccount `json:"permed_accounts"`
	PermedProtocols []Protocol    `json:"permed_protocols"`
}

func (*PermAssetDetail) String

func (a *PermAssetDetail) String() string

func (*PermAssetDetail) SupportProtocol

func (a *PermAssetDetail) SupportProtocol(protocol string) bool

type PermAssetList

type PermAssetList []PermAsset

func (PermAssetList) SortBy

func (a PermAssetList) SortBy(tp string) PermAssetList

type Permission

type Permission struct {
	Actions []string `json:"actions"`
}

func (*Permission) EnableConnect

func (p *Permission) EnableConnect() bool

func (*Permission) EnableCopy

func (p *Permission) EnableCopy() bool

func (*Permission) EnableDelete

func (p *Permission) EnableDelete() bool

func (*Permission) EnableDownload

func (p *Permission) EnableDownload() bool

func (*Permission) EnableDrive

func (p *Permission) EnableDrive() bool

func (*Permission) EnablePaste

func (p *Permission) EnablePaste() bool

func (*Permission) EnableShare

func (p *Permission) EnableShare() bool

func (*Permission) EnableUpload

func (p *Permission) EnableUpload() bool

type Platform

type Platform struct {
	BaseOs   string                 `json:"base"`
	MetaData map[string]interface{} `json:"meta"`

	ID   int    `json:"id"`
	Name string `json:"name"`

	Protocols PlatformProtocols `json:"protocols"`
	Category  LabelValue        `json:"category"`
	Charset   LabelValue        `json:"charset"`
	Type      LabelValue        `json:"type"`
	SuEnabled bool              `json:"su_enabled"`
	SuMethod  *LabelValue       `json:"su_method,omitempty"`
	//DomainEnabled bool              `json:"domain_enabled"`
	Comment string `json:"comment"`
}

func (Platform) GetProtocol

func (p Platform) GetProtocol(protocol string) PlatformProtocol

type PlatformProtocol

type PlatformProtocol struct {
	Protocol
	Setting ProtocolSetting `json:"setting"`
}

type PlatformProtocols

type PlatformProtocols []PlatformProtocol

func (PlatformProtocols) GetSftpPath

func (p PlatformProtocols) GetSftpPath(protocol string) string

type Protocol

type Protocol struct {
	Id     int    `json:"id"`
	Name   string `json:"name"`
	Port   int    `json:"port"`
	Public bool   `json:"public"`
}

type ProtocolSetting

type ProtocolSetting struct {
	Security         string `json:"security"`
	SftpEnabled      bool   `json:"sftp_enabled"`
	SftpHome         string `json:"sftp_home"`
	AutoFill         bool   `json:"auto_fill"`
	UsernameSelector string `json:"username_selector"`
	PasswordSelector string `json:"password_selector"`
	SubmitSelector   string `json:"submit_selector"`

	// for redis 特殊处理的字段
	AuthUsername bool `json:"auth_username"`

	TelnetUsernamePrompt string `json:"username_prompt"`
	TelnetPasswordPrompt string `json:"password_prompt"`
	TelnetSuccessPrompt  string `json:"success_prompt"`

	// for mongodb
	AuthSource string `json:"auth_source"`
}

type Protocols

type Protocols []Protocol

func (Protocols) GetProtocolPort

func (p Protocols) GetProtocolPort(protocol string) int

func (Protocols) IsSupportProtocol

func (p Protocols) IsSupportProtocol(protocol string) bool

type PublicSetting

type PublicSetting struct {
	Interface struct {
		LoginTitle string `json:"login_title"`
		LogOut     string `json:"logo_logout"`
		Index      string `json:"logo_index"`
		Image      string `json:"login_image"`
		Favicon    string `json:"favicon"`
	} `json:"INTERFACE"`
	EnableWatermark    bool `json:"SECURITY_WATERMARK_ENABLED"`
	EnableSessionShare bool `json:"SECURITY_SESSION_SHARE"`
	EnableAnnouncement bool `json:"ANNOUNCEMENT_ENABLED"`
	Announcement       struct {
		Id      string `json:"ID"`
		Subject string `json:"SUBJECT"`
		Content string `json:"CONTENT"`
		Link    string `json:"LINK"`
	} `json:"ANNOUNCEMENT"`
}

type Regexp2

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

func (*Regexp2) FindString

func (r *Regexp2) FindString(s string) string

type ReplayConfig

type ReplayConfig struct {
	TypeName string `json:"TYPE"`

	/*
		obs oss
	*/
	Endpoint  string `json:"ENDPOINT,omitempty"`
	Bucket    string `json:"BUCKET,omitempty"`
	AccessKey string `json:"ACCESS_KEY,omitempty"`
	SecretKey string `json:"SECRET_KEY,omitempty"`

	Region string `json:"REGION,omitempty"`

	/*
		azure 专属
	*/
	AccountName    string `json:"ACCOUNT_NAME,omitempty"`
	AccountKey     string `json:"ACCOUNT_KEY,omitempty"`
	EndpointSuffix string `json:"ENDPOINT_SUFFIX,omitempty"`
	ContainerName  string `json:"CONTAINER_NAME,omitempty"`
}

type ReplayError

type ReplayError LabelField
const (
	SessionReplayErrConnectFailed ReplayError = "connect_failed"
	SessionReplayErrCreatedFailed ReplayError = "replay_create_failed"
	SessionReplayErrUploadFailed  ReplayError = "replay_upload_failed"
	SessionReplayErrUnsupported   ReplayError = "replay_unsupported"
)

func (ReplayError) Error

func (r ReplayError) Error() string

type ReplayVersion

type ReplayVersion string
const (
	UnKnown  ReplayVersion = ""
	Version2 ReplayVersion = "2"
	Version3 ReplayVersion = "3"
)

func ParseReplayVersion

func ParseReplayVersion(gzFile string, defaultValue ReplayVersion) ReplayVersion

type ReqInfo

type ReqInfo struct {
	Method string `json:"method"`
	URL    string `json:"url"`
}

type SecretInfo

type SecretInfo struct {
	CaCert     string `json:"ca_cert"`
	ClientCert string `json:"client_cert"`
	ClientKey  string `json:"client_key"`
}

type SecretType

type SecretType LabelValue

type Session

type Session struct {
	ID         string         `json:"id,omitempty"`
	User       string         `json:"user"`
	Asset      string         `json:"asset"`
	Account    string         `json:"account"`
	LoginFrom  LabelField     `json:"login_from,omitempty"`
	RemoteAddr string         `json:"remote_addr"`
	Protocol   string         `json:"protocol"`
	DateStart  common.UTCTime `json:"date_start"`
	OrgID      string         `json:"org_id"`
	UserID     string         `json:"user_id"`
	AssetID    string         `json:"asset_id"`
	AccountID  string         `json:"account_id"`
	Type       LabelField     `json:"type"`
	ErrReason  LabelField     `json:"error_reason,omitempty"`
}

type SessionLifecycleLog

type SessionLifecycleLog struct {
	Reason string `json:"reason"`
	User   string `json:"user"`
}

type SessionLifecycleReasonErr

type SessionLifecycleReasonErr string
const (
	ReasonErrConnectFailed     SessionLifecycleReasonErr = "connect_failed"
	ReasonErrConnectDisconnect SessionLifecycleReasonErr = "connect_disconnect"
	ReasonErrUserClose         SessionLifecycleReasonErr = "user_close"
	ReasonErrIdleDisconnect    SessionLifecycleReasonErr = "idle_disconnect"
	ReasonErrAdminTerminate    SessionLifecycleReasonErr = "admin_terminate"
	ReasonErrMaxSessionTimeout SessionLifecycleReasonErr = "max_session_timeout"
	ReasonErrPermissionExpired SessionLifecycleReasonErr = "permission_expired"
	ReasonErrNullStorage       SessionLifecycleReasonErr = "null_storage"
)

type SharePostData

type SharePostData struct {
	ShareId    string `json:"sharing"`
	Code       string `json:"verify_code"`
	UserId     string `json:"joiner"`
	RemoteAddr string `json:"remote_addr"`
}

type ShareRecord

type ShareRecord struct {
	ID      string   `json:"id"`
	Code    string   `json:"verify_code"`
	Session ObjectId `json:"session"`
	Sharing ObjectId `json:"sharing"`
	OrgId   string   `json:"org_id"`
	OrgName string   `json:"org_name"`

	ActionPermission LabelValue `json:"action_permission"`

	Err interface{} `json:"error"`
}

func (ShareRecord) Writeable

func (s ShareRecord) Writeable() bool

type SharingSession

type SharingSession struct {
	ID          string `json:"id"`
	IsActive    bool   `json:"is_active"`
	ExpiredTime int    `json:"expired_time"`
	Code        string `json:"verify_code"`

	ActionPermission string `json:"action_permission"`
}

type SharingSessionRequest

type SharingSessionRequest struct {
	SessionID  string   `json:"session"`
	ExpireTime int      `json:"expired_time"`
	Users      []string `json:"users"`
	ActionPerm string   `json:"action_permission"`
	OriginURL  string   `json:"origin"`
}

type SpecInfo

type SpecInfo struct {
	// database
	DBName string `json:"db_name"`

	UseSSL           bool `json:"use_ssl"`
	AllowInvalidCert bool `json:"allow_invalid_cert"`

	// web
	Autofill         string `json:"autofill"`
	UsernameSelector string `json:"username_selector"`
	PasswordSelector string `json:"password_selector"`
	SubmitSelector   string `json:"submit_selector"`
}

type StdRegexp

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

func (*StdRegexp) FindString

func (r *StdRegexp) FindString(s string) string

type TaskKwargs

type TaskKwargs struct {
	TerminatedBy  string `json:"terminated_by"`
	CreatedByUser string `json:"created_by"`
}

type Terminal

type Terminal struct {
	Name           string `json:"name"`
	Comment        string `json:"comment"`
	ServiceAccount struct {
		ID        string    `json:"id"`
		Name      string    `json:"name"`
		AccessKey AccessKey `json:"access_key"`
	} `json:"service_account"`
}

type TerminalConfig

type TerminalConfig struct {
	AssetListPageSize   string                 `json:"TERMINAL_ASSET_LIST_PAGE_SIZE"`
	AssetListSortBy     string                 `json:"TERMINAL_ASSET_LIST_SORT_BY"`
	HeaderTitle         string                 `json:"TERMINAL_HEADER_TITLE"`
	PasswordAuth        bool                   `json:"TERMINAL_PASSWORD_AUTH"`
	PublicKeyAuth       bool                   `json:"TERMINAL_PUBLIC_KEY_AUTH"`
	ReplayStorage       ReplayConfig           `json:"TERMINAL_REPLAY_STORAGE"`
	CommandStorage      map[string]interface{} `json:"TERMINAL_COMMAND_STORAGE"`
	SessionKeepDuration int                    `json:"TERMINAL_SESSION_KEEP_DURATION"`
	TelnetRegex         string                 `json:"TERMINAL_TELNET_REGEX"`
	MaxIdleTime         int                    `json:"SECURITY_MAX_IDLE_TIME"`
	MaxSessionTime      int                    `json:"SECURITY_MAX_SESSION_TIME"`
	HeartbeatDuration   int                    `json:"TERMINAL_HEARTBEAT_INTERVAL"`
	HostKey             string                 `json:"TERMINAL_HOST_KEY"`
	EnableSessionShare  bool                   `json:"SECURITY_SESSION_SHARE"`
	MaxStoreFTPFileSize int                    `json:"FTP_FILE_MAX_STORE"`
}

type TerminalTask

type TerminalTask struct {
	ID         string     `json:"id"`
	Name       string     `json:"name"`
	Args       string     `json:"args"`
	Kwargs     TaskKwargs `json:"kwargs"`
	IsFinished bool
}

type TicketInfo

type TicketInfo struct {
	CheckReq        ReqInfo  `json:"check_ticket_api"`
	CloseReq        ReqInfo  `json:"close_ticket_api"`
	TicketDetailUrl string   `json:"ticket_detail_page_url"`
	Reviewers       []string `json:"assignees"`
}

type TicketState

type TicketState struct {
	ID        string     `json:"id"`
	Processor string     `json:"processor,omitempty"`
	State     LabelField `json:"state"`
	Status    LabelField `json:"status"`
}

type TreeMeta

type TreeMeta struct {
	Type string       `json:"type"`
	Data NodeTreeMeta `json:"data"`
}

type User

type User struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Username string `json:"username"`
	Email    string `json:"email"`
	Role     string `json:"role"`
	IsValid  bool   `json:"is_valid"`
	IsActive bool   `json:"is_active"`
	OTPLevel int    `json:"otp_level"`
}

func (*User) String

func (u *User) String() string

type UserKokoPreference

type UserKokoPreference struct {
	Basic KokoBasic `json:"basic"`
}

type ValidateResult

type ValidateResult struct {
	Ok  bool   `json:"ok"`
	Msg string `json:"msg"`
	Err string `json:"error"`
}

Jump to

Keyboard shortcuts

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