ssh_session

package
v0.0.0-...-4892902 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateUserPrincipal

func GenerateUserPrincipal(serverUUID, userUUID string) string

func RenderKnownHostsRow

func RenderKnownHostsRow(s ext.Server) string

func RenderSSHConfigEntry

func RenderSSHConfigEntry(project iam.Project, s ext.Server, user auth.User) string

Types

type Session

type Session struct {
	UUID               string
	PermanentCache     model.Cache
	CachePath          string
	User               auth.User
	ServerList         *model.ServerList
	ServerFilter       model.ServerFilter
	VaultAuthReader    VaultAuthReader
	SSHAgent           agent.Agent
	SSHAgentSocketPath string
	SSHConfigFile      *os.File
	KnownHostsFile     *os.File
	BashRCFile         *os.File
	// contains filtered or unexported fields
}

func New

func New(vaultService vault.VaultService, serverFilter model.ServerFilter, cacheFilePath string, cacheTTL time.Duration) (*Session, error)

func (*Session) Close

func (s *Session) Close() error

func (*Session) RefreshClientCertificates

func (s *Session) RefreshClientCertificates() error

func (*Session) RenderBashRCToFile

func (s *Session) RenderBashRCToFile() error

func (*Session) RenderKnownHostsToFile

func (s *Session) RenderKnownHostsToFile() error

func (*Session) RenderSSHConfigToFile

func (s *Session) RenderSSHConfigToFile() error

func (*Session) Start

func (s *Session) Start() error

func (*Session) StartSSHAgent

func (s *Session) StartSSHAgent() error

func (*Session) StartShell

func (s *Session) StartShell() error

func (*Session) SyncServersFromVault

func (s *Session) SyncServersFromVault() error

type VaultAuthReader

type VaultAuthReader interface {
	// GetUser returns user which credentials are recognized by vault
	GetUser() (*auth.User, error)
	// UpdateServersByFilter returns ServerList synchronized with vault, according filter, using given ServerList as cache
	UpdateServersByFilter(model.ServerFilter, *model.ServerList) (*model.ServerList, error)
	// UpdateTenants update oldTenants by vault requests, according specified identifiers given by args
	UpdateTenants(map[iam.TenantUUID]iam.Tenant, model.StringSet) (map[iam.TenantUUID]iam.Tenant, error)
	// UpdateProjects update oldProjects by vault requests, according specified identifiers given by args
	UpdateProjects(map[iam.ProjectUUID]iam.Project, map[iam.TenantUUID]iam.Tenant,
		model.StringSet) (map[iam.TenantUUID]iam.Tenant, map[iam.ProjectUUID]iam.Project, error)
}

Jump to

Keyboard shortcuts

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